Commit Graph

336 Commits

Author SHA1 Message Date
Brad King
5f87ea1603 Merge topic 'cmake-job-pool'
07185055 Ninja: add CMAKE_JOB_POOLS variable as default for JOBS_POOLS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1514
2017-12-04 10:38:51 -05:00
Matt McCormick
07185055d5 Ninja: add CMAKE_JOB_POOLS variable as default for JOBS_POOLS
This enables configuration of build parallelism with the Ninja generator by
passing arguments on the command line to CMake. For example,

  cmake \
    '-DCMAKE_JOB_POOLS:STRING=compile=5;link=2' \
    -DCMAKE_JOB_POOL_COMPILE:STRING=compile \
    -DCMAKE_JOB_POOL_LINK:STRING=link \
      ~/src/MyProject
2017-11-29 15:13:36 -05:00
Brad King
c07b18d883 Merge topic 'CodeBlocks-custom-compiler-id'
e04f1d1b CodeBlocks: add option for the CB compiler ID

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1512
2017-11-29 08:32:26 -05:00
Melven Roehrig-Zoellner
e04f1d1b47 CodeBlocks: add option for the CB compiler ID
CodeBlocks uses his own compiler ID string which may differ from
CMAKE_<LANG>_COMPILER_ID. In particular CodeBlocks supports a large
number of different compiler configurations (with different IDs)
This commit adds a cache variable "CMAKE_CODEBLOCKS_COMPILER_ID",
so the user might adjust it when needed.
2017-11-27 14:41:54 -05:00
Brad King
f19c70c3d2 Fortran: Add option to run the compiler through launcher tools
Add a `Fortran_COMPILER_LAUNCHER` target property like those added for C
and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler
through tools like ccache or distcc, 2015-06-04) and CUDA by commit
v3.10.0-rc1~531^2 (CUDA: Add option to run the compiler through launcher
tools, 2017-06-09).

Fixes: #17499
2017-11-21 14:44:01 -05:00
Brad King
00e13993fd CUDA: Add CMAKE_CUDA_SEPARABLE_COMPILATION variable
Use its value to initialize the `CUDA_SEPARABLE_COMPILATION` target
property when targets are created.

Fixes: #17478
2017-11-17 09:51:39 -05:00
Domen Vrankar
7e896029cd CPack: enable setting default dir creation permissions
Introduces CPACK_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS
variable which adds support for functionality introduced
by CMAKE_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS variable.

Fixes #17333

# Conflicts:
#	Help/release/dev/cmake-default-dir-install-permissions.rst
2017-11-08 20:27:11 +01:00
Domen Vrankar
deeba85f81 CMake: enable setting default dir creation permissions
Introduces CMAKE_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS
variable which enables the user to specify the default
permissions for directory creation. This setting is then
used to auto set the permissions on directories which
are implicitly created by install() and file(INSTALL)
commands such as CMAKE_INSTALL_PREFIX directories.
2017-11-08 20:27:03 +01:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Gregor Jasny
e4e9ce7cbe Xcode: Add option to generate only topmost project file
Closes #16780
2017-10-31 17:09:26 +01:00
Brad King
9ffb35386f VS: Select and save a VS 2017 instance persistently
Visual Studio 2017 supports multiple instances installed on a single
machine.  We use the Visual Studio Installer tool to enumerate instances
and select one.  Once we select an instance for a given build tree, save
the result in `CMAKE_GENERATOR_INSTANCE` so we can re-configure the tree
with the same instance on future re-runs of CMake.

Fixes: #17268
2017-10-19 10:20:12 -04:00
Brad King
314613d1af Add infrastructure for generators to select a build tool instance
Add cache entry `CMAKE_GENERATOR_INSTANCE` to hold the instance location
persistently across re-runs of CMake in a given build tree.

For now we reject the option by default if explicitly set.  It will be
implemented on a per-generator basis.  Pass the setting into try_compile
project generation.  Add a RunCMake.GeneratorInstance test to cover
basic use cases for the option.  Verify that `CMAKE_GENERATOR_INSTANCE`
is empty by default, and that it is rejected when the generator does not
support a user setting.

