Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use header file sets while installing CMake targets #242

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions libs/MeshKernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,6 @@ set(
${UTILITIES_INC_DIR}/RTree.hpp
)

set(
HEADERS
${INC_LIST}
${AVERAGING_STRATEGIES_INC_LIST}
${CURVILINEAR_GRID_INC_LIST}
${UTILITIES_INC_LIST}
)

# add sources to target
target_sources(
${TARGET_NAME}
Expand All @@ -193,14 +185,14 @@ target_sources(
BASE_DIRS
${INC_DIR}
FILES
${HEADERS}
${INC_LIST}
${AVERAGING_STRATEGIES_INC_LIST}
${CURVILINEAR_GRID_INC_LIST}
${UTILITIES_INC_LIST}
)

# set the public headers
set_target_properties(${TARGET_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}")

# Expose the interface of the static lib
target_include_directories( ${TARGET_NAME} PUBLIC ${INC_DIR})
target_include_directories(${TARGET_NAME} PUBLIC ${INC_DIR})

# Add target link dependencies

Expand Down Expand Up @@ -261,7 +253,7 @@ target_precompile_headers(
<vector>
)

install(TARGETS ${TARGET_NAME} PUBLIC_HEADER DESTINATION "include/MeshKernel")
install(TARGETS ${TARGET_NAME} FILE_SET HEADERS DESTINATION "include")

# group the sources in IDE tree
source_group("Source Files" FILES ${SRC_LIST})
Expand Down
5 changes: 1 addition & 4 deletions libs/MeshKernelApi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ target_sources(
${INC_LIST}
)

# define the public header
set_target_properties(${TARGET_NAME} PROPERTIES PUBLIC_HEADER "${INC_LIST}")

# Expose the interface of the shared lib
target_include_directories(${TARGET_NAME} PUBLIC ${INC_DIR})

Expand Down Expand Up @@ -83,7 +80,7 @@ target_precompile_headers(
<vector>
)

install(TARGETS ${TARGET_NAME} PUBLIC_HEADER DESTINATION "include/MeshKernelApi")
install(TARGETS ${TARGET_NAME} FILE_SET HEADERS DESTINATION "include")

# group the sources in IDE tree
source_group("Source Files" FILES ${SRC_LIST})
Expand Down
Loading