[cmake-developers] Generating imported library targets without the cmake executable

Alexander Neundorf neundorf at kde.org
Tue Nov 29 15:57:45 EST 2011


On Tuesday 29 November 2011, Stephen Kelly wrote:
> Alexander Neundorf wrote:
> >> I can't generate the files. I'm asking people with windows and mac
> >> setups to generate them and post them for review. I don't have those
> >> setups.
> > 
> > Just the ones for Linux would already help :-)
> 
> I managed to get generated files for windows and mac through some IRC
> puppeteering, so I've attached them here now.
> 
> Thanks,

I looked through the QtCore files.

Some things:

if (NOT _Qt5Core_target)
    set(_Qt5Core_target 1)
    add_library(Qt5Core SHARED IMPORTED)
    if (NOT "" STREQUAL "")
        set_property(TARGET Qt5Core PROPERTY FRAMEWORK 1)
    endif()
endif()

I think you can simply do:

if(NOT TARGET Qt5Core)
  add_library(Qt5Core SHARED IMPORTED)
  if (NOT "" STREQUAL "")
      set_property(TARGET Qt5Core PROPERTY FRAMEWORK 1)
  endif()
endif()


Can this also handle already static builds of Qt ?

Why do you have an if() around including Qt5CoreMacros.cmake and 
Qt5CoreConfigExtras.cmake ?

Alex



More information about the cmake-developers mailing list