1
0

3.0.0.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. CMake 3.0.0 Release Notes
  2. *************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 2.8.12.2 include the following.
  6. Documentation Changes
  7. =====================
  8. * The CMake documentation has been converted to reStructuredText and
  9. now transforms via Sphinx (`<http://sphinx-doc.org>`__) into man and
  10. html pages. This allows the documentation to be properly indexed
  11. and to contain cross-references.
  12. Conversion from the old internal documentation format was done by
  13. an automatic process so some documents may still contain artifacts.
  14. They will be updated incrementally over time.
  15. A basic reStructuredText processor has been implemented to support
  16. ``cmake --help-command`` and similar command-line options.
  17. * New manuals were added:
  18. - :manual:`cmake-buildsystem(7)`
  19. - :manual:`cmake-commands(7)`, replacing ``cmakecommands(1)``
  20. and ``cmakecompat(1)``
  21. - :manual:`cmake-developer(7)`
  22. - :manual:`cmake-generator-expressions(7)`
  23. - :manual:`cmake-generators(7)`
  24. - :manual:`cmake-language(7)`
  25. - :manual:`cmake-modules(7)`, replacing ``cmakemodules(1)``
  26. - :manual:`cmake-packages(7)`
  27. - :manual:`cmake-policies(7)`, replacing ``cmakepolicies(1)``
  28. - :manual:`cmake-properties(7)`, replacing ``cmakeprops(1)``
  29. - :manual:`cmake-qt(7)`
  30. - :manual:`cmake-toolchains(7)`
  31. - :manual:`cmake-variables(7)`, replacing ``cmakevars(1)``
  32. * Release notes for CMake 3.0.0 and above will now be included with
  33. the html documentation.
  34. New Features
  35. ============
  36. Syntax
  37. ------
  38. * The CMake language has been extended with
  39. :ref:`Bracket Argument` and :ref:`Bracket Comment`
  40. syntax inspired by Lua long brackets::
  41. set(x [===[bracket argument]===] #[[bracket comment]])
  42. Content between equal-length open- and close-brackets is taken
  43. literally with no variable replacements.
  44. .. warning::
  45. This syntax change could not be made in a fully compatible
  46. way. No policy is possible because syntax parsing occurs before
  47. any chance to set a policy. Existing code using an unquoted
  48. argument that starts with an open bracket will be interpreted
  49. differently without any diagnostic. Fortunately the syntax is
  50. obscure enough that this problem is unlikely in practice.
  51. Generators
  52. ----------
  53. * A new :generator:`CodeLite` extra generator is available
  54. for use with the Makefile or Ninja generators.
  55. * A new :generator:`Kate` extra generator is available
  56. for use with the Makefile or Ninja generators.
  57. * The :generator:`Ninja` generator learned to use ``ninja`` job pools
  58. when specified by a new :prop_gbl:`JOB_POOLS` global property.
  59. Commands
  60. --------
  61. * The :command:`add_library` command learned a new ``INTERFACE``
  62. library type. Interface libraries have no build rules but may
  63. have properties defining
  64. :manual:`usage requirements <cmake-buildsystem(7)>`
  65. and may be installed, exported, and imported. This is useful to
  66. create header-only libraries that have concrete link dependencies
  67. on other libraries.
  68. * The :command:`export()` command learned a new ``EXPORT`` mode that
  69. retrieves the list of targets to export from an export set configured
  70. by the :command:`install(TARGETS)` command ``EXPORT`` option. This
  71. makes it easy to export from the build tree the same targets that
  72. are exported from the install tree.
  73. * The :command:`export` command learned to work with multiple dependent
  74. export sets, thus allowing multiple packages to be built and exported
  75. from a single tree. The feature requires CMake to wait until the
  76. generation step to write the output file. This means one should not
  77. :command:`include` the generated targets file later during project
  78. configuration because it will not be available.
  79. Use :ref:`Alias Targets` instead. See policy :policy:`CMP0024`.
  80. * The :command:`project` command learned to set some version variables
  81. to values specified by the new ``VERSION`` option or to empty strings.
  82. See policy :policy:`CMP0048`.
  83. * The :command:`string` command learned a new ``CONCAT`` mode.
  84. It is particularly useful in combination with the new
  85. :ref:`Bracket Argument` syntax.
  86. * The :command:`unset` command learned a ``PARENT_SCOPE`` option
  87. matching that of the :command:`set` command.
  88. * The :command:`include_external_msproject` command learned
  89. to handle non-C++ projects like ``.vbproj`` or ``.csproj``.
  90. * The :command:`ctest_update` command learned to update work trees
  91. managed by the Perforce (p4) version control tool.
  92. * The :command:`message` command learned a ``DEPRECATION`` mode. Such
  93. messages are not issued by default, but may be issued as a warning if
  94. :variable:`CMAKE_WARN_DEPRECATED` is enabled, or as an error if
  95. :variable:`CMAKE_ERROR_DEPRECATED` is enabled.
  96. * The :command:`target_link_libraries` command now allows repeated use of
  97. the ``LINK_PUBLIC`` and ``LINK_PRIVATE`` keywords.
  98. Variables
  99. ---------
  100. * Variable :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` has been
  101. introduced to tell CMake not to add the value of
  102. :variable:`CMAKE_INSTALL_PREFIX` to the
  103. :variable:`CMAKE_SYSTEM_PREFIX_PATH` variable by default.
  104. This is useful when building a project that installs some
  105. of its own dependencies to avoid finding files it is about
  106. to replace.
  107. * Variable :variable:`CMAKE_STAGING_PREFIX` was introduced for use
  108. when cross-compiling to specify an installation prefix on the
  109. host system that differs from a :variable:`CMAKE_INSTALL_PREFIX`
  110. value meant for the target system.
  111. * Variable :variable:`CMAKE_SYSROOT` was introduced to specify the
  112. toolchain SDK installation prefix, typically for cross-compiling.
  113. This is used to pass a ``--sysroot`` option to the compiler and
  114. as a prefix searched by ``find_*`` commands.
  115. * Variable :variable:`CMAKE_<LANG>_COMPILER_TARGET` was introduced
  116. for use when cross-compiling to specify the target platform in the
  117. :ref:`toolchain file <Cross Compiling Toolchain>` specified by the
  118. :variable:`CMAKE_TOOLCHAIN_FILE` variable.
  119. This is used to pass an option such as ``--target=<triple>`` to some
  120. cross-compiling compiler drivers.
  121. * Variable :variable:`CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>` has been
  122. introduced to optionally initialize the
  123. :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` target property.
  124. Properties
  125. ----------
  126. * The :prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES` directory property
  127. learned to support
  128. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  129. * A new directory property :prop_dir:`CMAKE_CONFIGURE_DEPENDS`
  130. was introduced to allow projects to specify additional
  131. files on which the configuration process depends. CMake will
  132. re-run at build time when one of these files is modified.
  133. Previously this was only possible to achieve by specifying
  134. such files as the input to a :command:`configure_file` command.
  135. * A new :ref:`Qt AUTORCC` feature replaces the need to
  136. invoke ``qt4_add_resources()`` by allowing ``.qrc`` files to
  137. be listed as target sources.
  138. * A new :ref:`Qt AUTOUIC` feature replaces the need to
  139. invoke ``qt4_wrap_ui()``.
  140. * Test properties learned to support
  141. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  142. This is useful to specify per-configuration values for test
  143. properties like :prop_test:`REQUIRED_FILES` and
  144. :prop_test:`WORKING_DIRECTORY`.
  145. * A new :prop_test:`SKIP_RETURN_CODE` test property was introduced
  146. to tell :manual:`ctest(1)` to treat a particular test return code as
  147. if the test were not run. This is useful for test drivers to report
  148. that certain test requirements were not available.
  149. * New types of :ref:`Compatible Interface Properties` were introduced,
  150. namely the :prop_tgt:`COMPATIBLE_INTERFACE_NUMBER_MAX` and
  151. :prop_tgt:`COMPATIBLE_INTERFACE_NUMBER_MIN` for calculating numeric
  152. maximum and minimum values respectively.
  153. Modules
  154. -------
  155. * The :module:`CheckTypeSize` module ``check_type_size`` macro and
  156. the :module:`CheckStructHasMember` module ``check_struct_has_member``
  157. macro learned a new ``LANGUAGE`` option to optionally check C++ types.
  158. * The :module:`ExternalData` module learned to work with no
  159. URL templates if a local store is available.
  160. * The :module:`ExternalProject` function ``ExternalProject_Add``
  161. learned a new ``GIT_SUBMODULES`` option to specify a subset
  162. of available submodules to checkout.
  163. * A new :module:`FindBacktrace` module has been added to support
  164. :command:`find_package(Backtrace)` calls.
  165. * A new :module:`FindLua` module has been added to support
  166. :command:`find_package(Lua)` calls.
  167. * The :module:`FindBoost` module learned a new ``Boost_NAMESPACE``
  168. option to change the ``boost`` prefix on library names.
  169. * The :module:`FindBoost` module learned to control search
  170. for libraies with the ``g`` tag (for MS debug runtime) with
  171. a new ``Boost_USE_DEBUG_RUNTIME`` option. It is ``ON`` by
  172. default to preserve existing behavior.
  173. * The :module:`FindJava` and :module:`FindJNI` modules learned
  174. to use a ``JAVA_HOME`` CMake variable or environment variable,
  175. and then try ``/usr/libexec/java_home`` on OS X.
  176. * The :module:`UseJava` module ``add_jar`` function learned a new
  177. ``MANIFEST`` option to pass the ``-m`` option to ``jar``.
  178. * A new :module:`CMakeFindDependencyMacro` module was introduced with
  179. a ``find_dependency`` macro to find transitive dependencies in
  180. a :manual:`package configuration file <cmake-packages(7)>`. Such
  181. dependencies are omitted by the listing of the :module:`FeatureSummary`
  182. module.
  183. * The :module:`FindQt4` module learned to create :ref:`Imported Targets`
  184. for Qt executables. This helps disambiguate when using multiple
  185. :manual:`Qt versions <cmake-qt(7)>` in the same buildsystem.
  186. Generator Expressions
  187. ---------------------
  188. * New ``$<PLATFORM_ID>`` and ``$<PLATFORM_ID:...>``
  189. :manual:`generator expressions <cmake-generator-expressions(7)>`
  190. have been added.
  191. * The ``$<CONFIG>``
  192. :manual:`generator expression <cmake-generator-expressions(7)>` now has
  193. a variant which takes no argument. This is equivalent to the
  194. ``$<CONFIGURATION>`` expression.
  195. * New ``$<UPPER_CASE:...>`` and ``$<LOWER_CASE:...>``
  196. :manual:`generator expressions <cmake-generator-expressions(7)>`
  197. generator expressions have been added.
  198. * A new ``$<MAKE_C_IDENTIFIER:...>``
  199. :manual:`generator expression <cmake-generator-expressions(7)>` has
  200. been added.
  201. Other
  202. -----
  203. * The :manual:`cmake(1)` ``-E`` option learned a new ``sleep`` command.
  204. * The :manual:`ccmake(1)` dialog learned to honor the
  205. :prop_cache:`STRINGS` cache entry property to cycle through
  206. the enumerated list of possible values.
  207. * The :manual:`cmake-gui(1)` dialog learned to remember window
  208. settings between sessions.
  209. * The :manual:`cmake-gui(1)` dialog learned to remember the type
  210. of a cache entry for completion in the ``Add Entry`` dialog.
  211. New Diagnostics
  212. ===============
  213. * Directories named in the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
  214. target property of imported targets linked conditionally by a
  215. :manual:`generator expression <cmake-generator-expressions(7)>`
  216. were not checked for existence. Now they are checked.
  217. See policy :policy:`CMP0027`.
  218. * Build target names must now match a validity pattern and may no longer
  219. conflict with CMake-defined targets. See policy :policy:`CMP0037`.
  220. * Build targets that specify themselves as a link dependency were
  221. silently accepted but are now diagnosed. See :policy:`CMP0038`.
  222. * The :command:`target_link_libraries` command used to silently ignore
  223. calls specifying as their first argument build targets created by
  224. :command:`add_custom_target` but now diagnoses this mistake.
  225. See policy :policy:`CMP0039`.
  226. * The :command:`add_custom_command` command used to silently ignore
  227. calls specifying the ``TARGET`` option with a non-existent target
  228. but now diagnoses this mistake. See policy :policy:`CMP0040`.
  229. * Relative paths in the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
  230. target property used to be silently accepted if they contained a
  231. :manual:`generator expression <cmake-generator-expressions(7)>`
  232. but are now rejected. See policy :policy:`CMP0041`.
  233. * The :command:`get_target_property` command learned to reject calls
  234. specifying a non-existent target. See policy :policy:`CMP0045`.
  235. * The :command:`add_dependencies` command learned to reject calls
  236. specifying a dependency on a non-existent target.
  237. See policy :policy:`CMP0046`.
  238. * Link dependency analysis learned to assume names containing ``::``
  239. refer to :ref:`Alias Targets` or :ref:`Imported Targets`. It will
  240. now produce an error if such a linked target is missing. Previously
  241. in this case CMake generated a link line that failed at build time.
  242. See policy :policy:`CMP0028`.
  243. * When the :command:`project` or :command:`enable_language` commands
  244. initialize support for a language, it is now an error if the full
  245. path to the compiler cannot be found and stored in the corresponding
  246. :variable:`CMAKE_<LANG>_COMPILER` variable. This produces nicer error
  247. messages up front and stops processing when no working compiler
  248. is known to be available.
  249. * Target sources specified with the :command:`add_library` or
  250. :command:`add_executable` command learned to reject items which
  251. require an undocumented extra layer of variable expansion.
  252. See policy :policy:`CMP0049`.
  253. * Use of :command:`add_custom_command` undocumented ``SOURCE``
  254. signatures now results in an error. See policy :policy:`CMP0050`.
  255. Deprecated and Removed Features
  256. ===============================
  257. * Compatibility options supporting code written for CMake versions
  258. prior to 2.4 have been removed.
  259. * Several long-outdated commands that should no longer be called
  260. have been disallowed in new code by policies:
  261. - Policy :policy:`CMP0029` disallows :command:`subdir_depends`
  262. - Policy :policy:`CMP0030` disallows :command:`use_mangled_mesa`
  263. - Policy :policy:`CMP0031` disallows :command:`load_command`
  264. - Policy :policy:`CMP0032` disallows :command:`output_required_files`
  265. - Policy :policy:`CMP0033` disallows :command:`export_library_dependencies`
  266. - Policy :policy:`CMP0034` disallows :command:`utility_source`
  267. - Policy :policy:`CMP0035` disallows :command:`variable_requires`
  268. - Policy :policy:`CMP0036` disallows :command:`build_name`
  269. * The :manual:`cmake(1)` ``-i`` wizard mode has been removed.
  270. Instead use an interactive dialog such as :manual:`ccmake(1)`
  271. or use the ``-D`` option to set cache values from the command line.
  272. * The builtin documentation formatters that supported command-line
  273. options such as ``--help-man`` and ``--help-html`` have been removed
  274. in favor of the above-mentioned new documentation system. These and
  275. other command-line options that used to generate man- and html-
  276. formatted pages no longer work. The :manual:`cmake(1)`
  277. ``--help-custom-modules`` option now produces a warning at runtime
  278. and generates a minimal document that reports the limitation.
  279. * The :prop_dir:`COMPILE_DEFINITIONS_<CONFIG>` directory properties and the
  280. :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` target properties have been
  281. deprecated. Instead set the corresponding :prop_dir:`COMPILE_DEFINITIONS`
  282. directory property or :prop_tgt:`COMPILE_DEFINITIONS` target property and
  283. use :manual:`generator expressions <cmake-generator-expressions(7)>` like
  284. ``$<CONFIG:...>`` to specify per-configuration definitions.
  285. See policy :policy:`CMP0043`.
  286. * The :prop_tgt:`LOCATION` target property should no longer be read from
  287. non-IMPORTED targets. It does not make sense in multi-configuration
  288. generators since the build configuration is not known while configuring
  289. the project. It has been superseded by the ``$<TARGET_FILE>`` generator
  290. expression. See policy :policy:`CMP0026`.
  291. * The :prop_tgt:`COMPILE_FLAGS` target property is now documented
  292. as deprecated, though no warning is issued. Use the
  293. :prop_tgt:`COMPILE_OPTIONS` target property or the
  294. :command:`target_compile_options` command instead.
  295. * The :module:`GenerateExportHeader` module ``add_compiler_export_flags``
  296. function is now deprecated. It has been superseded by the
  297. :prop_tgt:`<LANG>_VISIBILITY_PRESET` and
  298. :prop_tgt:`VISIBILITY_INLINES_HIDDEN` target properties.
  299. Other Changes
  300. =============
  301. * The version scheme was changed to use only two components for
  302. the feature level instead of three. The third component will
  303. now be used for bug-fix releases or the date of development versions.
  304. See the :variable:`CMAKE_VERSION` variable documentation for details.
  305. * The default install locations of CMake itself on Windows and
  306. OS X no longer contain the CMake version number. This allows
  307. for easy replacement without re-generating local build trees
  308. manually.
  309. * Generators for Visual Studio 10 (2010) and later were renamed to
  310. include the product year like generators for older VS versions:
  311. - ``Visual Studio 10`` -> :generator:`Visual Studio 10 2010`
  312. - ``Visual Studio 11`` -> :generator:`Visual Studio 11 2012`
  313. - ``Visual Studio 12`` -> :generator:`Visual Studio 12 2013`
  314. This clarifies which generator goes with each Visual Studio
  315. version. The old names are recognized for compatibility.
  316. * The :variable:`CMAKE_<LANG>_COMPILER_ID` value for Apple-provided
  317. Clang is now ``AppleClang``. It must be distinct from upstream
  318. Clang because the version numbers differ.
  319. See policy :policy:`CMP0025`.
  320. * The :variable:`CMAKE_<LANG>_COMPILER_ID` value for ``qcc`` on QNX
  321. is now ``QCC``. It must be distinct from ``GNU`` because the
  322. command-line options differ. See policy :policy:`CMP0047`.
  323. * On 64-bit OS X the :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` value
  324. is now correctly detected as ``x86_64`` instead of ``i386``.
  325. * On OS X, CMake learned to enable behavior specified by the
  326. :prop_tgt:`MACOSX_RPATH` target property by default. This activates
  327. use of ``@rpath`` for runtime shared library searches.
  328. See policy :policy:`CMP0042`.
  329. * The :command:`build_command` command now returns a :manual:`cmake(1)`
  330. ``--build`` command line instead of a direct invocation of the native
  331. build tool. When using ``Visual Studio`` generators, CMake and CTest
  332. no longer require :variable:`CMAKE_MAKE_PROGRAM` to be located up front.
  333. Selection of the proper msbuild or devenv tool is now performed as
  334. late as possible when the solution (``.sln``) file is available so
  335. it can depend on project content.
  336. * The :manual:`cmake(1)` ``--build`` command now shares its own stdout
  337. and stderr pipes with the native build tool by default.
  338. The ``--use-stderr`` option that once activated this is now ignored.
  339. * The ``$<C_COMPILER_ID:...>`` and ``$<CXX_COMPILER_ID:...>``
  340. :manual:`generator expressions <cmake-generator-expressions(7)>`
  341. used to perform case-insensitive comparison but have now been
  342. corrected to perform case-sensitive comparison.
  343. See policy :policy:`CMP0044`.
  344. * The builtin ``edit_cache`` target will no longer select
  345. :manual:`ccmake(1)` by default when no interactive terminal will
  346. be available (e.g. with :generator:`Ninja` or an IDE generator).
  347. Instead :manual:`cmake-gui(1)` will be preferred if available.
  348. * The :module:`ExternalProject` download step learned to
  349. re-attempt download in certain cases to be more robust to
  350. temporary network failure.
  351. * The :module:`FeatureSummary` no longer lists transitive
  352. dependencies since they were not directly requested by the
  353. current project.
  354. * The ``cmake-mode.el`` major Emacs editing mode has been cleaned
  355. up and enhanced in several ways.
  356. * Include directories specified in the
  357. :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of :ref:`Imported Targets`
  358. are treated as ``SYSTEM`` includes by default when handled as
  359. :ref:`usage requirements <Include Directories and Usage Requirements>`.