1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fix #263 - Install only the headers which are enabled. (#264)

* Fix #263 - Install only the headers which are enabled.

* Fix #263 - Install only the headers which are enabled. Fix clumsy typo!
This commit is contained in:
Alex Collins
2017-10-28 18:23:09 +01:00
committed by Matias Fontanini
parent d2addea9cf
commit c07cd40234
2 changed files with 11 additions and 8 deletions

View File

@@ -342,11 +342,3 @@ INSTALL(
DESTINATION CMake
COMPONENT dev
)
# Install all headers in include/
INSTALL(
DIRECTORY ${CMAKE_SOURCE_DIR}/include/
DESTINATION include
COMPONENT Headers
FILES_MATCHING PATTERN "*.h*"
)

View File

@@ -223,3 +223,14 @@ INSTALL(
ARCHIVE DESTINATION lib
COMPONENT dev
)
MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST)
FOREACH(HEADER ${HEADERS})
# Extract directory name and remove leading '../'
get_filename_component(DIR ${HEADER} PATH)
STRING(REGEX REPLACE "^\\.\\.\\/" "" DIR ${DIR})
INSTALL(FILES ${HEADER} DESTINATION ${DIR})
ENDFOREACH(HEADER)
ENDMACRO()
INSTALL_HEADERS_WITH_DIRECTORY(${HEADERS})