7707 Commits

Author SHA1 Message Date
Kris Thielemans
4150048a3b FindHDF5: unset some variables
prefixed some local variables with _hdf5 and unset them at the end
(still more of these to do)
2017-08-03 09:49:47 -04:00
Kris Thielemans
9310d00822 FindHDF5: for a static imported config, use CONFIG-specific library
first check the LOCATION_<CONFIG> propertiy to find the library, then
LOCATION
2017-08-03 09:49:47 -04:00
Kris Thielemans
fc9828448d FindHDF5: fix hdf5-config case with more than one configuration
Select a configuration as the first of the following available:

* MAP_IMPORTED_CONFIG_<CONFIG>
* ${CMAKE_BUILD_TYPE}, RELWITHDEBINFO, RELEASE, DEBUG
* First entry in IMPORTED_CONFIGURATIONS

Fixes: #17039
2017-08-03 09:48:19 -04:00
Brad King
9604190701 Merge topic 'FindLibXml2-standard-vars'
a1b38865 FindLibXml2: Switch to standard module variable names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1043
2017-07-17 10:24:54 -04:00
Vadim Zhukov
a1b3886556 FindLibXml2: Switch to standard module variable names
* LIBXML2_INCLUDE_DIR talks about libxml2 itself;
* LIBXML2_INCLUDE_DIRS lists also include directories coming from
  libxml2's dependencies and is what libxml2 users should use;
* LIBXML2_LIBRARY talks about libxml2 itself;
* LIBXML2_LIBRARIES is what libxml2 users should link to.

This commit doesn't break existing users of FindLibXml2.cmake,
but provides the way for correct behaviour in future. In particular,
on OpenBSD LIBXML2_INCLUDE_DIR resolves to /usr/local/include/libxml2,
while libiconv (an libxml2 dependency) puts iconv.h
in /usr/local/include, which is not picked up automatically.
2017-07-14 11:25:10 -04:00
Brad King
0f096b8d73 Merge topic 'cmp0054-asm-warning'
336c4fc6 CMakeDetermineASMCompiler: fix a CMP0054 warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1057
2017-07-14 08:24:31 -04:00
Brad King
688b1c11ec Merge topic 'ninja_cuda_export_compile_commands_support'
712af07e CUDA: CMAKE_EXPORT_COMPILE_COMMANDS now works with CUDA and Ninja

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1055
2017-07-14 08:23:58 -04:00
Brad King
652b2956c8 Merge topic 'CMakePushCheckState-fix-RESET'
fda50a08 CMakePushCheckState: Fix cmake_push_check_state RESET argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1040
2017-07-14 08:22:27 -04:00
Ben Boeckel
336c4fc6fa CMakeDetermineASMCompiler: fix a CMP0054 warning
This was introduced in commit d8e6cd9e (IAR: Improve support for IAR ARM
Compiler, 2017-06-15) from !991.

