3.7.rst 11 KB

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