This repository has been archived by the owner on May 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (42 loc) · 1.75 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
cmake_minimum_required( VERSION 3.15 )
project( ActsDD4hep VERSION 1.0.1 LANGUAGES CXX )
include(GNUInstallDirs) # GNU-like installation paths, e.g. lib/, include/, ...
set(public_headers
"include/ActsDD4hep/ActsExtension.hpp"
"include/ActsDD4hep/ActsExtension.ipp"
"include/ActsDD4hep/ConvertMaterial.hpp"
)
find_package(DD4hep 1.11 REQUIRED CONFIG COMPONENTS DDCore DDDetectors)
add_library(ActsDD4hep INTERFACE)
add_library(ActsDD4hep::ActsDD4hep ALIAS ActsDD4hep)
target_link_libraries(ActsDD4hep INTERFACE DD4hep::DDCore)
target_include_directories(
ActsDD4hep
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
set_target_properties(ActsDD4hep PROPERTIES PUBLIC_HEADER "${public_headers}")
set_target_properties(ActsDD4hep PROPERTIES EXPORT_NAME ActsDD4hep::ActsDD4hep)
install(
TARGETS ActsDD4hep
EXPORT ActsDD4hepTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ActsDD4hep)
install(
EXPORT ActsDD4hepTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ActsDD4hep)
include(CMakePackageConfigHelpers)
set(install_package_config_dir "${CMAKE_INSTALL_LIBDIR}/cmake/ActsDD4hep")
write_basic_package_version_file(
${PROJECT_BINARY_DIR}/ActsDD4hepConfigVersion.cmake
COMPATIBILITY SameMajorVersion)
configure_package_config_file(
${CMAKE_CURRENT_LIST_DIR}/ActsDD4hepConfig.cmake.in
${PROJECT_BINARY_DIR}/ActsDD4hepConfig.cmake
INSTALL_DESTINATION ${install_package_config_dir}
PATH_VARS CMAKE_INSTALL_BINDIR CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR)
install(
FILES
${PROJECT_BINARY_DIR}/ActsDD4hepConfig.cmake
${PROJECT_BINARY_DIR}/ActsDD4hepConfigVersion.cmake
DESTINATION ${install_package_config_dir})