Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.2.0 Beta1
-
None
-
windows 7 64-bit
Description
I compile a series of Qts so that each one is in a separate directory:
qt5-x64-shared-debug
qt5-x64-shared-release
qt5-x64-static-debug
qt5-x64-static-release
qt5-x86-shared-debug
qt5-x86-shared-release
qt5-x86-static-debug
qt5-x86-static-release
this way I can point from my cmake build system to the respective flavor of qt5 i want. Note that each version may or may not include some features. For instance I don't compile Designer for debug builds. This also means that my directories may not have all modules or populated with the same headers etc. That is the reason I have 1 directory per configuration, plus it is much cleaner than putting it altogether in my opinion, despite consuming a bit more space.
The problem is that support of cmake in Qt5 assumes either release or debug or both installed in the same place. The way Qt5::XXX targets are setup do not offer the possibility to have multiple qts used in the same project as it would be in my case. I currently don't use Qt's own cmake scripts because I cannot do something like this:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) project(use-multiple-qt-builds) SET(__QT5_ROOT "D:/dev/qt5-5.2.0-vs2012/qt5-x64-shared-debug") FIND_PACKAGE( Qt5Core REQUIRED PATHS "${__QT5_ROOT}" NO_DEFAULT_PATH ) get_target_property(QtCore_location Qt5::Core LOCATION) MESSAGE("Debug Qt5: ${QtCore_location}") SET(__QT5_ROOT "D:/dev/qt5-5.2.0-vs2012/qt5-x64-shared-release") FIND_PACKAGE( Qt5Core REQUIRED PATHS "${__QT5_ROOT}" NO_DEFAULT_PATH ) get_target_property(QtCore_location Qt5::Core LOCATION) MESSAGE("Release Qt5: ${QtCore_location}")
I am proposing that Qt5 targets are setup with another namespace level referring to their configuration, for instance:
Qt5::Core::release and Qt5::Core::debug
or they are seperated with the "d" suffix from their release counter parts:
Qt5::Core and Qt5::Cored
–