-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
84 lines (64 loc) · 2.94 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
#
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their
# definition
# and dump it in the cache along with proper documentation, otherwise set
# CMAKE_BUILD_TYPE
# to Debug prior to calling PROJECT()
#
# Project Definition
project(CPToyMC)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_CXX_FLAGS_DBG "-O0 -ggdb -pg" CACHE STRING "Debug options." FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "Debug options." FORCE)
set(CMAKE_CXX_FLAGS_PROFILING "-O3 -pg" CACHE STRING "Debug options." FORCE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{DOOMODULESYS}/cmake/Modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
if(${APPLE})
message( STATUS "Building for Mac OS X, switching on C++11 flags for Mac OS X/clang" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -pedantic -Wall -Wextra")
endif(${APPLE})
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message( STATUS "Building for Linux, switching on C++11 flags for Linux/gcc" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -pedantic -Wall -Wextra")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message( STATUS "CXX flags are ${CMAKE_CXX_FLAGS}")
set(BASEPATH "${CMAKE_SOURCE_DIR}/src")
include_directories(${BASEPATH})
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
find_package(Boost 1.55 COMPONENTS program_options filesystem thread system random REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR})
find_package(ROOT REQUIRED)
include_directories(${ROOT_INCLUDE_DIR})
link_directories(${ROOT_LIBRARY_DIR})
set(ALL_LIBRARIES ${ROOT_LIBRARIES} ${ROOFIT_LIBRARIES} ${ADDITIONAL_LIBRARIES} "-lTreePlayer")
if(DEFINED ENV{DOOCORESYS})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{DOOCORESYS}/cmake/Modules/")
find_package(DooCore REQUIRED)
include_directories(${DooCore_INCLUDE_DIR})
link_directories(${DooCore_LIBRARY_DIR})
set(DOOSOFT_LIBRARIES ${DooCore_LIBRARIES})
if(DEFINED ENV{DOOFITSYS})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{DOOFITSYS}/cmake/Modules/")
find_package(DooFit REQUIRED)
include_directories(${DooFit_INCLUDE_DIR})
link_directories(${DooFit_LIBRARY_DIR})
set(DOOSOFT_LIBRARIES ${DOOSOFT_LIBRARIES} ${DooFit_LIBRARIES})
endif()
if(DEFINED ENV{DOOSELECTIONSYS})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{DOOSELECTIONSYS}/cmake/Modules/")
find_package(DooSelection REQUIRED)
include_directories(${DooSelection_INCLUDE_DIR})
link_directories(${DooSelection_LIBRARY_DIR})
set(DOOSOFT_LIBRARIES ${DOOSOFT_LIBRARIES} ${DooSelection_LIBRARIES})
endif()
else()
message( STATUS "Could not find DOOCORESYS environment variable. Omitting all DooSoftware dependent parts.")
endif()
add_subdirectory(main)
add_subdirectory(sandbox)
add_subdirectory(src)
if(DEFINED ENV{DOOCORESYS} AND DEFINED ENV{DOOFITSYS})
add_subdirectory(tests)
endif()