7026 Commits

Author SHA1 Message Date
Brad King
b0996a3fa2 Features: Add meta-features requesting awareness of a particular standard
A common use case of `target_compile_features` is simply to specify that
the compiler should be run in a mode that is aware of e.g. C++11.  Some
projects simply specify a particular C++11-only feature to request this.
Provide a first-class way to do this by naming features after the
corresponding language standard.  Record them as always available in the
corresponding standard level so that requesting them always ensures that
standard (or higher) is used.
2016-11-02 10:00:28 -04:00
Brad King
8b6cc2518a Features: Centralize per-compiler recording macros
Simplify and de-duplicate per-compiler feature recording macros and
convert to a centralized per-language macro.
2016-11-02 09:51:48 -04:00
Brad King
2d23f7b206 Features: Do not record features on MSVC < 2010
We have no feature tests for versions of VS older than 2010, so do
not even call `record_compiler_features` for such versions.  This
is consistent with other compilers where we call this macro only
for versions for which we have recorded features.
2016-11-02 09:42:18 -04:00
Brad King
5f7f0ab517 Merge branch 'FindHDF5-restore-default-C' into release 2016-11-02 09:07:53 -04:00
Brad King
ff3ccc1f23 FindHDF5: Restore pre-3.6 behavior of finding only C by default
Refactoring in commit v3.6.0-rc1~72^2 (HDF5: Rework component searching
to correctly find HL for all bindings, 2016-05-12) changed the default
behavior from finding only the C bindings to finding everything for the
enabled languages.  Restore the original behavior for compatibility and
because many projects need only the C bindings.

Closes: #16397
2016-11-02 09:06:56 -04:00
Brad King
b5ad094e3b Merge topic 'cpack-doc-typos'
4ab3b0c4 CPackRPM: Fix incorrect variable name in documentation
e6460e7d CPackDeb: Fix incorrect variable name in documentation
2016-11-02 08:54:23 -04:00
Brad King
2857ca89a2 Merge branch 'cpack-doc-typos' into release 2016-11-02 08:44:22 -04:00
Brad King
503766fa0e Merge branch 'fix-macos-sysroot' into release 2016-11-02 08:44:16 -04:00
Alex Turbov
4ab3b0c462 CPackRPM: Fix incorrect variable name in documentation
`CPACK_RPM_COMPONENT_INSTALL` is the correct variable to set to enable
component packaging.  `CPACK_RPM_PACKAGE_COMPONENT` is just set to a
component name when CPack calls corresponding installer.
2016-11-02 08:42:56 -04:00
Alex Turbov
e6460e7d40 CPackDeb: Fix incorrect variable name in documentation
`CPACK_DEB_COMPONENT_INSTALL` is the correct variable to set to enable
component packaging.  `CPACK_DEB_PACKAGE_COMPONENT` is just set to a
component name when CPack calls corresponding installer.
2016-11-02 08:42:44 -04:00
Brad King
6a65f0534b Merge topic 'fix-macos-sysroot'
93504190 Darwin: Remove deployment target version check
542d52f9 Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path"
2016-11-02 08:35:26 -04:00
Brad King
93f025118d Merge topic 'UseSWIG-SWIG_OUTFILE_DIR'
8444b984 UseSWIG: Add option to specify swig output file directory
2016-11-02 08:35:23 -04:00
Brad King
2fb83cc871 Merge topic 'CPackDeb-doc-typos'
c75b8910 CPackDeb: fix copy-n-paste typos in documentation
2016-11-01 10:58:37 -04:00
Alex Turbov
c75b8910a4 CPackDeb: fix copy-n-paste typos in documentation 2016-11-01 10:13:20 -04:00
Cong Zhang
8444b984a2 UseSWIG: Add option to specify swig output file directory
`swig` has two output-related options:

* `-o <outfile>`: Set name of C/C++ output file to <outfile>
* `-outdir <dir>`: Set language-specific files output directory to <dir>

We already have `CMAKE_SWIG_OUTDIR` for the latter.  Add a new
`SWIG_OUTFILE_DIR` option for the former.
2016-11-01 10:10:08 -04:00
Gregor Jasny
935041908d Darwin: Remove deployment target version check
Starting with Xcode 8 the SDK folder also contains an unversioned entry:

    MacOSX.sdk
    MacOSX10.12.sdk -> MacOSX.sdk

If this unversioned path is used CMake cannot detect the SDK version.

Furthermore, querying the SDK version via

    xcodebuild -sdk <sysroot> -version Path

gives bogus results for the Command Line Tools installed into `/`.

The OS X deployment target version and SDK version are not as tied as
they once were, so this check is now more trouble than it is worth.
Simply remove it.

