[CMake] Qt5 + cmake 3.0

Scott Aron Bloom scott.bloom at onshorecs.com
Fri Oct 24 17:29:59 EDT 2014


So I may be taking on too much.. but I am migrating to Qt5 and Cmake 3.0 on my project (from Qt4.8 and CMake 2.8)

I have minimized the project to a simple testcase that will represent the problem, and it still exists.

My project, has multiple executables and multiple libraries for each exec.  For the test, it's a simple single exec with 1 library.

Since in real life, I have multiple libraries, each library includes the ${CMAKE_SOURCE_DIR}/project.cmake file, to setup the settings the projects share in common.

In this file, I previously called include( ${QT_USE_FILE} ) to make sure the necessary include paths were setup correctly
However, for Qt5, this has been replaced with modifying the target_link_libraries to include Qt5::Widgets (or the other necessary components)

And the qt5_use_modules( MyLibrary Core )

The problem, is then I would need to call this, inside every libraries CMake file, since its required to know the "current project"

Is there anyway around this issue? Where I could just add the necessary Qt 5 modules to current project?

Scott

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20141024/bd21c8a7/attachment-0001.html>


More information about the CMake mailing list