Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.
Qt-contributors-summit-2013-CMake-files-feedback-requests
Jump to navigation
Jump to search
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
- CMake files can be used elegantly for all platforms and most Qt configurations (shared/static/mac-framework/cross-compiles), especially with CMake 2.8.11
- # Recent features in CMake and Qt 5.1 implement ‘target usage requirements’ http://community.kde.org/Frameworks/Epics/CMake_target_usage_requirements
- # https://qt.gitorious.org/qt/qtbase/blobs/dev/tests/auto/cmake/test_interface/CMakeLists.txt
- Qt CI tests the CMake files in many scenarios in the build and install locations.
- Upcoming features in CMake upstream make using static Qt builds more elegant
- # A file needs to be generated whenever QtGui is used which loads the platform plugin (for qmake feature-parity). This will be automatic.
- # Support for multiple toolchains and proper sysroot handling will make using Qt in cross-compile scenarios more easy.
- CMake toolchain files for all platforms will be generated while building Qt: https://codereview.qt.io/#change,53858
- CMake functionality is growing ever-more declarative
- find_package(Qt4)
- find_package(Qt5Core)
- qt4_generate_moc(myfile.h moc_myfile.cpp TARGET qt4_foo) # Note, qt5_foo target doesn't
- # exist until below.
- qt5_generate_moc(myfile.h moc_myfile.cpp TARGET qt5_foo) # Note, qt5_foo target doesn't
- # exist until below.
- add_library(qt4_foo ...)
- add_library(qt5_foo ...)
- Use of CMake is growing more declarative. Ie from
- set(srcs foo.cpp)
- if (WIN32)
- list(APPEND srcs foo_win.cpp)
- endif()
- add_library(foolib ${srcs})
- target_link_libraries(foolib bar)
- if (UNIX)
- target_link_libraries(foolib unixlib)
- endif()
to
- add_library(foolib
- foo.cpp
- $<$<PLATFORM_ID:WIN32>:foo_win.cpp>
- )
- target_link_libraries(foolib
- bar
- $<$<PLATFORM_ID:UNIX>:unixlib>
- )
in version 2.8.13.
- CMake might replace its current language with a more-declarative one (Lua).
Tasks:
- Improve Creator CMake support
- Complete the cross compiling features upstream
- Implement CPack generator for BB10 bar files.
- Implement UI in creator to create packages in all formats known to CPack