1CMake 3.7 Release Notes
2***********************
3
4.. only:: html
5
6  .. contents::
7
8Changes made since CMake 3.6 include the following.
9
10New Features
11============
12
13Platforms
14---------
15
16* CMake now supports :ref:`Cross Compiling for Android` with simple
17  toolchain files.
18
19* The Clang compiler is now supported on AIX.
20
21Generators
22----------
23
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.
27
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`.
33
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.
37
38* :ref:`Visual Studio Generators` for VS 2010 and above learned to
39  place ``.natvis`` source files into VS project files properly.
40
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.
44
45* The :generator:`CodeLite` generator gained a new
46  :variable:`CMAKE_CODELITE_USE_TARGETS` option
47  to change project creation from projects to targets.
48
49Commands
50--------
51
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.
55
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.
59
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.
63
64* The :command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands gained
65  ``HTTPHEADER <HTTP-header>`` and ``USERPWD <username>:<password>`` options.
66
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
70  property.
71
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`.
76
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``.
80
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.
84
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.
88
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`.
93
94Variables
95---------
96
97* Variable :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER` was added to control
98  the sorting mode of the :command:`find_package` command.
99
100* Variable :variable:`CMAKE_FIND_PACKAGE_SORT_DIRECTION` was added to control
101  the sorting direction the :command:`find_package` command.
102
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.
107
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.
116
117Properties
118----------
119
120* On Apple platforms the :prop_tgt:`BUNDLE_EXTENSION` target property
121  now also applies to Frameworks and App Bundles.
122
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.
126
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.
130
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``.
135
136* A :prop_dir:`SOURCE_DIR` directory property was added to get the
137  absolute path to the source directory associated with a directory.
138
139* A :prop_dir:`SUBDIRECTORIES` directory property was added to
140  get the list of subdirectories added by a project in a directory.
141
142* A :prop_tgt:`VS_SDK_REFERENCES` target property was added to tell
143  :ref:`Visual Studio Generators` to reference the named SDKs.
144
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.
147
148* The :prop_tgt:`WINDOWS_EXPORT_ALL_SYMBOLS` target property now applies
149  to executable targets with the :prop_tgt:`ENABLE_EXPORTS` property set.
150
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.
154
155Modules
156-------
157
158* An :module:`AndroidTestUtilities` module was added to manage transfer
159  of test data to an Android device.
160
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.
164
165* The :module:`ExternalProject` module gained ``HTTP_USERNAME`` and
166  ``HTTP_PASSWORD`` options to set http download credentials.
167
168* The :module:`ExternalProject` module gained a ``HTTP_HEADER``
169  option to add http download headers.
170
171* The :module:`FindBISON` module ``BISON_TARGET`` macro learned a new
172  ``REPORT_FILE`` option to specify the bison ``--report-file=`` option.
173
174* The :module:`FindBZip2` module now provides imported targets.
175
176* A :module:`FindICU` module was introduced to find the International
177  Components for Unicode (ICU) libraries and programs.
178
179* The :module:`FindMatlab` module learned to find the SIMULINK and MAT
180  components.
181
182* The :module:`FindMatlab` module :command:`matlab_add_mex` command learned
183  to add executables and modules.
184
185* The :module:`FindMatlab` module :command:`matlab_add_unit_test` command
186  learned to support inline Matlab test code.
187
188* The :module:`FindOpenCL` module now provides imported targets.
189
190* The :module:`FindOpenMP` module learned to detect the OpenMP
191  version (specification date) from the compiler.
192
193* A :module:`FindVulkan` module was added.
194
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.
198
199* The :module:`GNUInstallDirs` module gained a new
200  :command:`GNUInstallDirs_get_absolute_install_dir` command.
201
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.
205
206CTest
207-----
208
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.
214
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.
220
221CPack
222-----
223
224* CPack gained a :cpack_gen:`CPack productbuild Generator` on OS X.
225
226* CPack gained a new :variable:`CPACK_PACKAGE_CHECKSUM` variable to
227  enable generation of a checksum file for each package file.
228
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`
232
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.
236
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
240  installer.
241
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.
245
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`.
250
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.
254
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.
259
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.
263
264* The :cpack_gen:`CPack WIX Generator` now supports
265  :variable:`CPACK_WIX_PATCH_FILE` fragments for Feature elements.
266
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.
271
272Other
273-----
274
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.).
278
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
282  to change.
283
284* The :manual:`cmake(1)` command learned a ``--trace-source=<file>`` option.
285
286* :manual:`ccmake(1)` learned to support vim-like navigation bindings.
287
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.
290
291Deprecated and Removed Features
292===============================
293
294* We no longer provide Linux i386 binaries for download from ``cmake.org``
295  for new versions of CMake.
296
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.
300
301* Support for building CMake itself with some compilers was dropped:
302
303  * Visual Studio 7.1 and 2005 -- superseded by VS 2008 and above
304  * MinGW.org mingw32 -- superseded by MSYS2 mingw32 and mingw64
305
306  CMake still supports generating build systems for other projects using
307  these compilers.
308
309Other Changes
310=============
311
312* The Fortran dependency scanner learned to support the syntax of
313  `Fortran Submodules`_.
314
315* Vim support files ``indent/cmake.vim`` and ``syntax/cmake.vim``
316  from the `vim-cmake-syntax`_ project are now distributed with CMake.
317
318.. _`Fortran Submodules`: http://fortranwiki.org/fortran/show/Submodules
319.. _`vim-cmake-syntax`: https://github.com/pboettch/vim-cmake-syntax
320