1
- cmake_minimum_required (VERSION 2.6 ...4.0 )
1
+ cmake_minimum_required (VERSION 3.8 ...4.0 )
2
2
project (fast++ C CXX )
3
3
4
4
if (NOT CMAKE_BUILD_TYPE )
@@ -23,20 +23,6 @@ execute_process(
23
23
OUTPUT_STRIP_TRAILING_WHITESPACE
24
24
)
25
25
26
- if (GIT_COMMAND_SUCCESS EQUAL 0 )
27
- add_definitions (-DFASTPP_GIT_HASH= "${GIT_COMMIT_HASH} " )
28
- else ()
29
- add_definitions (-DFASTPP_GIT_HASH= "" )
30
- endif ()
31
-
32
- # Setup share directory
33
- add_definitions (-DFASTPP_SHARE_DIR= "${FASTPP_SHARE_DIR} " )
34
-
35
- # Include dependencies
36
- message (STATUS ${VIF_INCLUDE_DIRS} )
37
- include_directories (${VIF_INCLUDE_DIRS} )
38
- include_directories (${TINYEXPR_INCLUDE_DIR} )
39
-
40
26
# Build FAST++
41
27
add_executable (fast++
42
28
fast++-read_input.cpp
@@ -47,15 +33,29 @@ add_executable(fast++
47
33
fast++-fitter.cpp
48
34
fast++-write_output.cpp
49
35
fast++.cpp )
50
- target_link_libraries (fast++ ${VIF_LIBRARIES} )
51
- target_link_libraries (fast++ ${TINYEXPR_LIBRARY} )
36
+
37
+ if (GIT_COMMAND_SUCCESS EQUAL 0 )
38
+ target_compile_options (fast++ PRIVATE -DFASTPP_GIT_HASH= "${GIT_COMMIT_HASH} " )
39
+ else ()
40
+ target_compile_options (fast++ PRIVATE -DFASTPP_GIT_HASH= "" )
41
+ endif ()
42
+ target_compile_options (fast++ PRIVATE -DFASTPP_SHARE_DIR= "${FASTPP_SHARE_DIR} " )
43
+ target_compile_features (fast++ PRIVATE cxx_std_11 )
44
+ target_include_directories (fast++ PRIVATE ${VIF_INCLUDE_DIRS} )
45
+ target_include_directories (fast++ PRIVATE ${TINYEXPR_INCLUDE_DIR} )
46
+ target_link_libraries (fast++ PRIVATE ${VIF_LIBRARIES} )
47
+ target_link_libraries (fast++ PRIVATE ${TINYEXPR_LIBRARY} )
52
48
install (TARGETS fast++ DESTINATION bin )
53
49
54
50
# Build FAST++ helper tools
55
51
add_executable (fast++-grid2fits fast++-grid2fits.cpp )
52
+ target_compile_features (fast++-grid2fits PRIVATE cxx_std_11 )
53
+ target_include_directories (fast++-grid2fits PRIVATE ${VIF_INCLUDE_DIRS} )
56
54
target_link_libraries (fast++-grid2fits ${VIF_LIBRARIES} )
57
55
install (TARGETS fast++-grid2fits DESTINATION bin )
58
56
59
57
add_executable (fast++-sfh2sed fast++-sfh2sed.cpp fast++-ssp.cpp )
58
+ target_compile_features (fast++-sfh2sed PRIVATE cxx_std_11 )
59
+ target_include_directories (fast++-sfh2sed PRIVATE ${VIF_INCLUDE_DIRS} )
60
60
target_link_libraries (fast++-sfh2sed ${VIF_LIBRARIES} )
61
61
install (TARGETS fast++-sfh2sed DESTINATION bin )
0 commit comments