[CMake] Problem with IMPORTED_LINK_INTERFACE_LIBRARIES_<config>

Petr Kmoch petr.kmoch at gmail.com
Fri Jun 22 07:10:49 EDT 2012


Hi Michele,

I don't know how it is in this particular case, but some
configuration-specific variable, property etc. names are
case-sensitive. I believe the default configuraions are called "Debug"
and "Release". You could try setting
IMPORTED_LINK_INTERFACE_LIBRARIES_Debug.

Petr

On Fri, Jun 22, 2012 at 12:17 PM, Michele Santullo
<michele.santullo at larian.com> wrote:
> 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
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list