-
Notifications
You must be signed in to change notification settings - Fork 20
/
CMakeLists.txt
73 lines (62 loc) · 2.28 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
cmake_minimum_required (VERSION 3.0)
project(ant)
# check for in-source build, forbid it!
if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "\nIn-source build attempt detected!\n"
"Please create a new directory (e.g. build) and run `cmake ..`.\n"
"Also don't forget to delete the created CMakeCache.txt and CMakeFiles dir"
)
endif()
include(cmake/settings.cmake)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")
message(STATUS "*** Build Type: " ${CMAKE_BUILD_TYPE})
message(STATUS "*** Compiler Flags: " ${DEFAULT_COMPILE_FLAGS})
message(STATUS "*** Linker Flags: " ${DEFAULT_LINKER_FLAGS})
message(STATUS "*** Install libs to: " ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
message(STATUS "*** Install bin to: " ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
# require a fairly recent ROOT version
# this is needed by all subdirectories
find_package(ROOT "5.30" REQUIRED)
if(NOT ROOT_mathmore_FOUND)
message(FATAL_ERROR "ROOT was not compiled with MathMore support."
"Ensure libgsl-dev is installed while building ROOT.")
endif()
find_package(Pluto REQUIRED)
find_package(APLCONpp REQUIRED)
find_package(GSL REQUIRED)
link_directories(${ROOT_LIBRARY_DIR})
# including them as SYSTEM prevents
# many false-positive warnings
include_directories(SYSTEM
${ROOT_INCLUDE_DIR}
${PLUTO_INCLUDE_DIR}
${APLCONpp_INCLUDE_DIR}
${GSL_INCLUDE_DIR}
third-party
)
# now the relevant subdirectories
add_subdirectory(third-party)
add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(progs)
include(cmake/doxygen.cmake)
# create a rootlogon.C
configure_file(cmake/rootlogon.C.in rootlogon.C)
# link the AntSubmit file
add_custom_target(link_AntSubmit ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink
"${CMAKE_SOURCE_DIR}/extra/AntSubmit"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/AntSubmit"
)
# link the AntSimSubmit file
add_custom_target(link_AntSimSubmit ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink
"${CMAKE_SOURCE_DIR}/extra/SimulationBlaster/Ant_simulation_blaster.py"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/AntSimSubmit"
)
# link the AntMapReduce file
add_custom_target(link_AntMapReduce ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink
"${CMAKE_SOURCE_DIR}/extra/AntMapReduce"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/AntMapReduce"
)