Issue: #17268
2017-10-19 10:20:08 -04:00
Brad King
358ceee5d8 Merge topic 'curl_netrc_options'
d45aa38a Add dev notes for topic 'curl_netrc_options'
60c272b6 ExternalProject: Add support for NETRC and NETRC_FILE suboption
754e39dd Add testcases for file(DOWNLOAD|UPLOAD) netrc options
5d67e902 file(DOWNLOAD|UPLOAD): Add 'NETRC' and 'NETRC_FILE' suboption

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
Merge-request: !1376
2017-10-19 09:27:43 -04:00
Shane Parris
5d67e9025d file(DOWNLOAD|UPLOAD): Add 'NETRC' and 'NETRC_FILE' suboption 2017-10-18 15:21:42 -04:00
Sebastian Holtermann
814cddbe18 Autogen: Docs: Add examples for AUTORCC_OPTIONS and AUTOUIC_OPTIONS 2017-10-09 14:36:48 +02:00
Brad King
b96ca728f1 Add infrastructure to detect secondary compiler version information
Create a `CMAKE_<LANG>_COMPILER_VERSION_INTERNAL` variable to hold
a secondary/internal compiler version number detected at the same
time as the primary compiler version.  This will be useful for some
compilers where we need such a number to determine correct usage.

Inspired-by: Stefan Andersson <tfosm@hotmail.com>
Suggested-by: Norbert Lange <norbert.lange@andritz.com>
Issue: #17264
2017-10-03 08:11:27 -04:00
Sebastian Holtermann
75c98b5ef4 Autogen: Doc: Add documentation for (CMAKE_)AUTOMOC_COMPILER_PREDEFINES
Also adds the documentation for CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND.

Closes #17275
2017-09-29 15:00:47 +02:00
Brad King
194dd9ea8b Merge topic 'autogen-macro-names2'
93c8d55d Autogen: Update (CMAKE_)AUTOMOC_MACRO_NAMES release notes
084ace47 Autogen: Tests: Update AUTOMOC_MACRO_NAMES test
08041dd1 Autogen: Doc: Update documentation for (CMAKE_)AUTOMOC_MACRO_NAMES
7b33d67b Autogen: Create info file directory before writing
786b5be0 Autogen: Define all macro names in CMAKE_AUTOMOC_MACRO_NAMES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1321
2017-09-29 08:53:13 -04:00
Sebastian Holtermann
08041dd15e Autogen: Doc: Update documentation for (CMAKE_)AUTOMOC_MACRO_NAMES 2017-09-28 09:21:44 +02:00
Craig Scott
a2eec58dfa Merge topic 'document_env_variables'
e6b77c5f Help: Document CMake's environment variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1235
2017-09-27 09:01:35 -04:00
Robert Maynard
e6b77c5f1a Help: Document CMake's environment variables 2017-09-26 08:44:45 -04:00
Brad King
0741b6e226 Help: Update MSVC_VERSION documentation
Add the corresponding toolset name for each version.  While at it,
link to the general compiler version variable.
2017-09-25 11:44:12 -04:00
Wojciech Mamrak
00d9dd95af Help: Document MSVC_VERSION value 1911 2017-09-25 11:38:27 -04:00
Craig Scott
77eb212d07 Help: Clarify/make consistent the APPLE, UNIX and WIN32 variable docs 2017-09-18 18:57:12 +10:00
Alexandr (Sagrer) Gridnev
fb19b7789a CodeBlocks: add option to exclude external files
Add variable `CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES` to optionally
exclude files from outside the project root from the project file
written by the CodeBlocks extra generator.  This optionally restores
logic that had been removed by commit v2.8.3~40^2 (CodeBlocks Generator:
Do not omit files in the project file listing, 2010-10-05) in response
to QTCREATORBUG-2250.

Issue: #12110
Fixes: #17188
2017-09-14 13:21:59 +03:00
Tin Huynh
2f3a07a981 Flang: Add support for flang Fortran compiler
flang is a Fortran compiler built on top of clang [1].  Because flang
shares a lot of commonalities with clang, the flang module piggybacks
off the clang module and overrides certain options.

