-
Notifications
You must be signed in to change notification settings - Fork 119
/
CMakeLists.txt
42 lines (36 loc) · 1.31 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
cmake_minimum_required(VERSION 3.5)
project(hcana VERSION 1.1 LANGUAGES CXX)
option(HCANA_BUILTIN_PODD "Use built-in Podd submodule (default: YES)" ON)
#----------------------------------------------------------------------------
# Set up Podd and ROOT dependencies
if(HCANA_BUILTIN_PODD)
list(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_SOURCE_DIR}/podd/cmake/Modules")
include(PoddCMakeEnv)
find_package(ROOT 6.00 REQUIRED)
config_add_dependency(ROOT 6.00)
else()
# Find Podd and register it as a dependency
# This will also automatically set up ROOT
find_package(Podd 1.6 REQUIRED)
include(PoddCMakeEnv)
config_add_dependency(Podd 1.6)
endif()
#----------------------------------------------------------------------------
# Install in GNU-style directory layout
include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/${MAIN_PROJECT_NAME_LC})
if(PODD_SET_RPATH)
set_install_rpath()
endif()
#----------------------------------------------------------------------------
# Set up the compiler flags
set_compiler_flags("${ROOT_CXX_FLAGS}")
set_diagnostic_flags(WALL WEXTRA)
report_build_info()
#----------------------------------------------------------------------------
# Directories in which we build things
if(HCANA_BUILTIN_PODD)
add_subdirectory(podd)
endif()
add_subdirectory(src)
add_subdirectory(cmake)