3.7.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. CMake 3.7 Release Notes
  2. ***********************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.6 include the following.
  6. New Features
  7. ============
  8. Platforms
  9. ---------
  10. * CMake now supports :ref:`Cross Compiling for Android` with simple
  11. toolchain files.
  12. * The Clang compiler is now supported on AIX.
  13. Generators
  14. ----------
  15. * The :generator:`Ninja` generator learned to conditionally support
  16. Fortran when using a ``ninja`` tool that has the necessary features.
  17. See generator documentation for details.
  18. * The :generator:`Ninja` generator learned to produce phony targets
  19. of the form ``sub/dir/{test,install,package}`` to drive the build
  20. of a subdirectory installation, test or packaging target.
  21. This is equivalent to ``cd sub/dir; make {test,install,package}``
  22. with :ref:`Makefile Generators`.
  23. * The :generator:`Visual Studio 15 2017` generator was added. This is
  24. experimental and based on "Visual Studio 2017 RC" because this version
  25. of VS has not been released.
  26. * :ref:`Visual Studio Generators` for VS 2010 and above learned to
  27. place ``.natvis`` source files into VS project files properly.
  28. * The :generator:`Xcode` generator's rudimentary Swift language support
  29. learned to honor a new :variable:`CMAKE_Swift_LANGUAGE_VERSION` variable
  30. to tell Xcode what version of Swift is used by the source.
  31. * The :generator:`CodeLite` generator gained a new
  32. :variable:`CMAKE_CODELITE_USE_TARGETS` option
  33. to change project creation from projects to targets.
  34. Commands
  35. --------
  36. * The :command:`add_custom_command` command gained a new ``DEPFILE``
  37. option that works with the :generator:`Ninja` generator to provide
  38. implicit dependency information to the build tool.
  39. * The :command:`cmake_parse_arguments` command gained a new ``PARSE_ARGV``
  40. mode to read arguments directly from ``ARGC`` and ``ARGV#``
  41. variables inside a :command:`function` body.
  42. * The :command:`export` command gained an ``ANDROID_MK`` option
  43. to generate ``Android.mk`` files referencing CMake-built
  44. libraries as prebuilts for the Android NDK build system.
  45. * The :command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands gained
  46. ``HTTPHEADER <HTTP-header>`` and ``USERPWD <username>:<password>`` options.
  47. * The :command:`find_library` and :command:`find_package` commands learned
  48. to search in ``lib32/`` directories when the build targets a 32-bit
  49. architecture. See the :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS` global
  50. property.
  51. * The :command:`find_package` command gained the possibility of
  52. sorting compatible libraries by ``NAME`` or by ``NATURAL`` sorting by
  53. setting the two new variables :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER`
  54. and :variable:`CMAKE_FIND_PACKAGE_SORT_DIRECTION`.
  55. * The :command:`if` command gained new boolean comparison operations
  56. ``LESS_EQUAL``, ``GREATER_EQUAL``, ``STRLESS_EQUAL``, ``STRGREATER_EQUAL``,
  57. ``VERSION_LESS_EQUAL``, and ``VERSION_GREATER_EQUAL``.
  58. * The :command:`install` command gained an ``EXPORT_ANDROID_MK``
  59. subcommand to install ``Android.mk`` files referencing installed
  60. libraries as prebuilts for the Android NDK build system.
  61. * The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)`
  62. commands gained support for the ``%a`` and ``%b`` placeholders.
  63. These are the abbreviated weekday and month names.
  64. * The :command:`try_compile` command source file signature now honors
  65. configuration-specific flags (e.g. :variable:`CMAKE_<LANG>_FLAGS_DEBUG`)
  66. in the generated test project. Previously only the default such flags
  67. for the current toolchain were used. See policy :policy:`CMP0066`.
  68. Variables
  69. ---------
  70. * Variable :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER` was added to control
  71. the sorting mode of the :command:`find_package` command.
  72. * Variable :variable:`CMAKE_FIND_PACKAGE_SORT_DIRECTION` was added to control
  73. the sorting direction the :command:`find_package` command.
  74. * :variable:`Toolchain files <CMAKE_TOOLCHAIN_FILE>` may now set a
  75. :variable:`CMAKE_<LANG>_FLAGS_INIT` variable to initialize the
  76. :variable:`CMAKE_<LANG>_FLAGS` cache entry the first time a language is
  77. enabled in a build tree.
  78. * :variable:`Toolchain files <CMAKE_TOOLCHAIN_FILE>` may now set
  79. :variable:`CMAKE_EXE_LINKER_FLAGS_INIT`,
  80. :variable:`CMAKE_SHARED_LINKER_FLAGS_INIT`, and
  81. :variable:`CMAKE_MODULE_LINKER_FLAGS_INIT` variables to initialize the
  82. :variable:`CMAKE_EXE_LINKER_FLAGS`,
  83. :variable:`CMAKE_SHARED_LINKER_FLAGS`, and
  84. :variable:`CMAKE_MODULE_LINKER_FLAGS` cache entries the first time
  85. a language is enabled in a build tree.
  86. Properties
  87. ----------
  88. * On Apple platforms the :prop_tgt:`BUNDLE_EXTENSION` target property
  89. now also applies to Frameworks and App Bundles.
  90. * A :prop_dir:`BINARY_DIR` directory property was added to get the
  91. absolute path to the binary directory corresponding to the source
  92. directory on which the property is read.
  93. * A :prop_dir:`BUILDSYSTEM_TARGETS` directory property was added to
  94. get the list of logical buildsystem target names added by the
  95. project in a directory.
  96. * A :prop_tgt:`LINK_WHAT_YOU_USE` target property and supporting
  97. :variable:`CMAKE_LINK_WHAT_YOU_USE` variable were introduced
  98. to detect (on UNIX) shared libraries that are linked but not
  99. needed by running ``ldd -r -u``.
  100. * A :prop_dir:`SOURCE_DIR` directory property was added to get the
  101. absolute path to the source directory associated with a directory.
  102. * A :prop_dir:`SUBDIRECTORIES` directory property was added to
  103. get the list of subdirectories added by a project in a directory.
  104. * A :prop_tgt:`VS_SDK_REFERENCES` target property was added to tell
  105. :ref:`Visual Studio Generators` to reference the named SDKs.
  106. * A :prop_sf:`VS_TOOL_OVERRIDE` source file property was created to tell
  107. :ref:`Visual Studio Generators` what tool to use for a source file.
  108. * The :prop_tgt:`WINDOWS_EXPORT_ALL_SYMBOLS` target property now applies
  109. to executable targets with the :prop_tgt:`ENABLE_EXPORTS` property set.
  110. * A :prop_sf:`XCODE_FILE_ATTRIBUTES` source file property was
  111. added to tell the :generator:`Xcode` generator to generate
  112. custom content in the Xcode project attributes for the file.
  113. Modules
  114. -------
  115. * An :module:`AndroidTestUtilities` module was added to manage transfer
  116. of test data to an Android device.
  117. * The :module:`CheckFortranSourceCompiles` module macro
  118. ``CHECK_Fortran_SOURCE_COMPILES`` gained a ``SRC_EXT`` option
  119. to specify a custom test Fortran source file extension.
  120. * The :module:`ExternalProject` module gained ``HTTP_USERNAME`` and
  121. ``HTTP_PASSWORD`` options to set http download credentials.
  122. * The :module:`ExternalProject` module gained a ``HTTP_HEADER``
  123. option to add http download headers.
  124. * The :module:`FindBISON` module ``BISON_TARGET`` macro learned a new
  125. ``REPORT_FILE`` option to specify the bison ``--report-file=`` option.
  126. * The :module:`FindBZip2` module now provides imported targets.
  127. * A :module:`FindICU` module was introduced to find the International
  128. Components for Unicode (ICU) libraries and programs.
  129. * The :module:`FindMatlab` module learned to find the SIMULINK and MAT
  130. components.
  131. * The :module:`FindMatlab` module :command:`matlab_add_mex` command learned
  132. to add executables and modules.
  133. * The :module:`FindMatlab` module :command:`matlab_add_unit_test` command
  134. learned to support inline Matlab test code.
  135. * The :module:`FindOpenCL` module now provides imported targets.
  136. * The :module:`FindOpenMP` module learned to detect the OpenMP
  137. version (specification date) from the compiler.
  138. * A :module:`FindVulkan` module was added.
  139. * The :module:`GenerateExportHeader` module learned a new
  140. ``CUSTOM_CONTENT_FROM_VARIABLE`` option to specify a variable
  141. containing custom content for inclusion in the generated header.
  142. * The :module:`GNUInstallDirs` module gained a new
  143. :command:`GNUInstallDirs_get_absolute_install_dir` command.
  144. * The :module:`UseJava` module gained APIs to "export" jar targets
  145. for use by external CMake projects. See the ``install_jar_exports``
  146. and ``export_jars`` functions.
  147. CTest
  148. -----
  149. * CTest now supports test fixtures through the new :prop_test:`FIXTURES_SETUP`,
  150. :prop_test:`FIXTURES_CLEANUP` and :prop_test:`FIXTURES_REQUIRED` test
  151. properties. When using regular expressions or ``--rerun-failed`` to limit
  152. the tests to be run, a fixture's setup and cleanup tests will automatically
  153. be added to the execution set if any test requires that fixture.
  154. * The :command:`ctest_configure`, :command:`ctest_build`,
  155. :command:`ctest_test`, :command:`ctest_coverage`, and :command:`ctest_upload`
  156. commands gained a new ``CAPTURE_CMAKE_ERROR`` option to capture any errors
  157. that occur as the commands run into a variable and avoid affecting the return
  158. code of the :manual:`ctest(1)` process.
  159. CPack
  160. -----
  161. * CPack gained a :cpack_gen:`CPack productbuild Generator` on OS X.
  162. * CPack gained a new :variable:`CPACK_PACKAGE_CHECKSUM` variable to
  163. enable generation of a checksum file for each package file.
  164. * The :cpack_gen:`CPack DEB Generator` learned to support long file names
  165. when archive format is set to GNU tar.
  166. See :variable:`CPACK_DEBIAN_ARCHIVE_TYPE`
  167. * The :module:`CPackIFW` module gained a new
  168. :command:`cpack_ifw_add_package_resources` command to include additional
  169. resources in the installer binary.
  170. * The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and
  171. :command:`cpack_ifw_configure_component_group` commands gained a new
  172. ``USER_INTERFACES`` option to add a list of additional pages to the IFW
  173. installer.
  174. * The :cpack_gen:`CPack RPM Generator` learned to generate debuginfo
  175. packages on demand. See :variable:`CPACK_RPM_DEBUGINFO_PACKAGE`
  176. and its per component version.
  177. * The :cpack_gen:`CPack RPM Generator` learned to generate source rpm
  178. (SRPM) packages on demand. See :variable:`CPACK_RPM_PACKAGE_SOURCES`,
  179. :variable:`CPACK_RPM_SOURCE_PKG_BUILD_PARAMS` and
  180. :variable:`CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX`.
  181. * The :cpack_gen:`CPack NSIS Generator` now supports
  182. :variable:`CPACK_NSIS_<compName>_INSTALL_DIRECTORY`.
  183. This can be used to set component specific installation directories.
  184. * The :cpack_gen:`CPack WIX Generator` now supports
  185. :variable:`CPACK_WIX_SKIP_PROGRAM_FOLDER` to allow specification
  186. of a custom absolute installation prefix outside
  187. of the ProgramFiles folders.
  188. * The :cpack_gen:`CPack WIX Generator` now supports
  189. :variable:`CPACK_COMPONENT_<compName>_DISABLED`.
  190. This can be used to deselect a component from being installed by default.
  191. * The :cpack_gen:`CPack WIX Generator` now supports
  192. :variable:`CPACK_WIX_PATCH_FILE` fragments for Feature elements.
  193. * The :cpack_gen:`CPack WIX Generator` now supports
  194. :variable:`CPACK_WIX_ROOT_FEATURE_TITLE` and
  195. :variable:`CPACK_WIX_ROOT_FEATURE_DESCRIPTION` to allow the specification
  196. of a custom title and description for the root feature element.
  197. Other
  198. -----
  199. * :manual:`cmake(1)` gained a ``-E capabilities`` option to provide a
  200. machine-readable (JSON) description of the capabilities of the
  201. cmake tool (available generators, etc.).
  202. * A new :manual:`cmake-server(7)` mode was added to provide semantic
  203. information about a CMake-generated buildsystem to clients through
  204. a JSON protocol. Currently all protocols are experimental and subject
  205. to change.
  206. * The :manual:`cmake(1)` command learned a ``--trace-source=<file>`` option.
  207. * :manual:`ccmake(1)` learned to support vim-like navigation bindings.
  208. * :manual:`cmake-gui(1)` gained a button to open the generated project file
  209. for :ref:`Visual Studio Generators` and the :generator:`Xcode` generator.
  210. Deprecated and Removed Features
  211. ===============================
  212. * We no longer provide Linux i386 binaries for download from ``cmake.org``
  213. for new versions of CMake.
  214. * Vim support files ``cmake-indent.vim``, ``cmake-syntax.vim``, and
  215. ``cmake-help.vim`` have been removed in favor of the files now provided
  216. from the `vim-cmake-syntax`_ project.
  217. * Support for building CMake itself with some compilers was dropped:
  218. * Visual Studio 7.1 and 2005 -- superseded by VS 2008 and above
  219. * MinGW.org mingw32 -- superseded by MSYS2 mingw32 and mingw64
  220. CMake still supports generating build systems for other projects using
  221. these compilers.
  222. Other Changes
  223. =============
  224. * The Fortran dependency scanner learned to support the syntax of
  225. `Fortran Submodules`_.
  226. * Vim support files ``indent/cmake.vim`` and ``syntax/cmake.vim``
  227. from the `vim-cmake-syntax`_ project are now distributed with CMake.
  228. .. _`Fortran Submodules`: https://fortranwiki.org/fortran/show/Submodules
  229. .. _`vim-cmake-syntax`: https://github.com/pboettch/vim-cmake-syntax