1161 Commits

Author SHA1 Message Date
Marc Chevrier
9432f686e6 Add generator expression support to per-source COMPILE_DEFINITIONS
This allows users to specify different genex-based compile definitions for each file in a target.

Fixes: #17508
2017-12-05 14:47:39 +01:00
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
Brad King
5d43e46ad5 Merge topic 'whitelist-more-interface-properties'
fb3c5bfd cmTargetPropertyComputer: whitelist custom properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1515
2017-11-30 07:57:08 -05:00
Brad King
eee4124f3a Merge topic 'findiconv-module'
95646591 FindIconv: Add the FindIconv module.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1530
2017-11-30 07:55:24 -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
Christian Pfeiffer
95646591d6 FindIconv: Add the FindIconv module.
This module provides abstraction over the various ways POSIX platforms
handle the iconv calls defined in POSIX.1-2001 and later versions.
2017-11-29 14:51:32 +01: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
Brad King
caffddd620 Merge topic 'CheckIncludeFiles-language-CXX'
b31d5e1d CheckIncludeFiles: improve warning for missing argument
1f1c2a9f CheckIncludeFiles: clean up documentation of new features
c8609992 Help: Add notes for topic 'CheckIncludeFiles-language-CXX'
ea1bb902 CheckIncludeFiles: add unit tests
7669695a CheckIncludeFiles: extend to allow a LANGUAGE argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1464
2017-11-29 08:26:05 -05:00
Brad King
89a628e28f Merge topic 'fortran-compiler-launcher'
f19c70c3 Fortran: Add option to run the compiler through launcher tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1517
2017-11-29 08:21:44 -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
1882ba2e05 Merge topic 'extend-compile-language-genex'
2ae880fa Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio
2b7d59f3 Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual Studio
0f6f7c8a Genex: Fix COMPILE_LANGUAGE messages to allow file(GENERATE) with Xcode
c5a82d0f Tests: Decouple COMPILE_LANGUAGE in file(GENERATE) from COMPILE_OPTIONS
25773650 Tests: Remove unnecessary result files from RunCMake.File_Generate

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jason Juang <jasjuang@gmail.com>
Merge-request: !1511
2017-11-27 09:00:44 -05:00
Craig Scott
51ccfaacb8 Merge topic 'WriteBasicConfigVersionFile_SameMinorVersion'
d18ff3a5 WriteBasicConfigVersionFile: Fix messages in ExactVersion tests
16a93de0 WriteBasicConfigVersionFile: Add SameMinorVersion COMPATIBILITY option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Claudio <claudio.fantacci@gmail.com>
Merge-request: !1507
2017-11-22 07:29:33 -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
Ben Boeckel
fb3c5bfdbe cmTargetPropertyComputer: whitelist custom properties
CMake's properties will never begin with an underscore or a lowercase
letter, so allow them to be set by projects.
2017-11-21 11:35:41 -05:00
Daniele E. Domenichelli
16a93de0a8 WriteBasicConfigVersionFile: Add SameMinorVersion COMPATIBILITY option 2017-11-21 09:27:07 +01:00
Brad King
2ae880fa8f Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio
Since commit v3.9.0-rc4~3^2~1 (VS: Fix target_compile_options for CUDA,
2017-06-21), the evaluation of `COMPILE_LANGUAGE` receives the proper
language.  The set of compile flags used for a target's C and C++
sources is based on the linker language.  By default this is always the
C++ flags if any C++ sources appear in the target, and otherwise the C
flags.  Therefore we can define the `COMPILE_LANGUAGE` generator
expression in `COMPILE_OPTIONS` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
can do.  It is also sufficient for many use cases since the set of
allowed flags for C and C++ is almost the same in Visual Studio.
Furthermore, since the VS generator moves many of the flags to
declarative `.vcxproj` elements, it will automatically avoid passing
C++ flags for C sources.

Issue: #17435
2017-11-20 13:51:25 -05:00
Brad King
1da5a6ea39 Merge topic 'cuda-sep-comp-var'
00e13993 CUDA: Add CMAKE_CUDA_SEPARABLE_COMPILATION variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alexander Korsunsky <a.korsunsky@gmail.com>
Merge-request: !1495
2017-11-20 09:45:58 -05:00
Brad King
9100ea1d82 Merge topic 'FindOpenGL-glvnd-policy'
2ea17412 FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Clinton Stimpson <clinton@elemtech.com>
Merge-request: !1491
2017-11-20 09:43:27 -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
Brad King
2ea17412a9 FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GL
Fixes: #17449
2017-11-17 07:17:28 -05:00
J M Dieterich
f5bc78263e Find{BLAS,LAPACK}: Add support for FLAME blis and libflame
FLAME (github.com/flame) provides a variety of numerical libraries.
`blis` and `libflame` can be setup to expose BLAS/LAPACK interfaces.

Fixes: #17470
2017-11-16 11:43:15 -05:00
Brad King
c860999213 Help: Add notes for topic 'CheckIncludeFiles-language-CXX' 2017-11-14 09:07:38 -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
Brad King
30fcf13be6 Merge topic 'imported-promotion'
6a3922be Add new target-property `IMPORTED_GLOBAL`.
854e482a cmTarget: Simplified and fixed a string-comparision.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1254
2017-11-08 09:08:15 -05:00
Deniz Bahadir
6a3922bebe Add new target-property IMPORTED_GLOBAL.
The purpose of this new `IMPORTED_GLOBAL` target-property is to prolong
the lifetime and scope of `IMPORTED` targets in such a way as if they
had been created with the keyword `GLOBAL` in the first place.

