Can target_include_directories capture $<CONFIG> as part of a path?
Hi,
I am trying to register a directory using target_include_directories
that has $<CONFIG>
as one part of the path. For example:
target_include_directories( Lib_rng PUBLIC
${SOMETPL_INCLUDE_DIR}
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<INSTALL_INTERFACE:$<CONFIG>/include> )
However, when I export the target to generate mypackage-config.cmake
and mypackage-targets.cmake
, the $<CONFIG>
is escaped in a way that breaks importing this target.
# mypackage-targets.cmake
...
set_target_properties(Lib_rng PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "C:/work/vendors64/sometpl-1.0.0/include;\$<CONFIG>/include>"
)
What I would like exported is expressed by this diff:
- INTERFACE_INCLUDE_DIRECTORIES "C:/work/vendors64/sometpl-1.0.0/include;\$<CONFIG>/include>"
+ INTERFACE_INCLUDE_DIRECTORIES "C:/work/vendors64/sometpl-1.0.0/include;${_IMPORT_PREFIX}/$<CONFIG>/include>"
Is this even possible? If it is helpful, my CMAKE_INSTALL_PREFIX
looks like this:
.../cmake/
mypackage-config.cmake
mypackage-targets.cmake
...
.../Debug/
include/
lib/
bin/
.../Release
include/
lib/
bin/
...
For now, I am creating my own set_target_properties
written to mypackage-config.cmake
that replaces the one that CMake is generating, but it seems that I should be able to correctly embed $<CONFIG>
into the published INTERFACE_INCLUDE_DIRECTORIES
.