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