* It can only be set to `TRUE`. That means, a local `IMPORTED` target
  can be promoted to global scope but a global `IMPORTED` target cannot
  be degraded to local scope!
* Setting it to `TRUE` only succeeds if done from within the same
  directory in which the `IMPORTED` target was created in the first
  place.

Fixes #17256.
2017-11-07 15:08:41 +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
Brad King
a0ec14d363 Add deprecation warnings for policies CMP0054 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for some policies
to encourage projects to port away from setting policies to OLD.
2017-11-01 11:46:53 -04:00
Brad King
cdc9c110a5 Merge topic '16780-write-single-xcodeproj'
e4e9ce7c Xcode: Add option to generate only topmost project file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1395
2017-11-01 08:02:15 -04:00
Gregor Jasny
e4e9ce7cbe Xcode: Add option to generate only topmost project file
Closes #16780
2017-10-31 17:09:26 +01:00
Jeremiah van Oosten
025221df2a VS: Add source file property to set hlsl debug and optimization flags
Add `VS_SHADER_DISABLE_OPTIMIZATIONS` and `VS_SHADER_ENABLE_DEBUG`
source file properties to control these settings on `.hlsl` files in the
VS generator.

Fixes: #17406
2017-10-30 09:52:10 -04:00
Brad King
fb88d2b5be Help: Add notes for topic 'generalize-importedtargets-behavior'
Inspired-by: Deniz Bahadir <dbahadir@benocs.com>
2017-10-26 09:11:05 -04:00
Brad King
b5dd256d94 Merge topic 'defer-target-source-check'
4e7f6738 Defer check for sources within a target until generation.
6e4e7c65 Tests: Exclude bad RunCMake.add_executable case on multi-arch Xcode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1242
2017-10-25 08:11:19 -04:00
Deniz Bahadir
4e7f67383f Defer check for sources within a target until generation.
The `add_library` and `add_executable` commands can now be called with
no source-files and won't generate a warning or error message, as long
as source-files will be added later via the `target_sources` command.
If during the generation step still no sources are associated with
targets created by such calls a useful error message will be generated
and generation fails.

Targets of type `INTERFACE_LIBRARY`, `UTILITY` or `GLOBAL_TARGET` are
excluded from this check because we do not need sources for these target
types during generation.

Fixes: #16872
2017-10-24 08:14:47 -04: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
Brad King
d209275330 Merge topic 'ti-compiler-depfile-support'
ad9327d9 Compiler/TI: Add support for depfile generation for Ninja

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1389
2017-10-19 09:27:09 -04:00
Shane Parris
d45aa38a06 Add dev notes for topic 'curl_netrc_options' 2017-10-18 15:21:43 -04:00
Nico Müller
ad9327d936 Compiler/TI: Add support for depfile generation for Ninja
TI C/C++ compiler are now able to generate dependency files during
compilation.

Fixes: #17360
2017-10-18 09:43:22 -04:00
Brad King
b0b94cdec5 Merge topic 'cmake-open'
96d642c7 cmake-gui: Use cmake::Open to open generated project
5de37a4a cmake: Add --open option for IDE generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
Merge-request: !1337
2017-10-18 09:37:59 -04:00
Brad King
0dba1db9d5 Merge topic 'module-fetchcontent'
1e56634f FetchContent: Add tests
60e74d2f FetchContent: New module for populating content at configure time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1306
2017-10-18 09:37:26 -04:00
Craig Scott
60e74d2f19 FetchContent: New module for populating content at configure time 2017-10-17 08:07:09 +11:00
Gregor Jasny
5de37a4a64 cmake: Add --open option for IDE generators 2017-10-13 21:28:34 +02:00
Brad King
3cebe2aba8 Help: Revise 3.10 release notes
Reduce duplication of `AUTOMOC` feature text.  Clarify QtIFW version
requirements.
2017-10-06 06:59:30 -04:00
Brad King
ba8aa6899d Begin post-3.10 development 2017-10-05 09:59:57 -04:00
Brad King
42d656b0b2 Help: Drop development topic notes to prepare release
Release versions do not have the development topic section of
the CMake Release Notes index page.
2017-10-05 09:54:11 -04:00
Brad King
0565192aff Help: Organize and revise 3.10 release notes
Add section headers similar to the 3.9 release notes and move each
individual bullet into an appropriate section.  Revise a few bullets.
2017-10-05 09:24:08 -04:00
Brad King
dd5835c0d6 Help: Consolidate 3.10 release notes
Run the `Utilities/Release/consolidate-relnotes.bash` script to move
notes from `Help/release/dev/*` into `Help/release/3.10.rst`.
2017-10-05 08:00:03 -04:00
Brad King
046625d26f Merge topic 'FindProtobuf-gen-desc'
1299f4cc FindProtobuf: add flag to allow descriptor files to be generated
4e91be95 FindProtobuf: Refactor custom command output listing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1301
2017-10-03 08:14:34 -04:00