Skip to content

Commit

Permalink
Fix mfontanini#263 - Install only the headers which are enabled. (mfo…
Browse files Browse the repository at this point in the history
…ntanini#264)

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

* Fix mfontanini#263 - Install only the headers which are enabled. Fix clumsy typo!
  • Loading branch information
ajcollins authored and mfontanini committed Oct 28, 2017
1 parent d2addea commit c07cd40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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*"
)
11 changes: 11 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit c07cd40

Please sign in to comment.