Fixes #17062.
2017-07-13 14:01:38 -04:00
Robert Maynard
712af07e47 CUDA: CMAKE_EXPORT_COMPILE_COMMANDS now works with CUDA and Ninja
Fixes: #17061
2017-07-13 11:23:16 -04:00
Brad King
489a7706c2 Merge topic 'android-system-include-last'
4bafa392 Android: Always add standard include directories last

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1052
2017-07-13 10:07:36 -04:00
Brad King
4bafa3922e Android: Always add standard include directories last
The logic added in commit v3.6.0-rc1~30^2 (Add a variable to specify
language-wide system include directories, 2016-05-24) to use
`CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` incorrectly filters them by
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`.  Rather than recognizing
this, commit v3.8.0-rc1~60^2 (Android: Pass sysroot include directory
explicitly, 2017-01-20) worked around the problem by incorrectly
removing `/usr/include` from `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`
so it worked in `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`.

By not filtering out `/usr/include` from user-specified include
directories, we allow the code

    include_directories(${CMAKE_SYSROOT}/usr/include)

to place the include directory too early on the command line.

Fix support for standard include directories to not be filtered by
implicit include directories, and do not remove `/usr/include` from the
list of implicit include directories for Android builds.  Add a test
case to verify that an explicit `/usr/include` is ignored in favor
of the standard directory at the end.

Fixes: #17059
2017-07-13 10:03:58 -04:00
Brad King
a4a39a46c3 Merge topic 'FindProtobuf-protoc-target'
c281acf8 FindProtobuf: add target for protoc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1045
2017-07-13 07:52:09 -04: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
Brad King
fda50a0843 CMakePushCheckState: Fix cmake_push_check_state RESET argument
This option was added by commit v2.8.12~138^2 (Add
cmake_reset_check_state() macro, 2013-07-28) but has never worked.
Fix the implementation to refer to macro arguments properly (not as
normal variables).

Fixes: #17048
2017-07-12 15:09:16 -04:00
André Apitzsch
c281acf807 FindProtobuf: add target for protoc 2017-07-12 13:48:22 -04:00
Brad King
e63472abc5 Merge topic 'android-fix-c++_shared'
e0fb3f31 Android: Link to android_support with c++_shared

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1048
2017-07-12 09:00:43 -04:00
Brad King
e8e38aea26 Merge branch 'android-fix-c++_shared' into release-3.9 2017-07-12 08:39:55 -04:00
Brad King
e0fb3f314f Android: Link to android_support with c++_shared
The NDK has done this in `build/core/definitions.mk` since r13
(r12 and below do so only for c++_static).
2017-07-12 08:39:42 -04:00
Brad King
79e72f4b7c Merge topic 'FindMFC-try-static'
6b2bf575 FindMFC: Check for static MFC variant

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1034
2017-07-11 07:39:15 -04:00
Brad King
8d5ec21928 Merge topic 'FindPkgConfig-rerun'
3cf267cf FindPkgConfig: do not always rerun pkg_check_modules() with 2 arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1036
2017-07-11 07:34:58 -04:00
Brad King
8f63f3495d Merge topic 'FindHDF5-windows'
6848ff4c FindHDF5: Define H5_BUILT_AS_DYNAMIC_LIB when using Windows DLLs
6f131f49 FindHDF5: Add support for HDF5_USE_STATIC_LIBRARIES on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1023
2017-07-11 07:34:23 -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
Rolf Eike Beer
3cf267cfbf FindPkgConfig: do not always rerun pkg_check_modules() with 2 arguments
Since commit v3.8.0-rc1~47^2 (FindPkgConfig: Recheck pkg-config on
parameter change, 2017-01-17) calling `pkg_check_modules` always
re-runs.  The problem is that if there are only 2 arguments passed to
`pkg_check_modules```, then `_module0` will be set and `ARGN` will be
empty.  When this is written to cache it will be stored as just the
value of `_module0` without any semicolon, so on the next run this
doesn't match the expected value and the search is rerun.

Revise the logic to handle the case of empty `ARGN` separately.

Fixes: #17003
2017-07-10 11:16:51 -04:00
Kris Thielemans
6848ff4ce5 FindHDF5: Define H5_BUILT_AS_DYNAMIC_LIB when using Windows DLLs
When searching for shared libraries on Windows, add
H5_BUILT_AS_DYNAMIC_LIB to HDF5_DEFINITIONS so that the header file
knows how to dllimport the symbols.
2017-07-07 08:58:57 -04:00
Kris Thielemans
6f131f49ee FindHDF5: Add support for HDF5_USE_STATIC_LIBRARIES on Windows
Also add the `_D` suffix for debug libraries.
2017-07-07 08:58:37 -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
Brad King
a951eb2cb4 Merge topic 'FindDoxygen-create-output-dir'
796b8fcb FindDoxygen: Create DOXYGEN_OUTPUT_DIRECTORY if it doesn't exist

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !1019
2017-07-07 08:41:04 -04:00
Rich Chiodo
6b2bf5756b FindMFC: Check for static MFC variant
Some CMake applications can set /MT without setting CMAKE_MFC_FLAG.
This change lets FindMFC work in those situations.
2017-07-06 11:28:20 -04:00
Robert Dailey
796b8fcb14 FindDoxygen: Create DOXYGEN_OUTPUT_DIRECTORY if it doesn't exist
If the doxygen output directory does not exist, create it prior to
running the doxygen commands.
2017-07-06 10:00:28 -05:00
Brad King
bcca01d8ad Merge topic 'FindDoxygen-project-in-subdir'
97a9a356 FindDoxygen: Use a stable reference to the location of global resources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1014
2017-06-30 10:17:29 -04:00
Robert Dailey
97a9a35607 FindDoxygen: Use a stable reference to the location of global resources
FindDoxygen generates some files based on the version of Doxygen whose
content will not vary across a project and are therefore a global
resource that can be shared by all calls to `find_package(Doxygen)` and
to `doxygen_add_docs`.  We currently use `${PROJECT_BINARY_DIR}` to
reference their location, but this is not stable because `project()`
calls in a subdirectory can change it.  Use `${CMAKE_BINARY_DIR}`
instead.

Reviewed-by: Craig Scott <craig.scott@crascit.com>
Fixes: #17022
2017-06-29 13:39:26 -05: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
Norbert Lange
fea7d69dde Store CMAKE_ASM_COMPILER_VERSION persistently
We already do this for other languages like C and CXX.
2017-06-29 13:25:57 -04:00
Norbert Lange
d2a8b5cea6 CMakeDetermineASMCompiler: Fix small copy-paste mistake
GNU is not a vendor of IAR.
2017-06-29 13:25:57 -04:00
Brad King
55465be840 Merge topic '16961-xctest-scheme'
fe34a5c8 Xcode: Add XCTest support to schema generator
690cf2c1 Xcode: Prepare schema generator for XCTest
ff3498e7 XCTest: Speed up test by only enabling C language
610d2fce XCTest: Use bundle specific generator expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1013
2017-06-29 09:50:29 -04:00
Brad King
1ac89a4e06 Merge topic 'deb-on-windows'
52991413 CPackDeb: Enable the DEB generator on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !979
2017-06-29 09:49:29 -04:00
Gregor Jasny
610d2fcec0 XCTest: Use bundle specific generator expressions 2017-06-28 21:59:48 +02:00
Nils Gladitz
5299141320 CPackDeb: Enable the DEB generator on Windows
While some features require external Unix tools the
generator is mostly portable.

By enabling it on Windows it can be used for cross platform
packaging.
2017-06-28 19:55:12 +02:00
Brad King
e40e8f5c42 Merge topic 'clang-cl-no-std'
c67bb5ba Clang: Do not add '-std=' options when simulating MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !982
2017-06-28 08:55:12 -04:00
Brad King
a5ce7df589 Merge topic 'docs_CheckXXXSourceYYY'
63fc3bff Check*Source{Compiles,Runs}: Rewrite docs for these modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1005
2017-06-28 08:40:37 -04:00
Ruben Van Boxem
c67bb5bae3 Clang: Do not add '-std=' options when simulating MSVC
The `cl.exe` style command line does not accept the `-std=` options.
Instead behave like MSVC where we don't define standard levels.

Fixes: #16266
2017-06-27 13:04:41 -04:00
Brad King
f7cc2cc2b6 Merge topic 'FindDoxygen-internal-var'
d194bd91 FindDoxygen: Add private prefix to internal variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1012
2017-06-27 10:54:25 -04:00
Brad King
7f1fd07b19 Merge branch 'FindDoxygen-internal-var' into release-3.9 2017-06-27 10:48:30 -04:00
Brad King
d194bd915b FindDoxygen: Add private prefix to internal variables
Since commit v3.9.0-rc1~55^2 (Improve Doxygen support, 2017-04-10) we
accidentally leave a non-prefixed internal `result` variable set.
This may interfere with project code.  Add a prefix to avoid this.
2017-06-27 10:45:45 -04:00
Brad King
4fd6507a52 Merge topic 'FindCUDA-no-empty-genex'
a3e442bb FindCUDA: Fix CUDA_NVCC_FLAGS_<CONFIG> for separable compilation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1008
2017-06-27 09:21:15 -04:00
Robert Maynard
a3e442bbfc FindCUDA: Fix CUDA_NVCC_FLAGS_<CONFIG> for separable compilation
Since commit v3.0.0-rc6~3^2 (FindCUDA: Use CUDA_NVCC_FLAGS* for
separable compilation, 2014-05-18), using the feature for one
configuration results in empty-string ("") arguments on the command line
for other configurations.  This is because the generator expression for
a non-matching configuration evaluates to an empty string but does not
remove the argument.  Use `COMMAND_EXPAND_LISTS` to remove the empty
arguments from the custom command after genex evaluation.

Fixes: #16411
2017-06-26 14:59:05 -04:00
Maxime Roussin-Bélanger
46d25e782e FindCUDA: Use find_program if find_host_program is not available
CMake does not define the `find_host_program` command we've been using
in the cross-compiling code path.  It was provided by a widely used
Android toolchain file.  For compatibility, continue to use
`find_host_program` if available, but otherwise use just `find_program`.

Fixes: #16509
2017-06-26 13:10:54 -04:00
Brad King
a52ecd983f Merge topic 'toolchain-binutils-advanced'
04b2fc08 GCC,Clang: Mark CMAKE_<LANG>_COMPILER_{AR,RANLIB} as advanced

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1001
2017-06-26 10:42:36 -04:00