Commit Graph

8045 Commits

Author SHA1 Message Date
Brad King
3bc21a70b5 MSVC: Fix MSVC_VERSION when mixing MSVC C/C++ with Intel Fortran
When using a real MSVC compiler for `C` or `CXX`, use the version of
that compiler for `MSVC_VERSION`.  This is preferred over the MSVC
version that a non-MSVC compiler "simulates".

Fixes: #17468
2017-11-15 14:58:44 -05:00
Brad King
ac38bb3aa6 Merge topic 'swig-broken-dependency-scan'
2ee10119 swig: fix incremental build in case of removed interface files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1457
2017-11-13 09:53:51 -05:00
Brad King
fd93616b74 Merge topic 'doxygen_dot'
9cab8570 FindDoxygen: Fix setting of HAVE_DOT in non-backward-compat mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1472
2017-11-10 10:30:16 -05:00
André Apitzsch
9cab8570fa FindDoxygen: Fix setting of HAVE_DOT in non-backward-compat mode
`DOXYGEN_DOT_FOUND` is only set if `_Doxygen_keep_backward_compat` is
used (when no components are requested), so use `Doxygen_dot_FOUND`
directly.  Preserve the "YES" or "NO" value used previously.
2017-11-10 08:49:37 -05:00
Craig Scott
0d7086e3da Merge topic 'fetchcontent-support-use-before-project-command'
b551beb6 FetchContent: Support use of the module before "project()" command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1448
2017-11-10 00:24:50 -05:00
Brad King
c167a9b18c Merge topic 'FindOpenGL-no-glvnd-for-GL'
e6b209c8 FindOpenGL: Default to non-GLVND libraries for legacy GL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1466
2017-11-09 13:17:41 -05:00
Brad King
e6b209c870 FindOpenGL: Default to non-GLVND libraries for legacy GL
Projects using `OPENGL_LIBRARIES` or `OpenGL::GL` expect legacy GL.
Although GLVND OpenGL+GLX provides legacy GL interfaces, using those
library files may conflict with legacy GL library files used by
dependencies (or dependents) of such projects.  Therefore we should
not yet use OpenGL+GLX when a legacy GL library is available.

If `OPENGL_gl_LIBRARY` is set then use it as the legacy GL library.
If it is *not* set then fall back to using GLVND OpenGL+GLX to provide
legacy GL interfaces.  This will allow users to build projects using
GLVND even if they have not been ported.

Fixes: #17437
2017-11-09 09:47:12 -05:00
Brad King
a16930167d Merge topic 'FindHDF5-c-version'
a6abb6c8 FindHDF5: Fix H5_VERSION on Patch in C

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1465
2017-11-09 08:30:19 -05:00
Brad King
05d8892e61 Merge topic 'cmake-default-dir-install-permissions'
7e896029 CPack: enable setting default dir creation permissions
a4c82916 CPack test: expand output checking fallback
670ad047 Move file/dir permissions code to common file.
deeba85f CMake: enable setting default dir creation permissions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1433
2017-11-09 08:28:28 -05:00
Brad King
0682e77f3b Merge topic 'fortran-flags-docstring'
27b62fa4 Fortran: Use same DOC for flags as other languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1463
2017-11-09 08:15:09 -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
Axel Huebl
a6abb6c8b6 FindHDF5: Fix H5_VERSION on Patch in C
Fix a typo from commit v3.6.0-rc1~85^2 (HDF5: Refactor the use of
compiler wrappers, 2016-04-04) that accidentally used the HDF5 C++
version (which could be empty) while detecting the C patch version.
The detection failed for patch releases, such as `1.10.0-patch1`
becoming `.1` instead of `1.10.0.1`.
2017-11-08 09:35:45 -05:00
Felix Schwitzer
2ee10119ea swig: fix incremental build in case of removed interface files
Commit v3.8.0-rc1~123^2 (UseSWIG: Automatically scan dependencies of SWIG files
for Makefiles, 2016-12-21) introduced automatic dependency scanning for files
`%include`d in a swig interface definition file. This works fine as long as no
such file is removed. But removing a dependent file breaks an incremental build
and `make` complains about a missing dependency, see #16830.

Integrate the approach proposed in the issue above into the SWIG-module, do the
workaround in a conditional step as it arises only for Makefile generators. For
other generators use the implementation before that commit.

