From 6765d533a2af6dbb6e0c2b1ae0b9cdb5e6f29611 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 7 Jan 2025 07:29:19 +0100 Subject: [PATCH] Install the header files --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a86d5bd..11354d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.3 FATAL_ERROR) +cmake_minimum_required(VERSION 3.23 FATAL_ERROR) #--------------------------- set( PackageName DDKalTest ) @@ -81,6 +81,8 @@ include_directories( BEFORE ${CMAKE_SOURCE_DIR}/include ) file(GLOB sources ./src/*cc ) add_library(${PackageName} SHARED ${sources}) +file(GLOB_RECURSE top_headers ${PROJECT_SOURCE_DIR}/include/*.h) +target_sources(${PackageName} PUBLIC FILE_SET headers TYPE HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/include FILES ${top_headers}) target_link_libraries(${PackageName} ${DD4hep_LIBRARIES} ${DD4hep_COMPONENT_LIBRARIES} ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES} @@ -124,6 +126,7 @@ INSTALL(FILES ${hfiles} install(TARGETS ${PackageName} printSurfaces RUNTIME DESTINATION bin LIBRARY DESTINATION lib + FILE_SET headers DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) # to do: add corresponding uninstall... #-------------------------------------------------------