Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.0.0, 5.0.1, 5.0.2
-
None
-
Unix / Windows
Description
CMake introduced new library type from version 2.8.8. Object libraries can be used for convenience in some case. Please see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library and http://www.cmake.org/pipermail/cmake-developers/2012-March/003693.html for more information.
The Qt5 macro 'tym_qt5_use_modules()' makes it easier to establish dependency between an executable/library and Qt libraries it depends on. Unfortunately, 'tym_qt5_use_modules()' can't be used on an object library.
The problem is located in the file https://qt.gitorious.org/qt/qtbase/blobs/stable/src/corelib/Qt5CoreMacros.cmake#line243 (line 243). 'target_link_libraries()' can't be used with a CMake object library.
A simple workaround is to test type of target before using 'target_link_libraries()'. If you replace line 243 by:
get_target_property(_trgt_type ${_target} TYPE)
if(NOT ${_trgt_type} STREQUAL "OBJECT_LIBRARY")
target_link_libraries(${_target} ${_qt5_link_type} ${Qt5${_module}_LIBRARIES})
endif()
everything works fine and we can use 'qt5_use_modules()' on object libraries.
Cheers