-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
executable file
·55 lines (43 loc) · 1.82 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
cmake_minimum_required (VERSION 3.21 FATAL_ERROR)
project (Thermus)
# checked on 20/07/2021 with root-v6-24-02 (B.H.)
# Find GSL
FIND_PACKAGE( GSL REQUIRED )
if ( NOT GSL_FOUND )
message(FATAL_ERROR "GSL is required but missing !")
endif ( NOT GSL_FOUND )
# Check ROOT and Mathmore
FIND_PACKAGE( ROOT REQUIRED COMPONENTS MathMore )
if ( NOT ROOT_FOUND )
message(FATAL_ERROR "ROOT is required but missing !")
endif ( NOT ROOT_FOUND )
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
include(${ROOT_USE_FILE})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET (CMAKE_INSTALL_BINDIR ${CMAKE_BINARY_DIR}/bin)
SET (CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/lib)
include_directories("include" "main" ${ROOT_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS})
if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_SHARED_LIBRARY_SUFFIX .so)
endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
if(${CMAKE_SYSTEM} MATCHES Darwin)
set (CMAKE_SHARED_LINKER_FLAGS "-single_module -undefined dynamic_lookup -lm")
endif(${CMAKE_SYSTEM} MATCHES Darwin)
message(STATUS "Customised the linking flags depending on the platform: ${CMAKE_SHARED_LINKER_FLAGS}")
foreach(p
CMP0042 # MACOSX_RPATH is enabled by default (v3.0)
CMP0053 # Simplify variable reference and escape sequence evaluation (v3.1.3)
)
if ( POLICY ${p} )
cmake_policy(SET ${p} NEW)
endif()
endforeach()
message(STATUS "Source folder: ${Thermus_SOURCE_DIR}")
message(STATUS " which should correspond to $THERMUS ")
message(STATUS "CMake platform: ${CMAKE_SYSTEM}")
message(STATUS "Build folder: ${Thermus_BINARY_DIR}")
message(STATUS "Shared Object Library folder: ${Thermus_BINARY_DIR}/lib")
add_subdirectory(functions)
add_subdirectory(main)