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.
You provide multiple entries for variables like XXX_LIBRARIES and XXX_INCLUDE_DIRS as a semicolon-separated list.
set(XXX_INCLUDE_DIRS "${XXX_INCLUDE_DIR};${XXXYYY_INCLUDE_DIR}")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With