forked from robashaw/libecpint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
76 lines (63 loc) · 2.45 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# minimum version of CMake is 3.12
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
include(CheckCXXCompilerFlag)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11
# build type
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type specified. Will build Release.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type (Release/Debug/RelWithDebInfo)")
else()
string(TOUPPER "${CMAKE_BUILD_TYPE}" _upper_build_type)
if("${_upper_build_type}" STREQUAL "DEBUG")
add_compile_definitions(DEBUG)
endif()
endif(NOT CMAKE_BUILD_TYPE)
# define project
project( libecpint
VERSION 1.0.6
LANGUAGES C CXX)
set(API_VERSION 1)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
# code generator variables
set(LIBECPINT_MAX_L "5" CACHE STRING "Maximum angular momentum")
set(LIBECPINT_MAX_UNROL "1" CACHE STRING "Maximum L for unrolling")
# configure the config header to pass the above variables to the program
configure_file (
"${PROJECT_SOURCE_DIR}/include/libecpint/config.hpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/include/libecpint/config.hpp"
)
include(GNUInstallDirs)
include(ExternalProject)
option(LIBECPINT_USE_PUGIXML "Use pugixml and build file reading routines." ON)
if (LIBECPINT_USE_PUGIXML)
include(external/ImportPugiXML.cmake)
add_compile_definitions(HAS_PUGIXML)
else()
message(STATUS "pugixml not configured; reading ECP definitions from files is disabled.")
endif()
add_subdirectory(external)
add_subdirectory(src)
option(LIBECPINT_BUILD_TESTS "Enables Libecpint tests." ON)
if (LIBECPINT_BUILD_TESTS)
message(STATUS "Will build libecpint tests.")
include(CTest)
include(external/ImportGTest.cmake)
enable_testing()
add_subdirectory(tests)
endif()
option(LIBECPINT_BUILD_DOCS "Enables Libecpint documentation." ON)
if (LIBECPINT_BUILD_DOCS)
add_subdirectory(doc)
endif()
install(DIRECTORY include/libecpint DESTINATION include)
install(FILES include/libecpint.hpp DESTINATION include)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/libecpint/config.hpp" DESTINATION include/libecpint)
install(DIRECTORY share/libecpint DESTINATION share)
message("\nSummary:")
message("--------")
message(STATUS "Maximum angular momentum : ${LIBECPINT_MAX_L}")
message(STATUS "Maximum angular momentum unrolling : ${LIBECPINT_MAX_UNROL}")
message(STATUS "Build tests : ${LIBECPINT_BUILD_TESTS}")
message("")