forked from Kohntarkosz/SDHCALMarlinProcessor
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
74 lines (51 loc) · 2.24 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
########################################################
# cmake file for building SDHCALMARLINProcessor
# @author Arnaud Steen
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
########################################################
# project name
PROJECT( sdhcalMarlin )
#run cmake in build directory with :
# cmake -C ${ILCSOFT}/ILCSoft.cmake -DCaloSoftWare_DIR=${CaloSoftWare} ../
# project version
SET( ${PROJECT_NAME}_VERSION_MAJOR 0 )
SET( ${PROJECT_NAME}_VERSION_MINOR 1 )
SET( ${PROJECT_NAME}_VERSION_PATCH 0 )
### DEPENDENCIES ############################################################
FIND_PACKAGE( ILCUTIL REQUIRED COMPONENTS ILCSOFT_CMAKE_MODULES )
# load default settings from ILCSOFT_CMAKE_MODULES
INCLUDE( ilcsoft_default_settings )
FIND_PACKAGE( Marlin 1.0 REQUIRED ) # minimum required Marlin version
FIND_PACKAGE( ROOT 6.08 REQUIRED ) # minimum required Marlin version
FIND_PACKAGE( CLHEP REQUIRED )
FIND_PACKAGE( LCIO REQUIRED )
FOREACH( pkg LCIO ROOT Marlin CLHEP )
IF( ${pkg}_FOUND )
INCLUDE_DIRECTORIES( SYSTEM ${${pkg}_INCLUDE_DIRS} )
LINK_LIBRARIES( ${${pkg}_LIBRARIES} )
ADD_DEFINITIONS ( ${${pkg}_DEFINITIONS} )
ENDIF()
ENDFOREACH()
FIND_PACKAGE( CaloSoftWare 1.1.7 REQUIRED )
FOREACH( pkg CaloSoftWare )
INCLUDE_DIRECTORIES( SYSTEM ${${pkg}_INCLUDE_DIRS} )
LINK_LIBRARIES( ${${pkg}_LIBRARIES} )
ADD_DEFINITIONS ( ${${pkg}_DEFINITIONS} )
ENDFOREACH()
### DOCUMENTATION ###########################################################
OPTION( INSTALL_DOC "Set to OFF to skip build/install Documentation" ON )
IF( INSTALL_DOC AND EXISTS "${PROJECT_SOURCE_DIR}/doc/CMakeLists.txt" )
ADD_SUBDIRECTORY( ./doc )
ENDIF()
### LIBRARY #################################################################
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ansi -pedantic -Wno-long-long -std=c++11")
# include directories
include_directories( ./include )
#INSTALL_DIRECTORY( ./include DESTINATION . FILES_MATCHING PATTERN "*.h" )
FILE(GLOB_RECURSE headers "include/*.h" "include/*.hpp")
FILE(GLOB_RECURSE sources "src/*.cc")
# add library
add_library( ${PROJECT_NAME} SHARED ${sources} ${headers} )
install( TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/lib )
# display some variables and write them to cache
DISPLAY_STD_VARIABLES()