I'm creating an imported target which wishes to expose two interface include directories:
list(APPEND LIB_INCLUDE_DIRS "dir1")
list(APPEND LIB_INCLUDE_DIRS "dir2")
add_library(lib SHARED IMPORTED GLOBAL)
set_target_properties(
lib
PROPERTIES
IMPORTED_LOCATION "something"
INTERFACE_INCLUDE_DIRECTORIES ${LIB_INCLUDE_DIRS}
)
Unfortunately, there's an error: set_target_properties called with incorrect number of arguments.
If I try to set only the first directory, it works. Is there a way to set both? Or is the plural form of INTERFACE_INCLUDE_DIRECTORIES simply ironic?
Just put the directory list in quotes
set_target_properties(
lib
PROPERTIES
IMPORTED_LOCATION "something"
INTERFACE_INCLUDE_DIRECTORIES "${LIB_INCLUDE_DIRS}"
)
Otherwise the list is expanded again into parameters.
References
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