Qt-contributors-summit-2013-CMake-files-feedback-requests: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
m (Categorize)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
[[Category:QtCS2013]]
# 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
# 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
# # Recent features in CMake and Qt 5.1 implement ‘target usage requirements’ http://community.kde.org/Frameworks/Epics/CMake_target_usage_requirements
Line 47: 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>



Latest revision as of 17:17, 6 January 2017

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