Reputation: 1336
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?
Upvotes: 6
Views: 4746
Reputation: 42982
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
Upvotes: 9