Skip to content

Commit

Permalink
Allow to install a target without INCLUDE_DESTINATION (#33)
Browse files Browse the repository at this point in the history
* Allow to install a target without `INCLUDE_DESTINATION`

Concrete use case:
A library like `gtest_main` that define a `main` symbols just need to be linked to.

* All `INCLUDE_DIR` to be empty too
  • Loading branch information
OlivierLDff authored Oct 19, 2022
1 parent 1d467b7 commit 48db482
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,15 @@ function(packageProject)
set(PROJECT_INCLUDE_HEADER_PATTERN "*")
endif()

install(
DIRECTORY ${PROJECT_INCLUDE_DIR}/
DESTINATION ${PROJECT_INCLUDE_DESTINATION}
COMPONENT "${PROJECT_NAME}_Development"
FILES_MATCHING
PATTERN "${PROJECT_INCLUDE_HEADER_PATTERN}"
)
if(PROJECT_INCLUDE_DESTINATION AND PROJECT_INCLUDE_DIR)
install(
DIRECTORY ${PROJECT_INCLUDE_DIR}/
DESTINATION ${PROJECT_INCLUDE_DESTINATION}
COMPONENT "${PROJECT_NAME}_Development"
FILES_MATCHING
PATTERN "${PROJECT_INCLUDE_HEADER_PATTERN}"
)
endif()

set(${PROJECT_NAME}_VERSION
${PROJECT_VERSION}
Expand Down

0 comments on commit 48db482

Please sign in to comment.