Brad King wrote:

> On 02/21/2013 06:42 AM, Stephen Kelly wrote:
>> I'm still trying to figure out the appropriate fix for
>> 
>>  https://bugreports.qt-project.org/browse/QTBUG-29186
>> 
>> In a previous thread, it was reported that something similar was done
>> with Qt 4, but it's not clear to me how - FindQt4 and related files don't
>> seem to do it.
>> 
>>  
http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/45184/focus=45220
> 
> CMake supports an arbitrary list of configurations so it cannot know
> how to map imported configurations to the current project's configs
> automatically.  This is the purpose of MAP_IMPORTED_CONFIG_<CONFIG>:

Yes. That's why I'm reluctant to implement the request in the bug report. 
It's not really 'the right way', but MAP_IMPORTED_CONFIG_<CONFIG> is. On the 
other hand, the suggestion in the bug report is more convenient, even though 
it is a lie, in that there really is no debug info available if using the 
relwithdebinfo configuration build of Qt 5.

>  
http://www.cmake.org/cmake/help/v2.8.10/cmake.html#prop_tgt:MAP_IMPORTED_CONFIG_CONFIG
> 
> but of course Qt5 doesn't know the consumer's configurations so it
> would have to be up to the consumer to set the property.

Yes.

> 
> As documented in the above property, when the property is not set no
> matching configs are available CMake just uses the first available
> configuration.  You could solve this issue in the default case by
> switching the order to
> 
>  _populate_imported_target_properties(RELEASE "Qt5Core.dll" "Qt5Core.lib"
>  ) _populate_imported_target_properties(DEBUG "Qt5Cored.dll"
>  "Qt5Cored.lib" )
> 
> so that RELEASE is chosen for every consumer configuration except
> DEBUG.

I think that's a clever workaround for the problem, thanks!

Steve.


--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to