-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
78 lines (65 loc) · 2.64 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
77
78
# ----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
include(ExternalProject)
set(CMAKE_MACOSX_RPATH 1)
set_library_version(LibraryVersion)
add_definitions(-DLIBRARY_VERSION="${LibraryVersion}")
if (${REST_MPFR} MATCHES "ON")
find_path(MPFR_FOUND mpfr.h)
if (MPFR_FOUND MATCHES "MPFR_FOUND-NOTFOUND")
if (EXISTS ${MPFR_PATH}/include/mpfr.h)
set(MPFR_FOUND FOUND)
endif ()
endif ()
if (MPFR_FOUND MATCHES "MPFR_FOUND-NOTFOUND")
message(
FATAL_ERROR
"MPFR library was not found. Adding the location to the installation path may solve this problem.\n Use -DMPFR_PATH=/path/to/mpfr/"
)
else ()
set(external_include_dirs ${external_include_dirs} ${MPFR_PATH}/include)
link_directories(${MPFR_PATH}/lib)
endif ()
endif (${REST_MPFR} MATCHES "ON")
# -------------------------------------------------------------------------------------------------------
# Add the SolarAxionFlux library submodule as an external project.
if (${REST_SOLAXFLUX} MATCHES "ON")
# Integration of REST_SolaxFlux comes now as an option. It causes problems
# when active development happens at that library It should be fixed a
# versioning system. Probably through choosing the right submodule commit
# that works with RestAxionLib.
#
# For the moment I will just encapsulate SolaxFlux library to be able to
# compile and use a dummy/standard solar axion flux generation.
add_definitions(-DUSE_SolaxFlux)
set(SOLAXFLUX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/solarAxionFlux")
message(STATUS "SOLAXFLUX_DIR: ${SOLAXFLUX_DIR}")
ExternalProject_Add(
solaxflux
SOURCE_DIR ${SOLAXFLUX_DIR}
GIT_SUBMODULES ""
GIT_CONFIG advice.detachedHead=False
CMAKE_CACHE_ARGS
"-DPYTHON_SUPPORT:STRING=OFF;-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}"
)
link_directories(${SOLAXFLUX_DIR}/lib)
set(external_include_dirs ${external_include_dirs} ${SOLAXFLUX_DIR}/include)
set(external_libs ${external_libs} -laxionflux)
endif (${REST_SOLAXFLUX} MATCHES "ON")
if (${REST_MPFR} MATCHES "ON")
set(external_libs ${external_libs} -lmpfr)
else ()
set(external_libs ${external_libs})
endif (${REST_MPFR} MATCHES "ON")
compilelib("")
install(
DIRECTORY ./data/
DESTINATION ./data/axion/
COMPONENT install)
install(
DIRECTORY ./examples/
DESTINATION ./examples/axion/
COMPONENT install)
file(GLOB_RECURSE MAC "${CMAKE_CURRENT_SOURCE_DIR}/macros/*")
install(FILES ${MAC} DESTINATION ./macros/axion)