[CMake] Problem with IMPORTED_LINK_INTERFACE_LIBRARIES_<config>
Michele Santullo
michele.santullo at larian.com
Fri Jun 22 06:17:48 EDT 2012
Hello, I need to add some linker dependencies to a static lib I'm
importing into our project. I need to do that on a per-target basis, but
the following is not working:
add_library(GameNet STATIC IMPORTED) # our code built in another project
and imported by the current one
add_library(Library STATIC IMPORTED) # 3rd party library, source code
unavailable
add_library(LibraryD STATIC IMPORTED) # Debug version of the same
library as above
set (ALL_LIBS
optimized Library
debug LibraryD
)
set_target_properties(GameNet PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES "${ALL_LIBS}")
Running cmake gives a message about optimized/debug keyword being
forbidden in this case. The same message suggests you use
IMPORTED_LINK_INTERFACE_LIBRARIES_<config> in this case. However, I
tried the following:
set_target_properties(GameNet PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG LibraryD)
set_target_properties(GameNet PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE Library)
and it just has no effect. There is no trace of Library[D] in the
generated files.
I'm using cmake 2.8.8 on windows for VS 9 2008.
Thanks,
Michele
More information about the CMake
mailing list