forked from KFTrack/KinKal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (48 loc) · 1.99 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
cmake_minimum_required(VERSION 3.9.0)
# always use gcc
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
# enable c++17 standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(CMAKE_CXX_FLAGS "-Wall -Wno-unused-parameter -Wno-unused-local-typedefs -Werror -gdwarf-2 -Werror=return-type -Winit-self -Woverloaded-virtual -ftrapping-math"
CACHE STRING "Flags (all configurations)" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-g -Og"
CACHE STRING "Debug flags" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -fno-omit-frame-pointer"
CACHE STRING "Release/Prof flags" FORCE)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()
message( "Build Type: ${CMAKE_BUILD_TYPE}" )
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
project (KinKal CXX)
find_package(ROOT REQUIRED COMPONENTS Core RIO Net Hist GenVector MLP Graf Graf3d Gpad Tree Rint Postscript Matrix Physics MathCore Thread Gui)
# include "useful" ROOT headers
include(${ROOT_USE_FILE})
include_directories(${PROJECT_SOURCE_DIR})
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
enable_testing()
add_subdirectory(MatEnv)
add_subdirectory(KinKal)
add_subdirectory(UnitTests)
message ("Writing setup.sh...")
file(WRITE ${PROJECT_BINARY_DIR}/setup.sh "
#
# Do not hand edit this file. It was generated by CMake.
(return 0 2>/dev/null) && sourced=1 || sourced=0
if [ \"\$sourced\" = \"0\" ];then
echo \"You should be sourcing this file, not executing it.\"
exit 1
fi
export PACKAGE_SOURCE=${CMAKE_SOURCE_DIR}
export DEBUG_LEVEL=${CMAKE_BUILD_TYPE}
source \${PACKAGE_SOURCE}/setup.sh
export LD_LIBRARY_PATH=\${PWD}/lib:\${LD_LIBRARY_PATH}
# MacOS:
export DYLD_FALLBACK_LIBRARY_PATH=\${PWD}/lib:\${ROOT_LIB}:\${DYLD_FALLBACK_LIBRARY_PATH}
")