Add flang to Fortran compiler auto find list.

Update flang preprocessor macros to differentiate from PGI.

Add Flang-FindBinUtils.

[1] https://github.com/flang-compiler/flang
2017-08-31 15:24:59 -04:00
Brad King
952331cded Help: Cross-reference and clarify CMAKE_FIND_NO_INSTALL_PREFIX docs
Suggested-by: Luke Yeager <lukeyeager@users.noreply.github.com>
2017-08-30 15:05:04 -04:00
Bill Hoffman
311b7b1a70 Add properties to run cppcheck along with the compiler
Create a `<LANG>_CPPCHECK` target property (initialized by a
`CMAKE_<LANG>_CPPCHECK` variable) to specify a `cppcheck` command line
to be run along with the compiler.
2017-08-30 10:23:46 -04:00
Sebastian Holtermann
7529d84fac Autogen: Add documentation for AUTOMOC_MACRO_NAMES 2017-08-18 13:58:14 +02:00
Brad King
f5be951117 Merge topic 'labels-for-subprojects'
376dc3eb Help: Add notes for topic 'labels_for_subprojects'
a70d8e93 Add tests for new directory labels and labels-for-subprojects features
47b3a57c Display subproject timing summary
d3859624 Add directory property 'LABELS' and CMAKE_DIRECTORY_LABELS variable
d08ec4d2 Add CTEST_LABELS_FOR_SUBPROJECTS as a CTest module and script variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1004
2017-07-13 07:46:09 -04:00
Betsy McPhail
d385962419 Add directory property 'LABELS' and CMAKE_DIRECTORY_LABELS variable
The specified LABELS will be passed down to subdirectories as well as
any targets or tests in the directory.
2017-07-10 16:25:18 -04:00
Betsy McPhail
d08ec4d25a Add CTEST_LABELS_FOR_SUBPROJECTS as a CTest module and script variable
Use this variable to specify a list of labels that will be reported to
CDash as subprojects.
2017-07-10 16:25:18 -04:00
Brad King
1ff7cd1fe7 Merge topic 'iar_improved'
d8e6cd9e IAR: Improve support for IAR ARM Compiler
0b1a2876 Add a CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID variable
fea7d69d Store CMAKE_ASM_COMPILER_VERSION persistently
d2a8b5ce CMakeDetermineASMCompiler: Fix small copy-paste mistake
a2112257 Add infrastructure to use language extensions without any standard
8cd28bb0 cmLocalGenerator: Switch order of <LANG>_{EXTENSIONS,STANDARD} check
0fc2d78e cmLocalGenerator: Simplify logic for language standard or extension flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !991
2017-07-07 08:42:22 -04:00
Norbert Lange
d8e6cd9ed8 IAR: Improve support for IAR ARM Compiler
Make the implementation for this compiler more complete.

IAR has multiple C++ modes, historically they were reduced c++ versions
for embedded that gradually improved to the full standard (which can be
reduced again by e.g. disabling rtti and exceptions).  The new
implementation picks the best available, but the c++ mode can also be
overridden by defining `CMAKE_IAR_CXX_FLAG`.

Add C/C++ standard flags so that all modes up to and including the last
supported standard are defined.

Fixes: #16826
2017-06-29 13:25:58 -04:00
Norbert Lange
0b1a2876c8 Add a CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID variable
Compilers such as MSVC and IAR may have variants that target different
architectures.  We have been using a `MSVC_<LANG>_ARCHITECTURE_ID`
variable to hold this information for MSVC.  Add an alternative with a
more general name (later we can port MSVC to it too).

This additional information may be needed to generate proper invocations
of the compiler based on its architecture variant.
2017-06-29 13:25:57 -04:00
Robert Maynard
adbd1468cb Help: Document the CMAKE_MSVCIDE_RUN_PATH variable. 2017-06-27 13:52:11 -04:00
Brad King
9203aff851 Merge topic 'android-unified-headers'
3d00be13 Android: Add support for unified headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !956
2017-06-13 09:27:17 -04:00
Brad King
3d00be13ee Android: Add support for unified headers
The unified headers are preferred as of NDK r15, so use them by default
if available and provide an option to use the deprecated headers.