Fixes: #17433.
2017-11-08 15:25:20 +01:00
Brad King
f8f3338582 Merge topic 'flang-windows'
3c368228 Flang: Add support for compiling sources on Windows
72d27964 Flang: Identify as simulating MSVC on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1430
2017-11-08 09:05:13 -05:00
Brad King
77b73ff134 Merge topic 'irsl-win2018'
f6994f43 IRSL: Add support for the 2018 release on Windows.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1451
2017-11-08 08:59:52 -05:00
Brad King
7bd4c1c1bb Merge topic 'FindOpenGL-clarify-libraries'
f44fb2dd FindOpenGL: Clarify logic constructing OPENGL_LIBRARIES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1459
2017-11-08 08:52:01 -05:00
Christian Pfeiffer
27b62fa4c5 Fortran: Use same DOC for flags as other languages
Currently, only Fortran uses the string "Flags for Fortran compiler",
whereas C, CXX, CUDA all use the same, more descriptive string.
2017-11-08 14:50:58 +01:00
Brad King
bd68d0c252 Merge topic 'implicit-lib-gcceh'
41aacca7 Restore exclusion of "gcc_eh" from implicit link libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1460
2017-11-08 08:25:16 -05:00
Christian Pfeiffer
41aacca7fb Restore exclusion of "gcc_eh" from implicit link libraries
Since commit v3.9.0-rc1~148^2 (Do not assume GCC libs are linked by all
compilers, 2017-05-05) we no longer filter out all `gcc*` implicit link
libraries.  This allows mixing of gcc and non-gcc compilers across
languages.  However, this caused a subtle problem with how GCC makes
exception handling symbols available to linked binaries.

GCC (at least on MinGW) provides two different libraries with exception
handling symbols:

* gcc_s: A shared library with -fvisibility=default, used by -shared-libgcc.
* gcc_eh: A static library with -fvisibility=hidden, used by -static-libgcc.

The C compiler (on MinGW) defaults to -static-libgcc and uses gcc_eh.
The C++ compiler defaults to -shared-libgcc and uses gcc_s when linking
shared libraries and executables so that exceptions can propagate across
shared libraries [1].  When linking a mixed-language binary, the C++
compiler should be used along with its choice of gcc_s.  In this case
gcc_eh should not be added even though the C compiler implies it because
gcc_s supersedes it.

Since the above-mentioned change, CMake is adding gcc_eh to C++ link
lines that also contain C code on MinGW.  This causes both gcc_s and
gcc_eh to be used, which is incorrect.  We can fix this simply by
excluding gcc_eh from the C compiler's implicit link libraries.

[1] https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Link-Options.html#Link-Options

Fixes: #17436
2017-11-08 08:10:52 -05:00
Jean-Christophe Fillion-Robin
b551beb6fa FetchContent: Support use of the module before "project()" command
Co-authored-by: Craig Scott <craig.scott@crascit.com>
Co-authored-by: Brad King <brad.king@kitware.com>
2017-11-07 09:50:02 -05:00
Brad King
f44fb2dd4c FindOpenGL: Clarify logic constructing OPENGL_LIBRARIES
Our comment says the logic matches that for OpenGL::GL.  Structure
the logic the same way to make this clearer.

Issue: #17437
2017-11-07 09:33:43 -05:00
Brad King
a7347c022e Merge topic 'csharp-version-english'
04937db1 CSharp: Fix compiler version detection in non-English languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1449
2017-11-07 08:31:09 -05:00
Yoshinori Tahara
04937db103 CSharp: Fix compiler version detection in non-English languages
When we run `csc.exe /help` we look for "Version" in the output.
Explicitly ask for the output in English.

Reported-by: guttally@users.noreply.github.com
2017-11-07 08:23:16 -05:00
Brad King
b5d8610430 Merge topic 'findboost-compiler-version'
d70bdc72 FindBoost: support more than one number in version components
335816ef FindBoost: use CMake's compiler version rather than querying again

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1441
2017-11-07 08:21:23 -05:00
Christian Pfeiffer
f6994f436c IRSL: Add support for the 2018 release on Windows.
Fixes: #17421
2017-11-06 14:10:45 -05:00
Ben Boeckel
d70bdc72ce FindBoost: support more than one number in version components 2017-11-06 13:26:23 -05:00
Brad King
b104bcfd98 Merge topic 'typos'
777e87ae Fix trivial typos in text

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1442
2017-11-06 09:02:23 -05:00
Ben Boeckel
335816efad FindBoost: use CMake's compiler version rather than querying again 2017-11-03 11:43:22 -04: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
Mark Salisbury
f61052ad39 FindBZip2: Normalize slashes when legacy BZIP2_LIBRARIES is specified
On Windows if you specify the library path using a regular Windows
path with backslashes, FindBZip2 announces that it found the library,
but the value is reported with backslashes instead of forward slashes.
This breaks assumptions elsewhere in CMake.  Convert slashes explicitly.
2017-11-01 17:21:18 -06:00
Brad King
93cd333103 Merge topic 'mingw-clang-c-compile-features'
f86879a0 Record C compile features flags for MinGW Clang on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1435
2017-11-01 07:40:35 -04:00
Brad King
8d1341f4ff Merge branch 'mingw-clang-c-compile-features' into release-3.10
Merge-request: !1435
2017-11-01 07:39:02 -04:00
Brad King
f86879a04c Record C compile features flags for MinGW Clang on Windows
This was done for C++ by commit v3.5.0-rc1~69^2 (Record compile features
for MinGW Clang on Windows, 2016-01-11).  Make the same change for C.
The `UNIX` condition on Clang C compiler features was already dropped by
refactoring in commit v3.9.0-rc1~17^2~4 (Compilers: Port to use default
cmake_record_lang_compile_features macros, 2017-05-10).

