Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-37105

Cannot use ADD_LIBRARY with OBJECT of CMAKE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.2.1
    • Build System
    • 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?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            steveire Stephen Kelly (Personal)
            misery André Klitzing
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes