From 85b56f65bd1f526a0206f2255ec8d8c07e3406c8 Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Tue, 27 Aug 2024 09:36:41 +0200 Subject: [PATCH] Modern way to install headers --- modules/map/CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/map/CMakeLists.txt b/modules/map/CMakeLists.txt index 83cf88afd..ee5a4c23f 100644 --- a/modules/map/CMakeLists.txt +++ b/modules/map/CMakeLists.txt @@ -39,6 +39,16 @@ add_library(mappplib STATIC src/MAP_Fortran_Types.f90 ${MAP_CLIB_SOURCES} ) +target_sources( + mappplib + PUBLIC + $ + $ + $ + $ + $ + $ +) target_link_libraries(mappplib nwtclibs) target_include_directories(mappplib PUBLIC $ @@ -47,9 +57,8 @@ target_include_directories(mappplib PUBLIC $ $ ) -set_target_properties(mappplib PROPERTIES PUBLIC_HEADER src/MAP_Types.h - src/mapsys.h - src/mapapi.h) +get_target_property(MAPPP_PUBLIC_HEADERS mappplib INTERFACE_SOURCES) +set_target_properties(mappplib PROPERTIES PUBLIC_HEADER "${MAPPP_PUBLIC_HEADERS}") install(TARGETS mappplib EXPORT "${CMAKE_PROJECT_NAME}Libraries"