-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (50 loc) · 2.67 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
########################################################
# cmake file for building TimingAnalysis
# @author Remi Ete, DESY
cmake_minimum_required( VERSION 3.14 FATAL_ERROR )
########################################################
# project name
project( TimingAnalysis LANGUAGES CXX )
# project version
set( ${PROJECT_NAME}_VERSION_MAJOR 0 )
set( ${PROJECT_NAME}_VERSION_MINOR 0 )
set( ${PROJECT_NAME}_VERSION_PATCH 1 )
### DEPENDENCIES ############################################################
# options
option( INSTALL_DOC "Set to OFF to skip build/install Documentation" OFF )
find_package( ILCUTIL REQUIRED COMPONENTS streamlog ILCSOFT_CMAKE_MODULES )
find_package( Marlin 01.17 REQUIRED )
# find_package( MarlinMT REQUIRED )
find_package( ROOT 6.16 REQUIRED )
include( ilcsoft_default_settings )
include( GNUInstallDirs )
# make the package library
file( GLOB library_sources source/src/*.cc )
add_library( ${PROJECT_NAME} SHARED ${library_sources} )
add_library( ${PROJECT_NAME}::Core ALIAS ${PROJECT_NAME} )
target_include_directories( ${PROJECT_NAME} BEFORE PUBLIC source/include )
target_include_directories( ${PROJECT_NAME} SYSTEM PRIVATE ${streamlog_INCLUDE_DIRS} )
target_link_libraries( ${PROJECT_NAME} PUBLIC ROOT::Core ${streamlog_LIBRARIES} )
install( TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
# TODO: install include directories if needed....
# make Marlin processors library
file( GLOB processors_sources source/plugins/marlin/*.cc )
add_library( ${PROJECT_NAME}Processors MODULE ${processors_sources} )
add_library( ${PROJECT_NAME}::MarlinProcessors ALIAS ${PROJECT_NAME}Processors )
target_include_directories( ${PROJECT_NAME}Processors SYSTEM PUBLIC ${Marlin_INCLUDE_DIRS} )
target_link_libraries( ${PROJECT_NAME}Processors PUBLIC ${PROJECT_NAME}::Core ${Marlin_LIBRARIES} )
install( TARGETS ${PROJECT_NAME}Processors LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
# make MarlinMT processors library
# file( GLOB processors_sources source/plugins/marlin/*.cc )
# add_library( ${PROJECT_NAME}Processors MODULE ${processors_sources} )
# add_library( ${PROJECT_NAME}Processors ALIAS ${PROJECT_NAME}::MarlinProcessors )
# target_link_libraries( ${PROJECT_NAME}Processors PUBLIC ${PROJECT_NAME}::Core MarlinMT::Core )
### DOCUMENTATION ###########################################################
if( INSTALL_DOC )
add_subdirectory( doc )
install( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_BUILD_TOOL} doc)" )
endif()
# display some variables and write them to cache
DISPLAY_STD_VARIABLES()
# generate and install following configuration files
# GENERATE_PACKAGE_CONFIGURATION_FILES( ${PROJECT_NAME}Config.cmake ${PROJECT_NAME}ConfigVersion.cmake )