[CMake] Problem with IMPORTED_LINK_INTERFACE_LIBRARIES_<config>

Michele Santullo michele.santullo at larian.com
Fri Jun 22 08:18:50 EDT 2012


Thanks for the suggestion. We just tried that but unfortunately it 
doesn't change anything. Using IMPORTED_LINK_INTERFACE_LIBRARIES adds 
the library to every target build, but either 
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG and 
IMPORTED_LINK_INTERFACE_LIBRARIES_Debug seem to be just ignored. There 
are not even cmake messages at generation time.

Of course we have a target named "Debug":
SET(CMAKE_CONFIGURATION_TYPES Debug Release Shipping CACHE TYPE INTERNAL 
FORCE)

Michele


On 06/22/2012 01:10 PM, Petr Kmoch wrote:
> 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