Skip to content
Closed
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
11 changes: 9 additions & 2 deletions cmake/IgnUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ endfunction()
# [EXCLUDE_FILES <excluded_headers>]
# [EXCLUDE_DIRS <dirs>]
# [GENERATED_HEADERS <headers>]
# [INSTALL_BUT_DONT_INCLUDE <headers>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this parameter name is confusing to me

an alternative approach is to use EXCLUDE_FILES and then manually install the desired headers, as we don in sdformat:

it could benefit from an easier install helper so it doesn't need to pass ${IGN_INCLUDE_INSTALL_DIR_FULL}/${PROJECT_INCLUDE_DIR} as the destination

ign_install_includes will provide the first half of that path, but you'd still have to pass ${PROJECT_INCLUDE_DIR}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh much better, thanks!

# [COMPONENT] <component>)
#
# From the current directory, install all header files, including files from all
Expand All @@ -623,13 +624,17 @@ endfunction()
# If the COMPONENT option is specified, this will skip over configuring a
# config.hh file since it would be redundant with the core library.
#
# INSTALL_BUT_DONT_INCLUDE should be headers that are meant to be installed, but
# not included in ${IGN_DESIGNATION}.hh. This is useful for deprecated headers,
# for example.
#
function(ign_install_all_headers)

#------------------------------------
# Define the expected arguments
set(options)
set(oneValueArgs COMPONENT) # We are not using oneValueArgs yet
set(multiValueArgs EXCLUDE_FILES EXCLUDE_DIRS GENERATED_HEADERS)
set(multiValueArgs EXCLUDE_FILES EXCLUDE_DIRS GENERATED_HEADERS INSTALL_BUT_DONT_INCLUDE)

#------------------------------------
# Parse the arguments
Expand Down Expand Up @@ -695,7 +700,9 @@ function(ign_install_all_headers)

# Add each header, prefixed by its directory, to the auto headers variable
foreach(header ${headers})
set(ign_headers "${ign_headers}#include <${PROJECT_INCLUDE_DIR}/${header}>\n")
if (NOT ${header} IN_LIST ign_install_all_headers_INSTALL_BUT_DONT_INCLUDE)
set(ign_headers "${ign_headers}#include <${PROJECT_INCLUDE_DIR}/${header}>\n")
endif()
endforeach()

if("." STREQUAL ${dir})
Expand Down