Consider the following example of a FindXXX.cmake
:
find_path(XXX_INCLUDE_DIR NAMES XXX/XXX.h)
find_path(XXXYYY_INCLUDE_DIR NAMES YYY.h)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(XXX DEFAULT_MSG
XXX_INCLUDE_DIR XXXYYY_INCLUDE_DIR)
set(XXX_INCLUDE_DIRS "${XXX_INCLUDE_DIR} ${XXXYYY_INCLUDE_DIR}")
As it is in this example, XXX_INCLUDE_DIRS
is a string with a space in the middle, and, thus, when added in CMakeLists.txt
using
target_include_directories(a PRIVATE ${XXX_INCLUDE_DIRS})
it is invoked by the compiler as
-I"XXXpath XXXYYYpath"
How should I modify the line
set(XXX_INCLUDE_DIRS ${XXX_INCLUDE_DIR} ${XXXYYY_INCLUDE_DIR})
which sets the value for the variable XXX_INCLUDE_DIRS
?
The same question arises for multiple library paths in XXX_LIBRARIES
.