New learnings of CMake (>= 2.8.11) and Qt5

Pete Woods pete.woods at canonical.com
Thu Jun 18 14:51:31 UTC 2015


For quite a while now, I've been using commands like:

find_package(Qt5Core)
// ... define my_target
qt5_use_modules(my_target Core)
target_link_libraries(my_target nonQtDep)

But recently came across a post on StackOverflow that lead me to the
following docs:

http://doc.qt.io/qt-5/cmake-manual.html

which says that since CMake 2.8.11 (old hat now) we should be doing the
following:

find_package(Qt5Core)
// ... define my_target
target_link_libraries(my_target
  Qt5::Core
  nonQtDep
)

I, for one, think this will make mixed deps between Qt and non-Qt
components much more readable in our CMake code.

Cheers,
    Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20150618/db92059b/attachment.html>


More information about the ubuntu-devel mailing list