forked from AIDASoft/podio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·68 lines (52 loc) · 2.46 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
cmake_minimum_required(VERSION 2.8)
project(podio)
set( podio_VERSION_MAJOR 0 )
set( podio_VERSION_MINOR 1 )
set( podio_VERSION_PATCH 0 )
set( podio_VERSION "${podio_VERSION_MAJOR}.${podio_VERSION_MINOR}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(APPLE)
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif(APPLE)
#--- Declare options -----------------------------------------------------------
option(podio_documentation "Whether or not to create doxygen doc target.")
option(podio_tests "Whether or not to create target for unittest (depends on google-tests).")
#--- Declare ROOT dependency ---------------------------------------------------
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(ROOT REQUIRED COMPONENTS RIO Tree)
include_directories(${ROOT_INCLUDE_DIR})
add_definitions(-Wno-unused-variable -Wno-unused-parameter -pthread)
#add_definitions(-Wpadded)
#--temporary fix of inconsistency in ROOT CMake macros
set(ROOT_genreflex_cmd ${ROOT_genreflex_CMD})
add_definitions(-Wno-unused-variable -Wno-unused-parameter)
#--- enable unit testing capabilities ------------------------------------------
include(CTest)
#--- enable CPack --------------------------------------------------------------
include(cmake/podioCPack.cmake)
#--- target for Doxygen documentation ------------------------------------------
if(podio_documentation)
include(cmake/podioDoxygen.cmake)
endif()
#--- add version files ---------------------------------------------------------
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/podioVersion.h
${CMAKE_CURRENT_BINARY_DIR}/podioVersion.h )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/podioVersion.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/podio )
#--- add CMake infrastructure --------------------------------------------------
include(cmake/podioCreateConfig.cmake)
#--- add license files ---------------------------------------------------------
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE
${CMAKE_CURRENT_SOURCE_DIR}/NOTICE
DESTINATION ${CMAKE_INSTALL_PREFIX})
#--- install templates ---------------------------------------------------------
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/templates
DESTINATION ${CMAKE_INSTALL_PREFIX})
#--- project specific subdirectories -------------------------------------------
add_subdirectory(python)
add_subdirectory(src)
add_subdirectory(examples)
if(podio_tests)
add_subdirectory(tests)
endif()