Our documentation already claims support for this combination.  This
was simply an oversight when support was added for MinGW Clang C++.

Issue: #15897
Issue: #15943
2017-11-01 07:28:38 -04:00
Isuru Fernando
3c3682289d Flang: Add support for compiling sources on Windows
Define `CMAKE_Fortran_COMPILE_OBJECT` for Flang on Windows.
2017-10-31 08:48:15 -04:00
Isuru Fernando
72d27964b9 Flang: Identify as simulating MSVC on Windows
In `CMakeFortranCompilerId.F.in`, take the `_MSC_VER` out of the
Intel-specific block so it will trigger for other compilers like Flang.
In `Compiler/Clang.cmake`, switch off Fortran too.
2017-10-31 08:47:06 -04:00
Brad King
ccf1155977 Merge topic 'freetype-windows'
3d42c3ed FindFreetype: Normalize slashes when legacy FREETYPE_LIBRARY is specified

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1416
2017-10-30 08:59:00 -04:00
Domen Vrankar
5784ab8fca CPack/Deb: handle shlibs file generation when SOVERSION set to 0
Setting CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS did not
auto generate shlibs control file when .so version
of the library was set to 0.

Fixes #17318
2017-10-29 00:20:54 +02:00
Mark Salisbury
3d42c3eda2 FindFreetype: Normalize slashes when legacy FREETYPE_LIBRARY is specified
On Windows if you specify the library path using a regular Windows
path with backslashes, FindFreetype announces that it found the library,
but the value is reported with backslashes instead of forward slashes.
This breaks assumptions elsewhere in CMake.  Convert slashes explicitly
since we have no `find_library` call for `FREETYPE_LIBRARY`.
2017-10-27 10:52:14 -04:00
Brad King
dfaf84ca73 Merge topic 'findICU_update'
20696a53 FindICU: Add support for static libraries on Windows
606ece67 FindICU: Search in 'sbin' directories for icu tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1396
2017-10-27 09:44:34 -04:00
Brad King
0278ec84d8 Merge topic 'clang-cl-TP'
7077a554 Clang: Use -TP flag for C++ sources with clang-cl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1407
2017-10-26 08:56:37 -04:00
Francois Budin
20696a53e4 FindICU: Add support for static libraries on Windows
When compiling ICU statically on Windows with Visual Studio, the library
file names are prefixed with 's' [1].

[1] http://source.icu-project.org/repos/icu/trunk/icu4c/source/icudefs.mk.in
    `STATIC_PREFIX_WHEN_USED = s`
2017-10-25 16:21:48 -04:00
Francois Budin
606ece67ef FindICU: Search in 'sbin' directories for icu tools
On Ubuntu, several binaries that FindICU.cmake searches for are installed
in 'sbin' instead of 'bin' [1].

[1] https://packages.ubuntu.com/xenial/amd64/icu-devtools/filelist
2017-10-25 16:20:19 -04:00
Brad King
7470561278 Merge topic 'flang-windows'
b2c6c357 Flang: Add partial support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1404
2017-10-25 08:15:43 -04:00
Brad King
fe4d6f1fd6 Merge topic 'omp-oacc-werror-return-type'
15da0ba3 Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1406
2017-10-25 08:12:30 -04:00
Brad King
b0207cec32 Merge topic 'findmpi-core-count'
1610f757 FindMPI: Use physical cores for MPIEXEC_MAX_NUMPROCS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1405
2017-10-25 08:12:07 -04:00
Brad King
a720131006 Merge branch 'clang-cl-TP' into release-3.10
Merge-request: !1407
2017-10-25 07:39:12 -04:00
Brad King
7077a554f1 Clang: Use -TP flag for C++ sources with clang-cl
We do this for `cl`, so we should do it for `clang-cl`.

Fixes: #17394
2017-10-25 07:36:10 -04:00
Isuru Fernando
b2c6c3574e Flang: Add partial support on Windows
Add minimal changes needed to help Flang itself build on Windows using
CMake.  Additional work will be required for full support.

Issue: #17384
2017-10-24 11:27:08 -04:00
Brad King
b305e81b3e Merge branch 'omp-oacc-werror-return-type' into release-3.10
Merge-request: !1406
2017-10-24 10:56:36 -04:00
Christian Pfeiffer
15da0ba3a2 Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type
Explicitly return a value from `main` in our test sources.

Fixes: #17391
2017-10-24 10:55:06 -04:00