Closes: #16323
2016-11-01 09:37:49 -04:00
Gregor Jasny
542d52f95e Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path"
Revert commit v3.7.0-rc1~48^2 (Xcode: Convert maybe unversioned OSX
sysroot into versioned SDK path, 2016-09-25).  The replacement of
`else()` with `if(CMAKE_OSX_SYSROOT)` defeats the prior handling of
`if("x${CMAKE_OSX_SYSROOT}" MATCHES "/")`. This causes the combination

    -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="" -DCMAKE_OSX_SYSROOT:STRING=/

to not be honored and `-isysroot` to be emitted as a compiler flag
universally.  We will need another solution to the problem the
now-reverted commit was meant to address.

Closes: #16394
2016-11-01 09:31:08 -04:00
Brad King
3573059536 Merge topic 'FindSDL-sound-fix'
f2ff9495 FindSDL_sound: Fix SDL_SOUND_LIBRARIES result value
2016-11-01 09:14:34 -04:00
Brad King
b8c5258b00 Merge topic 'FindMatlab-fix-typo'
f2de7079 FindMatlab: Fix typo in matlab_add_unit_test implementation
2016-11-01 09:14:31 -04:00
Brad King
fa4b2e7dc3 Merge topic 'FindMatlab-9.1'
e29f33cd FindMatlab: Add support for Matlab 2016b (9.1)
2016-11-01 09:14:28 -04:00
Brad King
77413bc5db Merge branch 'FindMatlab-fix-typo' into release 2016-10-28 15:20:30 -04:00
Matthew Woehlke
f2de70799c FindMatlab: Fix typo in matlab_add_unit_test implementation
Fix typo in variable used to communicate between matlab_add_unit_test
and its helper script MatlabTestsRedirect.cmake that was introduced in
commit v3.7.0-rc1~116^2 (FindMatlab: Extend matlab_add_unit_test to run
arbitrary test code, 2016-08-30).
2016-10-28 15:19:24 -04:00
Brad King
1e574618b2 Merge branch 'FindMatlab-9.1' into release 2016-10-28 10:42:23 -04:00
Francesco Romano
e29f33cd20 FindMatlab: Add support for Matlab 2016b (9.1) 2016-10-28 10:41:43 -04:00
Brad King
f2ff94958f FindSDL_sound: Fix SDL_SOUND_LIBRARIES result value
The value is meant to be a plain-variable ;-list.  Remove quotes and
caching.

Patch-by: Aleksey Chernov (virx on gitlab.kitware.com)
Closes: #16390
2016-10-28 08:15:16 -04:00
Brad King
369d580937 Features: Record features for Intel Compiler on Windows
Since this compiler always defines `__cplusplus` to `1` we need to use
`_MSC_VER`, `__INTEL_CXX11_MODE__`, and the feature test macro named
`__cpp_aggregate_nsdmi` to detect C++11 and C++14 modes.

With no `-Qstd=` flag this compiler defaults to C++98 plus a subset of
C++11/C++14 features needed to be compatible with MSVC.  We pretend it
is plain C++98 and add a `-Qstd=` flag whenever needed for C++11 or
above features even if they would happen to be available in MSVC-mode.

Closes: #16384
2016-10-27 13:33:10 -04:00
Brad King
a5a3642f92 Features: Port Intel CXX features to test macros where possible
The Intel 16 and 17 compilers define feature test macros of the form
`__cpp_<feature>`.  Use them where possible to detect corresponding
features.
2016-10-27 13:28:34 -04:00
Brad King
d34ac22fec Features: Unset Intel CXX feature temporaries 2016-10-27 13:28:34 -04:00
Brad King
967dcf36d0 Intel: Remove incorrect C++98 standard compiler flag on Windows
The change in commit 05e05cd2 (Intel: Fix compiler C++98 standard flag
on Windows, 2016-10-26) was wrong.  The Intel C++ Compiler for Windows
does not support either `-Qstd=c++98` or `-Qstd=gnu++98`.  Simply remove
both flags for this compiler and use no options at all to achieve this
mode.

Issue: #16384
2016-10-27 13:28:34 -04:00
Brad King
8f6fd091b8 Merge topic 'intel-compiler-windows-c++98'
05e05cd2 Intel: Fix compiler C++98 standard flag on Windows
2016-10-27 11:17:09 -04:00
Brad King
6613434376 Merge topic 'intel-17-features'
554b4f90 Features: Record features for Intel C++ 17 on UNIX
2016-10-27 11:17:05 -04:00
Brad King
05e05cd2aa Intel: Fix compiler C++98 standard flag on Windows
The Intel C++ Compiler for Windows does not support the `-Qstd=c++98`
flag but does support `-Qstd=gnu++98`.

