-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
50 lines (35 loc) · 1.73 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
########################################################
# cmake file for building Marlin example Package
# @author Jan Engels, Desy IT
CMAKE_MINIMUM_REQUIRED(VERSION 3.6 FATAL_ERROR)
########################################################
# project name
PROJECT( SDHCALStuff )
### DEPENDENCIES ############################################################
FIND_PACKAGE( ILCUTIL REQUIRED COMPONENTS ILCSOFT_CMAKE_MODULES )
# load default settings from ILCSOFT_CMAKE_MODULES
INCLUDE( ilcsoft_default_settings )
FIND_PACKAGE( ROOT 6.08 REQUIRED COMPONENTS TMVA XMLIO Minuit MLP MathMore MathCore Minuit2 RooFit RooFitCore) # minimum required Marlin version
INCLUDE_DIRECTORIES( SYSTEM ${ROOT_INCLUDE_DIRS} )
LINK_LIBRARIES( ${ROOT_LIBRARIES} )
ADD_DEFINITIONS( ${ROOT_DEFINITIONS} )
### LIBRARY #################################################################
# definitions to pass to the compiler
ADD_DEFINITIONS( "-Wall -ansi -pedantic -std=c++11" )
ADD_DEFINITIONS( "-Wno-long-long" )
# include directories
INCLUDE_DIRECTORIES( ./include )
# add library
AUX_SOURCE_DIRECTORY( ./src library_sources )
# display some variables and write them to cache
DISPLAY_STD_VARIABLES()
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cpp)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.h ${PROJECT_SOURCE_DIR}/include/*.hpp)
add_library( MyLib ${sources} ${headers} )
file( GLOB APP_SOURCES ${PROJECT_SOURCE_DIR}/exec/*.cxx )
foreach( testsourcefile ${APP_SOURCES} )
get_filename_component(testname ${testsourcefile} NAME_WE)
add_executable( ${testname} ${testsourcefile} )
target_link_libraries( ${testname} MyLib ${ROOT_COMPONENT_LIBRARIES} )
install(TARGETS ${testname} RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/bin)
endforeach( testsourcefile ${APP_SOURCES} )