-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
109 lines (85 loc) · 3.09 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
cmake_minimum_required(VERSION 3.12)
project(CORHPX LANGUAGES CXX VERSION 1.0)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libcor/include/cor/CORHPXConfig.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/libcor/include/cor/CORHPXConfig.h" )
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
#set(LibSSH_ROOT /share/apps/libssh-0.8.6)
#set(LibSSH_ROOT /share/apps/root_v6.16)
# find dependencies
find_package(HPX REQUIRED)
find_package(LibSSH REQUIRED)
# find root and set up environment
# find_package(ROOT CONFIG REQUIRED)
# target_include_directories(ROOT::Core INTERFACE "${ROOT_INCLUDE_DIRS}")
# check subdirectories
add_subdirectory(libcor)
add_subdirectory(tools)
add_subdirectory(examples)
add_subdirectory(cap6)
install(
DIRECTORY
"libcor/include/cor"
DESTINATION
"include"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.tpp"
PATTERN "*.h"
)
install(
DIRECTORY
"units"
DESTINATION
"include/cor"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.tpp"
PATTERN "*.h"
)
set(DEF_INSTALL_CMAKE_DIR CMake)
set(DEF_INSTALL_CMAKE_DIR lib/CMake/CORHPX)
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH
"Installation directory for CMake files")
# Make relative paths absolute (needed later on)
foreach(p LIB BIN INCLUDE CMAKE)
set(var INSTALL_${p}_DIR)
if(NOT IS_ABSOLUTE "${${var}}")
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
endforeach()
# set up include-directories
include_directories(
"${PROJECT_SOURCE_DIR}" # to find foo/foo.h
"${PROJECT_BINARY_DIR}") # to find foo/config.h
# The interesting stuff goes here
# ===============================
# Add all targets to the build-tree export set
export(TARGETS libcor FILE "${PROJECT_BINARY_DIR}/CORHPXTargets.cmake")
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE CORHPX)
# Create the CORHPXConfig.cmake and CORHPXConfigVersion files
file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}"
"${INSTALL_INCLUDE_DIR}")
# ... for the build tree
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
configure_file(CORHPXConfig.cmake.in
"${PROJECT_BINARY_DIR}/CORHPXConfig.cmake" @ONLY)
# ... for the install tree
set(CONF_INCLUDE_DIRS "\${CORHPX_CMAKE_DIR}/${REL_INCLUDE_DIR}")
configure_file(CORHPXConfig.cmake.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CORHPXConfig.cmake" @ONLY)
# ... for both
configure_file(CORHPXConfigVersion.cmake.in
"${PROJECT_BINARY_DIR}/CORHPXConfigVersion.cmake" @ONLY)
# Install the CORHPXConfig.cmake and CORHPXConfigVersion.cmake
install(FILES
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CORHPXConfig.cmake"
"${PROJECT_BINARY_DIR}/CORHPXConfigVersion.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)
# Install the export set for use with the install-tree
#install(EXPORT CORHPXTargets DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)