Skip to content

Commit

Permalink
Attempted fix for install of header-only libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
isherman committed Oct 6, 2023
1 parent 981716c commit 77e1fc2
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions cmake/farm_ng_add_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,21 @@ macro(farm_ng_add_library target)
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/${abs_include}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")

foreach ( file ${FARM_NG_ARGS_HEADERS} )

if(IS_ABSOLUTE ${file})
file(RELATIVE_PATH rel ${CMAKE_SOURCE_DIR}/${abs_include} ${file})
else()
file(RELATIVE_PATH rel ${CMAKE_SOURCE_DIR}/${abs_include} ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endif()
#message(STATUS "header: ${file}")
#message(STATUS "header rel: ${rel}")

get_filename_component( dir ${rel} DIRECTORY )
# message(STATUS "${FARM_NG_ARGS_INCLUDE_DIR} ${file} ${rel} ${dir}")
install( FILES ${file}
DESTINATION include/${dir}
COMPONENT Devel)
endforeach()

if(DEFINED FARM_NG_ARGS_SOURCES)
foreach ( file ${FARM_NG_ARGS_HEADERS} )

if(IS_ABSOLUTE ${file})
file(RELATIVE_PATH rel ${CMAKE_SOURCE_DIR}/${abs_include} ${file})
else()
file(RELATIVE_PATH rel ${CMAKE_SOURCE_DIR}/${abs_include} ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endif()

get_filename_component( dir ${rel} DIRECTORY )
install( FILES ${file}
DESTINATION include/${dir}
COMPONENT Devel)
endforeach()

string(REPLACE "." ";" VERSION_LIST ${PROJECT_VERSION})
list(GET VERSION_LIST 0 VERSION_MAJOR)
list(GET VERSION_LIST 1 VERSION_MINOR)
Expand Down

0 comments on commit 77e1fc2

Please sign in to comment.