Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.2.1
-
None
Description
I'm using cmake 2.8.12 and qt 5.2.1 here and I have some artifacts that should be build as an OBJECT LIBRARY.
But cmake and the new IMPORTED TARGETs way does not allow me to do it. I tried with qt5_use_modules, too. But there is the same problem. See issue QTBUG-31456
Example:
FILE(GLOB_RECURSE FILES "*.cpp")
ADD_LIBRARY(Example OBJECT ${FILES})
TARGET_LINK_LIBRARIES(Example Qt5::Core)
Of course I don't need to link libraries to that OBJECT LIBRARY. But I need INCLUDES, DEFINITIONS and so on for the compilation because the artifacts uses qt.
But cmake will end up with the following error:
Object library target "Example" may not link to anything.
Expected:
There should be a way to add all needed compile stuff to OBJECT LIBRARIES like the new IMPORTED TARGET feature.
Maybe a check for that OBJECT TARGET like in QTBUG-31456?