Issue: #16384
2016-10-26 15:03:53 -04:00
Brad King
075cc0f28c Merge branch 'intel-17-features' into release 2016-10-26 09:22:13 -04:00
Brad King
554b4f9010 Features: Record features for Intel C++ 17 on UNIX
Issue: #16384
2016-10-26 09:18:38 -04:00
Brad King
61758bf4b9 Merge topic 'intel-compile-features-windows'
881585f9 Intel: Fix compiler extension flags on Windows
2016-10-25 09:09:01 -04:00
Brad King
644ff572f7 Merge topic 'android-pic'
4c272adb Android: Link position-independent executables with proper flags
6205f179 Android: Set CMAKE_POSITION_INDEPENDENT_CODE automatically
2016-10-25 09:08:55 -04:00
Brad King
de21e564ed Merge branch 'intel-compile-features-windows' into release 2016-10-24 14:36:46 -04:00
Brad King
881585f975 Intel: Fix compiler extension flags on Windows
The extension flags enabled by commit v3.6.0-rc1~120^2~1 (Features:
Record standard flags for Intel C/C++ on Windows, 2016-04-18) of the
form `-Qstd=gnu++11` are not supported by the Intel C/C++ Compiler for
Windows.  Fall back to using the non-extension form of the flags.

Issue: #16384
2016-10-24 14:29:40 -04:00
Brad King
4c272adbe1 Android: Link position-independent executables with proper flags
Add `-fPIE -pie` to the default executable link flags when
`CMAKE_POSITION_INDEPENDENT_CODE` is enabled.  This is required by
Android 16 and above for executables to run on the device.

Closes: #16382
2016-10-24 11:45:18 -04:00
Brad King
6205f1797e Android: Set CMAKE_POSITION_INDEPENDENT_CODE automatically
If the toolchain file or cache does not set this, enable it
automatically based on the Android API version.  Versions 16
and above expect position independent code.

Use the main `CMAKE_POSITION_INDEPENDENT_CODE` setting in favor of
hard-coding `-fpic` or `-fPIC` in the compiler flags for each ABI.
This allows CMake to use `-fpie` or `-fPIE` as needed when sources
are meant for executables, and `-fpic` or `-fPIC` for other sources.
2016-10-24 11:40:53 -04:00
Brad King
3d5ec790ee Merge topic 'android-link-exe'
295c8efa Android: Add missing link flags for device executables
2016-10-24 10:16:37 -04:00
Brad King
295c8efa35 Android: Add missing link flags for device executables
See `${ndk}/build/core/default-build-commands.mk` for link flags the NDK
uses for executables.  Add them to our default executable link flags.
Suppress `nocopyreloc` on `arm64-v8a` because it does not work with
some STL types.

Closes: #16380
2016-10-21 10:43:45 -04:00
Brad King
97670dbf2f Merge topic 'android-armeabi-c++_static'
43f4326e Android: Fix support for armeabi with c++_static
2016-10-21 08:59:07 -04:00
Brad King
43f4326ece Android: Fix support for armeabi with c++_static
Add missing "unwind" and "atomic" libraries needed for this combination.
See `${ndk}/sources/cxx-stl/llvm-libc++/libs/armeabi/libc++.a` for the
libraries the NDK uses.

Issue: #16380
2016-10-21 08:42:25 -04:00
Brad King
fc7ecd6b05 Merge topic 'external-project-clone-progress'
e89fbfaf ExternalProject: support GIT_PROGRESS argument
64aa29b7 ExternalProject: fix typo
2016-10-20 08:51:18 -04:00
Ben Boeckel
63d215dfa8 ExternalProject: support extracting the configure command
Previously, the configure command generated by ExternalProject was not
accessible prior to actually adding the targets. This makes the CMake
configure command accessible with just a call to _ep_parse_arguments.

Future work will leverage this to support custom environment settings on
a per-project basis.
2016-10-19 08:58:25 -04:00
Brad King
a08a48c2da Merge topic 'external-project-source-subdir-usage'
615f3ed2 ExternalProject: make SOURCE_SUBDIR directly appendable
fdce782b ExternalProject: error out only if the property is unset
2016-10-19 08:48:40 -04:00
Brad King
c61b6f7f37 Merge topic 'ExternalData-multiple-hashes'
33a9aaa8 ExternalData: Add support for multiple hash algorithms
2016-10-19 08:48:37 -04:00
Brad King
1745733809 Merge topic 'fix-Android-NsightTegra'
9af881d8 Tests: Add VSNsightTegra test for VS 2015
6739d240 Tests: Fix VSNsightTegra test on Android NDK r12b
06c39612 VS: Fix NVIDIA Nsight Tegra Visual Studio Edition support
2016-10-19 08:48:31 -04:00
Ben Boeckel
e89fbfaf66 ExternalProject: support GIT_PROGRESS argument 2016-10-18 17:41:02 -04:00