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: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Add "cleanup" tag)
(Decode HTML entity names)
Line 49: Line 49:
# <div class="de1">add_library<span class="br0">(</span>foolib </div>
# <div class="de1">add_library<span class="br0">(</span>foolib </div>
# <div class="de1">  foo.<span class="me1">cpp</span></div>
# <div class="de1">  foo.<span class="me1">cpp</span></div>
# <div class="de1">  $<span class="sy0">&lt;</span>$<span class="sy0">&lt;</span>PLATFORM_ID<span class="sy0">:</span>WIN32<span class="sy0">&gt;:</span>foo_win.<span class="me1">cpp</span><span class="sy0">&gt;</span></div>
# <div class="de1">  $<span class="sy0"><</span>$<span class="sy0"><</span>PLATFORM_ID<span class="sy0">:</span>WIN32<span class="sy0">>:</span>foo_win.<span class="me1">cpp</span><span class="sy0">></span></div>
# <div class="de1"><span class="br0">)</span></div>
# <div class="de1"><span class="br0">)</span></div>
# <div class="de2">target_link_libraries<span class="br0">(</span>foolib </div>
# <div class="de2">target_link_libraries<span class="br0">(</span>foolib </div>
# <div class="de1">  bar</div>
# <div class="de1">  bar</div>
# <div class="de1">  $<span class="sy0">&lt;</span>$<span class="sy0">&lt;</span>PLATFORM_ID<span class="sy0">:</span>UNIX<span class="sy0">&gt;:</span>unixlib<span class="sy0">&gt;</span></div>
# <div class="de1">  $<span class="sy0"><</span>$<span class="sy0"><</span>PLATFORM_ID<span class="sy0">:</span>UNIX<span class="sy0">>:</span>unixlib<span class="sy0">></span></div>
# <div class="de1"><span class="br0">)</span></div>
# <div class="de1"><span class="br0">)</span></div>



Revision as of 17:40, 12 March 2015

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.
  1. 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
  2. # Recent features in CMake and Qt 5.1 implement ‘target usage requirements’ http://community.kde.org/Frameworks/Epics/CMake_target_usage_requirements
  3. # https://qt.gitorious.org/qt/qtbase/blobs/dev/tests/auto/cmake/test_interface/CMakeLists.txt
  4. Qt CI tests the CMake files in many scenarios in the build and install locations.
  5. Upcoming features in CMake upstream make using static Qt builds more elegant
  6. # A file needs to be generated whenever QtGui is used which loads the platform plugin (for qmake feature-parity). This will be automatic.
  7. # Support for multiple toolchains and proper sysroot handling will make using Qt in cross-compile scenarios more easy.
  8. CMake toolchain files for all platforms will be generated while building Qt: https://codereview.qt.io/#change,53858
  9. CMake functionality is growing ever-more declarative
  1.      find_package(Qt4)
  2.      find_package(Qt5Core)
  3.    
  4.      qt4_generate_moc(myfile.h moc_myfile.cpp TARGET qt4_foo) # Note, qt5_foo target doesn't
  5.                                                           # exist until below.
  6.    
  7.      qt5_generate_moc(myfile.h moc_myfile.cpp TARGET qt5_foo) # Note, qt5_foo target doesn't
  8.                                                           # exist until below.
  9.    
  10.      add_library(qt4_foo ...)
  11.      add_library(qt5_foo ...)
  1. Use of CMake is growing more declarative. Ie from
  1. set(srcs foo.cpp)
  2. if (WIN32)
  3.   list(APPEND srcs foo_win.cpp)
  4. endif()
  5. add_library(foolib ${srcs})
  6. target_link_libraries(foolib bar)
  7. if (UNIX)
  8.   target_link_libraries(foolib unixlib)  
  9. endif()

to

  1. add_library(foolib
  2.   foo.cpp
  3.   $<$<PLATFORM_ID:WIN32>:foo_win.cpp>
  4. )
  5. target_link_libraries(foolib
  6.   bar
  7.   $<$<PLATFORM_ID:UNIX>:unixlib>
  8. )

in version 2.8.13.

  1. CMake might replace its current language with a more-declarative one (Lua).

Tasks:

  1. Improve Creator CMake support
  2. Complete the cross compiling features upstream
  3. Implement CPack generator for BB10 bar files.
  4. Implement UI in creator to create packages in all formats known to CPack