@@ -7,15 +7,17 @@ set (IPPL_VERSION_NAME "V${IPPL_VERSION_MAJOR}.${IPPL_VERSION_MINOR}")
7
7
8
8
set (IPPL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
9
9
10
+ include (CMakePrintHelpers )
11
+
10
12
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE )
11
- set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
12
- "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
13
- FORCE
14
- )
13
+ set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
14
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
15
+ FORCE
16
+ )
15
17
endif ()
16
18
17
19
if (${CMAKE_BUILD_TYPE} STREQUAL "Release" )
18
- add_definitions (-DNOPAssert )
20
+ add_definitions (-DNOPAssert )
19
21
endif ()
20
22
21
23
add_compile_options (-Wall )
@@ -39,7 +41,7 @@ set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
39
41
40
42
# Compile using C++20 for CPU builds
41
43
if (${CMAKE_CXX_COMPILER} MATCHES ".*mpicxx" )
42
- set (CMAKE_CXX_STANDARD 20 )
44
+ set (CMAKE_CXX_STANDARD 20 )
43
45
endif ()
44
46
45
47
@@ -59,9 +61,9 @@ find_package(Kokkos REQUIRED)
59
61
60
62
option (ENABLE_FFT "Enable FFT transform" OFF )
61
63
if (ENABLE_FFT )
62
- add_definitions (-DENABLE_FFT )
63
- find_package (Heffte 2.2.0 REQUIRED )
64
- message (STATUS "Found Heffte_DIR: ${Heffte_DIR} " )
64
+ add_definitions (-DENABLE_FFT )
65
+ find_package (Heffte 2.2.0 REQUIRED )
66
+ message (STATUS "Found Heffte_DIR: ${Heffte_DIR} " )
65
67
endif ()
66
68
67
69
option (ENABLE_SOLVERS "Enable IPPL solvers" OFF )
@@ -70,26 +72,31 @@ add_subdirectory (src)
70
72
71
73
option (ENABLE_TESTS "Enable IPPL tests" OFF )
72
74
if (ENABLE_TESTS )
73
- add_subdirectory (test )
75
+ add_subdirectory (test )
74
76
endif ()
75
77
76
78
option (ENABLE_ALPINE, "Enable Alpine" OFF )
77
79
if (ENABLE_ALPINE )
78
- if (NOT ENABLE_SOLVERS )
79
- message (FATAL_ERROR "Cannot enable Alpine since Solver not enabled (-DENABLE_SOLVERS=ON)!" )
80
- endif ()
81
- if (NOT ENABLE_FFT )
82
- message (FATAL_ERROR "Cannot enable Alpine since FFT not enabled (-DENABLE_FFT=ON)!" )
83
- endif ()
84
- message (STATUS "Enable Alpine" )
85
- add_subdirectory (alpine )
80
+ if (NOT ENABLE_SOLVERS )
81
+ message (FATAL_ERROR "Cannot enable Alpine since Solver not enabled (-DENABLE_SOLVERS=ON)!" )
82
+ endif ()
83
+ if (NOT ENABLE_FFT )
84
+ message (FATAL_ERROR "Cannot enable Alpine since FFT not enabled (-DENABLE_FFT=ON)!" )
85
+ endif ()
86
+ message (STATUS "Enable Alpine" )
87
+ add_subdirectory (alpine )
86
88
endif ()
87
89
88
90
option (ENABLE_CATALYST "Build example with Catalyst enabled" ON )
89
91
if (ENABLE_CATALYST )
90
92
get_property (importTargets DIRECTORY "${CMAKE_SOURCE_DIR} " PROPERTY IMPORTED_TARGETS )
91
93
92
- find_package (catalyst REQUIRED )
94
+ find_package (catalyst 2.0 REQUIRED )
95
+
96
+ cmake_print_properties (
97
+ TARGETS catalyst::catalyst
98
+ PROPERTIES POSITION_INDEPENDENT_CODE
99
+ )
93
100
get_property (importTargetsAfter DIRECTORY "${CMAKE_SOURCE_DIR} " PROPERTY IMPORTED_TARGETS )
94
101
list (REMOVE_ITEM importTargetsAfter ${importTargets} )
95
102
@@ -100,18 +107,18 @@ endif ()
100
107
101
108
option (ENABLE_UNIT_TESTS "Enable unit tests" OFF )
102
109
if (ENABLE_UNIT_TESTS )
103
- find_package (GTest REQUIRED HINT $ENV{GTEST_PREFIX} )
104
- add_subdirectory (unit_tests )
110
+ find_package (GTest REQUIRED HINT $ENV{GTEST_PREFIX} )
111
+ add_subdirectory (unit_tests )
105
112
endif ()
106
113
107
114
configure_file (${CMAKE_CURRENT_SOURCE_DIR} /cmake/${PROJECT_NAME}Config.cmake.in
108
- ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}Config_install.cmake )
115
+ ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}Config_install.cmake )
109
116
110
117
install (
111
- FILES ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}Config_install.cmake
112
- DESTINATION "${CMAKE_INSTALL_PREFIX} /lib/cmake/${PROJECT_NAME} "
113
- RENAME ${PROJECT_NAME} Config.cmake
114
- )
118
+ FILES ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}Config_install.cmake
119
+ DESTINATION "${CMAKE_INSTALL_PREFIX} /lib/cmake/${PROJECT_NAME} "
120
+ RENAME ${PROJECT_NAME} Config.cmake
121
+ )
115
122
116
123
# vi: set et ts=4 sw=4 sts=4:
117
124
0 commit comments