3.7.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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 ``productbuild`` generator on OS X, configured by
  162. the :module:`CPackProductBuild` module.
  163. * CPack gained a new :variable:`CPACK_PACKAGE_CHECKSUM` variable to
  164. enable generation of a checksum file for each package file.
  165. * The :module:`CPackDeb` module learned to support long file names
  166. when archive format is set to GNU tar.
  167. See :variable:`CPACK_DEBIAN_ARCHIVE_TYPE`
  168. * The :module:`CPackIFW` module gained a new
  169. :command:`cpack_ifw_add_package_resources` command to include additional
  170. resources in the installer binary.
  171. * The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and
  172. :command:`cpack_ifw_configure_component_group` commands gained a new
  173. ``USER_INTERFACES`` option to add a list of additional pages to the IFW
  174. installer.
  175. * The :module:`CPackRPM` module learned to generate debuginfo
  176. packages on demand. See :variable:`CPACK_RPM_DEBUGINFO_PACKAGE`
  177. and its per component version.
  178. * The :module:`CPackRPM` module learned to generate source rpm
  179. (SRPM) packages on demand. See :variable:`CPACK_RPM_PACKAGE_SOURCES`,
  180. :variable:`CPACK_RPM_SOURCE_PKG_BUILD_PARAMS` and
  181. :variable:`CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX`.
  182. * The CPack NSIS generator now supports
  183. :variable:`CPACK_NSIS_<compName>_INSTALL_DIRECTORY`.
  184. This can be used to set component specific installation directories.
  185. * The CPack WIX generator now supports
  186. :variable:`CPACK_WIX_SKIP_PROGRAM_FOLDER` to allow specification
  187. of a custom absolute installation prefix outside
  188. of the ProgramFiles folders.
  189. * The CPack WIX generator now supports
  190. :variable:`CPACK_COMPONENT_<compName>_DISABLED`.
  191. This can be used to deselect a component from being installed by default.
  192. * The CPack WIX generator now supports :variable:`CPACK_WIX_PATCH_FILE`
  193. fragments for Feature elements.
  194. * The CPack WIX generator now supports
  195. :variable:`CPACK_WIX_ROOT_FEATURE_TITLE` and
  196. :variable:`CPACK_WIX_ROOT_FEATURE_DESCRIPTION` to allow the specification
  197. of a custom title and description for the root feature element.
  198. Other
  199. -----
  200. * :manual:`cmake(1)` gained a ``-E capabilities`` option to provide a
  201. machine-readable (JSON) description of the capabilities of the
  202. cmake tool (available generators, etc.).
  203. * A new :manual:`cmake-server(7)` mode was added to provide semantic
  204. information about a CMake-generated buildsystem to clients through
  205. a JSON protocol. Currently all protocols are experimental and subject
  206. to change.
  207. * The :manual:`cmake(1)` command learned a ``--trace-source=<file>`` option.
  208. * :manual:`ccmake(1)` learned to support vim-like navigation bindings.
  209. * :manual:`cmake-gui(1)` gained a button to open the generated project file
  210. for :ref:`Visual Studio Generators` and the :generator:`Xcode` generator.
  211. Deprecated and Removed Features
  212. ===============================
  213. * We no longer provide Linux i386 binaries for download from ``cmake.org``
  214. for new versions of CMake.
  215. * Vim support files ``cmake-indent.vim``, ``cmake-syntax.vim``, and
  216. ``cmake-help.vim`` have been removed in favor of the files now provided
  217. from the `vim-cmake-syntax`_ project.
  218. * Support for building CMake itself with some compilers was dropped:
  219. * Visual Studio 7.1 and 2005 -- superseded by VS 2008 and above
  220. * MinGW.org mingw32 -- superseded by MSYS2 mingw32 and mingw64
  221. CMake still supports generating build systems for other projects using
  222. these compilers.
  223. Other Changes
  224. =============
  225. * The Fortran dependency scanner learned to support the syntax of
  226. `Fortran Submodules`_.
  227. * Vim support files ``indent/cmake.vim`` and ``syntax/cmake.vim``
  228. from the `vim-cmake-syntax`_ project are now distributed with CMake.
  229. .. _`Fortran Submodules`: http://fortranwiki.org/fortran/show/Submodules
  230. .. _`vim-cmake-syntax`: https://github.com/pboettch/vim-cmake-syntax