Inspired-by: Florent Castelli <florent.castelli@gmail.com>
Fixes: #16584
2017-06-12 11:47:30 -04:00
Brad King
414438b2fb CUDA: Add option to run the compiler through launcher tools
Add a `CUDA_COMPILER_LAUNCHER` target property like those added for C
and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler
through tools like ccache or distcc, 2015-06-04).

Fixes: #16953
2017-06-09 12:34:39 -04:00
Gregor Jasny
7a9a1e0453 Help: Add a hint about C and C++ compiler version variable
Closes #16917
2017-05-28 20:19:53 +02:00
Brad King
53e89b6ab0 Add options for separate compile and link sysroots
Add `CMAKE_SYSROOT_COMPILE` and `CMAKE_SYSROOT_LINK` variables to as
operation-specific alternatives to `CMAKE_SYSROOT`.  This will be useful
for Android NDKs that compile and link with different sysroot values
(e.g. `r14` with unified headers).

Co-Author: Florent Castelli <florent.castelli@gmail.com>
2017-05-09 14:21:54 -04:00
Christian Pfeiffer
664bb36729 Help: Fix CMAKE_HOST_WIN32 documentation
The documentation falsely claims `CMAKE_HOST_WIN32` is `true` on Cygwin.
Since commit v2.8.4~153^2 (Cygwin: Do not define 'WIN32', 2010-12-17) we
do not define `CMAKE_HOST_WIN32` on Cygwin either.
2017-04-24 20:22:24 +02:00
Brad King
c94f1bcf92 Drop Visual Studio 7 .NET 2003 generator
This generator has been deprecated since CMake 3.6.  Remove it.
2017-04-19 15:28:05 -04:00
Brad King
eb08e1febb Help: Document CMAKE_MATCH_<n> variables 2017-04-18 14:45:49 -04:00
Brad King
f7e3a34d3c Merge topic 'ipo-var-per-config'
470437f6 Support CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !709
2017-04-18 08:54:24 -04:00
Ruslan Baratov
470437f6f9 Support CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> 2017-04-18 03:10:34 +08:00
Brad King
c0323cbf5f Merge topic 'vs-custom-kits-dir'
fee01194 VS: Add an environment variable for the Windows 10 kits directory
b80c6d12 VS: Refactor Win 10 Kits root detection to support multiple roots

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !696
2017-04-17 10:29:15 -04:00
Brad King
2cb98329f1 Merge topic 'project-description'
3b484871 project: Add `DESCRIPTION` parameter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !679
2017-04-13 08:14:23 -04:00
Brad King
fee011946e VS: Add an environment variable for the Windows 10 kits directory
Define a `CMAKE_WINDOWS_KITS_10_DIR` environment variable to allow
users to tell CMake about a custom Windows 10 SDK directory.  We
choose to make this an environment variable rather than a CMake
variable or cache entry because:

* Using a custom directory also requires custom external MSBuild
  configuration.  Therefore users are already configuring a
  custom environment.

* The custom directory must be set consistently in all parts of
  a build including nested projects.  An environment variable
  avoids requiring users to thread the setting into nested builds.

Fixes: #16743
2017-04-12 10:57:05 -04:00
Alex Turbov
3b4848717a project: Add DESCRIPTION parameter
It is quite often the project description has used in a real world software.
Examples include:

* part of a help screen of the application
* builtin resources (`*.rc` files, data for "About" dialog of a GUI app, & etc)
* most generators for CPack can use it
* it could be used by documentary software (Doxygen, Sphinx) which is usually
  integrated to CMake based projects via `add_custom_target()`

Now `project()` call learned an optional `DESCRIPTION` parameter with a
short string describing a project. Being specified, it would set the
`PROJECT_DESCRIPTION` variable which could be used in `configure_file()`
or whatever user wants.  Also `PROJECT_DESCRIPTION` is a default value
for `CPACK_PACKAGE_DESCRIPTION_SUMMARY`.
2017-04-11 10:17:00 -04:00