3.4.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. CMake 3.4 Release Notes
  2. ***********************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.3 include the following.
  6. New Features
  7. ============
  8. Generators
  9. ----------
  10. * The :generator:`Visual Studio 14 2015` generator learned to select
  11. a Windows 10 SDK based on the value of the :variable:`CMAKE_SYSTEM_VERSION`
  12. variable and the SDKs available on the host.
  13. * CMake learned rudimentary support for the Apple Swift language. When using
  14. the :generator:`Xcode` generator with Xcode 6.1 or higher, one may enable
  15. the ``Swift`` language with the :command:`enable_language` command or the
  16. :command:`project` command (this is an error with other generators or when
  17. Xcode is too old). Then one may list ``.swift`` source files in targets
  18. for compilation.
  19. Commands
  20. --------
  21. * The :command:`find_program` command learned a ``NAMES_PER_DIR``
  22. option to consider all given ``NAMES`` in each directory before
  23. moving on to the next directory.
  24. * The :command:`get_filename_component` command learned a new ``BASE_DIR``
  25. subcommand. This is used to specify a base directory when calculating an
  26. absolute path from a relative path.
  27. * The :command:`if` command learned a new ``TEST`` operator that evaluates
  28. to true if a given test name has been defined by the :command:`add_test`
  29. command. See policy :policy:`CMP0064`.
  30. * The :command:`install(DIRECTORY)` command ``DESTINATION`` option learned to
  31. support :manual:`generator expressions <cmake-generator-expressions(7)>`.
  32. * The :command:`install(FILES)` command ``DESTINATION`` option learned to
  33. support :manual:`generator expressions <cmake-generator-expressions(7)>`.
  34. * The :command:`string` command learned a new ``APPEND`` subcommand.
  35. Variables
  36. ---------
  37. * The :ref:`Makefile Generators` and the :generator:`Ninja` generator
  38. learned to add compiler launcher tools like distcc and ccache along
  39. with the compiler for ``C`` and ``CXX`` languages. See the
  40. :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable and
  41. :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property for details.
  42. * New :variable:`CMAKE_LINK_SEARCH_START_STATIC` and
  43. :variable:`CMAKE_LINK_SEARCH_END_STATIC` variables were
  44. introduced to initialize the
  45. :prop_tgt:`LINK_SEARCH_START_STATIC` and
  46. :prop_tgt:`LINK_SEARCH_END_STATIC` target properties,
  47. respectively.
  48. Properties
  49. ----------
  50. * :ref:`Visual Studio Generators` learned to support additional
  51. target properties to customize projects for NVIDIA Nsight
  52. Tegra Visual Studio Edition:
  53. * :prop_tgt:`ANDROID_ANT_ADDITIONAL_OPTIONS`
  54. * :prop_tgt:`ANDROID_ARCH`
  55. * :prop_tgt:`ANDROID_ASSETS_DIRECTORIES`
  56. * :prop_tgt:`ANDROID_JAR_DEPENDENCIES`
  57. * :prop_tgt:`ANDROID_JAR_DIRECTORIES`
  58. * :prop_tgt:`ANDROID_JAVA_SOURCE_DIR`
  59. * :prop_tgt:`ANDROID_NATIVE_LIB_DEPENDENCIES`
  60. * :prop_tgt:`ANDROID_NATIVE_LIB_DIRECTORIES`
  61. * :prop_tgt:`ANDROID_PROCESS_MAX`
  62. * :prop_tgt:`ANDROID_PROGUARD`
  63. * :prop_tgt:`ANDROID_PROGUARD_CONFIG_PATH`
  64. * :prop_tgt:`ANDROID_SECURE_PROPS_PATH`
  65. * :prop_tgt:`ANDROID_SKIP_ANT_STEP`
  66. * :prop_tgt:`ANDROID_STL_TYPE`
  67. * The :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`,
  68. :prop_tgt:`LIBRARY_OUTPUT_DIRECTORY`, and
  69. :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` target properties learned to
  70. support :manual:`generator expressions <cmake-generator-expressions(7)>`.
  71. * The :prop_tgt:`SOURCE_DIR` and :prop_tgt:`BINARY_DIR` target properties
  72. were introduced to allow project code to query where a target is defined.
  73. * The :prop_tgt:`OUTPUT_NAME` target property and its variants learned to
  74. support :manual:`generator expressions <cmake-generator-expressions(7)>`.
  75. * A :prop_gbl:`TARGET_MESSAGES` global property was added to tell the
  76. :ref:`Makefile Generators` whether to generate commands to print output
  77. after each target is completed.
  78. * On Windows with MS-compatible tools, CMake learned to optionally
  79. generate a module definition (``.def``) file for ``SHARED`` libraries.
  80. See the :prop_tgt:`WINDOWS_EXPORT_ALL_SYMBOLS` target property.
  81. Modules
  82. -------
  83. * The :module:`ExternalProject` module :command:`ExternalProject_Add`
  84. function ``GIT_SUBMODULES`` option now also limits the set of
  85. submodules that are initialized in addition to the prior behavior
  86. of limiting the set of submodules that are updated.
  87. * The :module:`ExternalProject` module learned new ``USES_TERMINAL``
  88. arguments for giving steps exclusive terminal access. This is
  89. useful with the :generator:`Ninja` generator to monitor CMake
  90. superbuild progress and prevent CPU oversubscription.
  91. * The :module:`FindBISON` module ``BISON_TARGET`` macro learned a
  92. new ``DEFINES_FILE`` option to specify a custom output header
  93. to be generated.
  94. * The :module:`FindHDF5` module learend a new ``HDF5_PREFER_PARALLEL``
  95. option allowing users to specify that a parallel HDF5 tool is
  96. preferred if both are available.
  97. * The :module:`FindIce` module now provides imported targets.
  98. * The :module:`FindJava` module learned to optionally find
  99. the ``idlj`` and ``jarsigner`` tools.
  100. * The :module:`FindOpenSSL` module now provides imported targets.
  101. * The :module:`FindOpenSSL` module learned a new ``OPENSSL_USE_STATIC_LIBS``
  102. option to search only for static libraries.
  103. * The :module:`FindPkgConfig` learned a new :command:`pkg_get_variable`
  104. command which may be used to query for arbitrary variables from a package
  105. (such as for related tools or data and plugin install paths).
  106. * The :module:`FindProtobuf` module gained a new
  107. :command:`protobuf_generate_python` function to generate python
  108. sources from ``.proto`` files.
  109. * The :module:`FindTIFF` module learned to search separately for
  110. debug and release variants.
  111. * The :module:`FindwxWidgets` module learned to support version requests.
  112. * The :module:`FindXercesC` module learned to search separately for
  113. debug and release variants.
  114. * The :module:`FindZLIB` module learned to search separately for
  115. debug and release variants.
  116. * The :module:`GNUInstallDirs` module learned special default values
  117. for certain installation prefixes according to the `GNU Coding
  118. Standards`_ and the `Filesystem Hierarchy Standard`_.
  119. * The :module:`UseJava` module ``add_jar`` function learned
  120. to support response files (e.g. ``@srcs.txt``) for source
  121. specification.
  122. * The :module:`UseJava` module ``install_jar`` function learned
  123. new ``DESTINATION`` and ``COMPONENT`` options to specify
  124. the corresponding :command:`install` command options.
  125. * The :module:`UseJava` module gained a new ``create_javah``
  126. function to create C headers from Java classes.
  127. .. _`GNU Coding Standards`: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
  128. .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
  129. Generator Expressions
  130. ---------------------
  131. * A new ``$<SHELL_PATH:...>``
  132. :manual:`generator expression <cmake-generator-expressions(7)>`
  133. has been added.
  134. CTest
  135. -----
  136. * CTest learned to optionally measure the CPU load during parallel
  137. testing and avoid starting tests that may cause the load to exceed
  138. a given threshold. See the :manual:`ctest(1)` command ``--test-load``
  139. option, the ``TestLoad`` setting of the :ref:`CTest Test Step`,
  140. the :variable:`CTEST_TEST_LOAD` variable, and the ``TEST_LOAD``
  141. option of the :command:`ctest_test` command.
  142. * :manual:`ctest(1)` learned options
  143. ``--test-output-size-passed`` and ``--test-output-size-failed``
  144. to customize the limit on test output size submitted when
  145. running as a :ref:`Dashboard Client`.
  146. CPack
  147. -----
  148. * The :module:`CPackDeb` module learned to set package dependencies
  149. per component. See variables:
  150. * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS`
  151. * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS`
  152. * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES`
  153. * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS`
  154. * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES`
  155. * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS`
  156. * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES`
  157. * :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS`
  158. * The :module:`CPack` module learned to package empty directories.
  159. * The :module:`CPack` module gained a new setting, ``CPACK_VERBATIM_VARIABLES``,
  160. which can be used to ensure the cpack program receives the settings' values
  161. exactly as they were set, even if they contain CMake-special characters.
  162. For compatibility, it's off by default.
  163. Other
  164. -----
  165. * The :manual:`Compile Features <cmake-compile-features(7)>` functionality
  166. is now aware of features supported by GNU C compilers on Windows.
  167. * CMake learned to honor ``*.manifest`` source files with MSVC tools.
  168. Manifest files named as sources of ``.exe`` and ``.dll`` targets
  169. will be merged with linker-generated manifests and embedded in the
  170. binary.
  171. * The `Concurrent Fortran 77 <https://ccur.com>`__ compiler is now supported.
  172. Its :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` is ``CCur``.
  173. * :manual:`cmake(1)` gained a new ``--trace-expand`` command line option
  174. that is like ``--trace`` but expands variable references in the output.
  175. Deprecated and Removed Features
  176. ===============================
  177. * The :module:`CMakeExpandImportedTargets` module is now documented
  178. as deprecated. See module documentation for an explanation.
  179. * The :variable:`CMAKE_USE_RELATIVE_PATHS` variable no longer has any
  180. effect. Previously it was partially implemented and unreliable.
  181. Other Changes
  182. =============
  183. * The :module:`CheckFunctionExists`, :module:`CheckLibraryExists`,
  184. :module:`CheckSymbolExists`, and :module:`FindThreads` modules learned to
  185. work in environments where only CXX is enabled.
  186. * The :module:`CPackDeb` module now correctly excludes symlinks during package
  187. checksum calculation.
  188. * The :module:`CPackDeb` no longer uses fakeroot and system tar program for
  189. packaging.
  190. * The :module:`CPack` module no longer mangles settings with CMake-special
  191. characters when they're used as defaults for other settings. The macro
  192. ``cpack_set_if_not_set``, which was responsible for this, is now deprecated.
  193. * CMake no longer links executables with flags to export symbols
  194. unless the :prop_tgt:`ENABLE_EXPORTS` target property is set.
  195. See policy :policy:`CMP0065`.
  196. * The ``SONAME`` field is no longer set for ``MODULE`` libraries
  197. created with the :command:`add_library` command. ``MODULE``
  198. libraries are meant for explicit dynamic loading at runtime.
  199. They cannot be linked so ``SONAME`` is not useful.
  200. * The internal :variable:`CMAKE_<LANG>_COMPILE_OBJECT` rule variable now
  201. substitutes compiler include flags in a separate ``<INCLUDES>`` placeholder
  202. instead of the main ``<FLAGS>`` placeholder.