File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,19 @@ check_endianness()
97
97
###############################################################################
98
98
# Installation paths
99
99
###############################################################################
100
+ option (APPEND_PROJECT_NAME_TO_INCLUDEDIR
101
+ "When ON headers are installed to a path ending with a folder called \
102
+ ${PROJECT_NAME} . This avoids include directory search order issues when \
103
+ overriding this package from a merged catkin, ament, or colcon workspace."
104
+ OFF )
105
+
100
106
set (BIN_INSTALL_DIR bin/ CACHE PATH "Installation directory for binaries" )
101
- set (INCLUDE_INSTALL_DIR include / CACHE PATH "Installation directory for C++ headers" )
107
+ set (_include_dir "include/" )
108
+ if (APPEND_PROJECT_NAME_TO_INCLUDEDIR)
109
+ string (APPEND _include_dir "${PROJECT_NAME} /" )
110
+ endif ()
111
+ set (INCLUDE_INSTALL_DIR "${_include_dir} " CACHE PATH "Installation directory for C++ headers" )
112
+ unset (_include_dir)
102
113
set (LIB_INSTALL_DIR lib/ CACHE PATH "Installation directory for libraries" )
103
114
set (DATA_INSTALL_DIR share/ CACHE PATH "Installation directory for data" )
104
115
if (WIN32 )
Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
416
416
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR} /include >
417
417
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR} /include /${PROJECT_NAME} >
418
418
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /src/cpp>
419
- $<INSTALL_INTERFACE:include >
419
+ $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR} >
420
420
PRIVATE
421
421
${Asio_INCLUDE_DIR}
422
422
$<$<BOOL :${TINYXML2_INCLUDE_DIR} >:${TINYXML2_INCLUDE_DIR} >
You can’t perform that action at this time.
0 commit comments