-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
94 lines (80 loc) · 2.79 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
####### CMakeLists.txt for Compton Soft
cmake_minimum_required(VERSION 3.30)
### Initial definition of cmake variables
set(CMAKE_INSTALL_PREFIX $ENV{HOME} CACHE PATH "install prefix")
set(CMAKE_BUILD_TYPE Release CACHE STRING "build type")
# set(CMAKE_BUILD_TYPE Debug CACHE STRING "build type")
set(CMAKE_CXX_FLAGS_DEBUG "-g -W -Wall" CACHE STRING "CXX_FLAGS for debug")
set(CMAKE_C_FLAGS_DEBUG "-g -W -Wall" CACHE STRING "C_FLAGS for debug")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -W -Wall" CACHE STRING "CXX_FLAGS for release")
set(CMAKE_C_FLAGS_RELEASE "-O3 -W -Wall" CACHE STRING "C_FLAGS for release")
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
### Definition of project
project(ComptonSoft)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${ComptonSoft_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
message("-- Install destination prefix: ${CMAKE_INSTALL_PREFIX}")
list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
### options
## interface options
option(CS_USE_RUBY "enable Ruby binding" ON)
option(CS_USE_EXE "enable standalone executables" OFF)
## library options
option(CS_USE_GDML "enable GDML" ON)
option(CS_USE_VIS_QT "enable visualization with Qt" ON)
option(CS_USE_FITSIO "enable FITS IO" OFF)
option(CS_USE_HEALPIX "enable HEALPix" OFF)
option(CS_USE_HSQUICKLOOK "enable HSQuickLook" OFF)
option(CS_USE_SIMX "enable SimX compatible simulation" OFF)
option(CS_USE_VIS "enable visualization with OpenGL" OFF)
option(CS_USE_SYSTEM_CLHEP "use system-clhep" OFF)
## install options
option(CS_INSTALL_HEADERS "install all header files" ON)
option(CS_INSTALL_CMAKE_FILES "install all cmake files" ON)
## shortcut options
option(CS_ALL "enable all consistent library options" OFF)
option(CS_ALL_OFF "disable all consistent library options" OFF)
option(CS_HARD_ALL "enable all library options" OFF)
if(CS_ALL)
set(CS_USE_GDML ON)
set(CS_USE_VIS_QT ON)
set(CS_USE_FITSIO ON)
set(CS_USE_HEALPIX ON)
set(CS_USE_HSQUICKLOOK ON)
endif(CS_ALL)
if(CS_ALL_OFF)
set(CS_USE_GDML OFF)
set(CS_USE_VIS_QT OFF)
set(CS_USE_FITSIO OFF)
set(CS_USE_HEALPIX OFF)
set(CS_USE_HSQUICKLOOK OFF)
endif(CS_ALL_OFF)
if(CS_HARD_ALL)
set(CS_USE_GDML ON)
set(CS_USE_VIS_QT ON)
set(CS_USE_FITSIO ON)
set(CS_USE_HEALPIX ON)
set(CS_USE_HSQUICKLOOK ON)
set(CS_USE_SIMX ON)
endif(CS_HARD_ALL)
set(USE_RUBY ${CS_USE_RUBY})
set(USE_EXE ${CS_USE_EXE})
set(INSTALL_HEADERS ${CS_INSTALL_HEADERS})
set(INSTALL_CMAKE_FILES ${CS_INSTALL_CMAKE_FILES})
set(ANLG4_USE_GDML ${CS_USE_GDML})
set(ANLG4_USE_VIS ${CS_USE_VIS})
set(ANLG4_USE_VIS_QT ${CS_USE_VIS_QT})
### include definitions
include(def_cs)
### subdirectories
add_subdirectory(anlgeant4)
add_subdirectory(source)
if(USE_EXE)
add_subdirectory(executables)
endif(USE_EXE)
if(USE_RUBY)
add_subdirectory(rubyext)
endif(USE_RUBY)
add_subdirectory(cmake)
### END