Commit Graph

449 Commits

Author SHA1 Message Date
Brad King
ac24f4d49b Configure CMake itself with policies through CMake 3.23 2022-06-14 15:05:09 -04:00
Brad King
14eb8a6ab9 libarchive: Simplify hard-coded options for build within CMake
Take advantage of policy CMP0077 NEW behavior to hard-code settings,
defined by `option()` calls in upstream libarchive, without adding
them to our cache.
2022-02-22 17:51:18 -05:00
Brad King
d6b811fb82 Require CMake 3.13+ to configure CMake itself
In particular, guarantee that policy `CMP0077` has `NEW` behavior.
This will be useful to hard-code options of third-party libraries
without polluting our own cache.
2022-02-22 17:50:06 -05:00
Brad King
be9ebc104a libarchive: Simplify code selecting CMake-specific build options
Reduce differences from upstream libarchive `CMakeLists.txt` code.
Remove modifications inside code we disable anyway.
2022-02-17 07:28:09 -05:00
Brad King
9a48012f93 Configure CMake itself with policies through CMake 3.22 2022-02-03 14:13:12 -05:00
Peter Würth
c050d6a01e string(TIMESTAMP): add %f specifier for microseconds
The %f specified extends the string(TIMESTAMP) and file(TIMESTAMP)
commands to output the timestamp with a microsecond resolution.
This convention is offered by python's datetime module.
Before, the precision was limited to seconds.

The implementation is done by extending existing cmTimestamp methods
with a `microseconds` parameter. This parameter is optional in order to
be backwards compatible. The timestamps are now received in a
cross-platform manner using libuv, since the standard C functions like
time() don't allow for sub-second precision.

This requires libuv 1.28 or higher.  We already require higher than
that on Windows, so update the required version for other platforms.

Implements: #19335
2022-01-28 06:23:57 -05:00
Duncan Ogilvie
9278c6e01a ccmake: Add Windows support using PDCurses 2022-01-18 16:35:39 -05:00
Brad King
bf11dab49d ccmake: Refactor BUILD_CursesDialog option logic
Move all the current logic behind `if(UNIX)` conditions to make room
for other platforms to be added.
2022-01-18 16:34:43 -05:00
makise-homura
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC,
there should be a way for old projects to still identify it as GNU,
as it was before.
This commits adds the policy:
CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU.
This policy controls such a behavior.
OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
2021-10-21 17:24:22 +03:00
Brad King
d723bac01c Merge topic 'lcc-compiler'
02b2607a5c Help: Add release note for MCST LCC compiler support
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
2b9ef77944 CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecture
0995c75301 Tests/RPM: skip tests tat rely on debugedit if it's not found
ea55ac9a51 Tests/RunCMake/CommandLine: Deal with locales that are different from English

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6608
2021-10-19 09:22:22 -04:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03:00
Brad King
40ade51cc8 Configure CMake itself with policies through CMake 3.21 2021-10-08 12:17:04 -04:00
Brad King
00199e96ef Merge topic 'disable-exec-info'
aa4c30182b Add option to explicitly avoid using execinfo for backtraces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6386
2021-07-27 09:10:31 -04:00
Đoàn Trần Công Danh
aa4c30182b Add option to explicitly avoid using execinfo for backtraces
backtrace(3) from libexecinfo in musl will run into crash [1].

Provide an option to disable it explicitly even if libexecinfo is
present.

1: https://www.openwall.com/lists/musl/2021/07/17/1
2021-07-26 12:14:02 -04:00
Brad King
2c209097b9 Configure CMake itself with policies through CMake 3.20 2021-06-30 10:13:56 -04:00
Alex Richardson
88e56c2e5a Enable compiler warnings when compiling CMake with Clang
I noticed that I wasn't getting any compiler warnings when testing my
merge requests locally. Turns out this happens because I am compiling
using Clang rather than GCC, so no warning flags are added to the build.
d06a9bdf3a enabled warnings by default
for GCC > 4.2, but Clang supports them too. This has been the case
since at least Clang 3.0 (I couldn't test any older versions on
godbolt.org). For AppleClang, we can also assume that the warning flags
are supported. According to Wikipedia Clang became the default
compiler starting with Xcode 4.2, and the table on
https://trac.macports.org/wiki/XcodeVersionInfo, states that XCode
4.2 Clang was based on upstream Clang 3.0, which supports all the
warning flags.

The warning flags are currently not added when compiling with clang-cl
since this exposes some pre-existing warnings that need to be fixed first.
2021-06-22 16:17:58 +01:00
Brad King
d7522b8f86 cmSystemTools: Improve CreateLink and CreateSymlink error codes
In commit 7f89053953 (cmSystemTools: Return KWSys Status from CreateLink
and CreateSymlink, 2021-04-15) we just took the `-err` from libuv and
treated it as a POSIX error.  This is accurate on POSIX, but on Windows
does not match the POSIX error codes.

Use `uv_fs_get_system_error` to get the actual system error code.
This requires libuv 1.38 or higher.  Require that for Windows, but
fall back to the previous approach on POSIX.
2021-05-07 08:30:52 -04:00
Nils Gladitz
5380d858ff liblzma: Enable multi threaded stream encoding support 2021-04-22 15:40:06 -04:00
Brad King
e517c1beb6 Configure CMake itself with policies through CMake 3.19 2021-02-10 09:26:29 -05:00
Brad King
a0e474aaf2 Configure CMake itself with policies through CMake 3.18 2020-10-13 14:42:08 -04:00
Marc Chevrier
e5798126fc STL Support: introduce dedicated configuration file 2020-07-09 15:24:43 +02:00
Brad King
92c4316d81 KWSys: Hard-code try_compile results on Windows
Several of KWSys's checks have the same result on all Windows
platforms supported when building CMake.
2020-06-03 07:55:16 -04:00
Brad King
2bc89f1a03 cmSystemTools: Hard-code try_compile results for Windows
All Windows platforms offer `environ` in `stdlib.h` and do
not have `unsetenv`.
2020-06-03 07:48:52 -04:00
Brad King
d350d4668a libarchive: Hard-code try_compile results for bundled dependencies 2020-06-03 07:48:52 -04:00
Brad King
bc681fc372 Hard-code some try_compile results for third-party libraries
Our bundled third-party libraries perform many `try_compile` checks for
compatibility with their upstream build systems.  For many of the checks
we already know the result for compilers we support for building CMake
itself, especially on Windows.  Hard-code known results to avoid running
the checks.
2020-05-27 14:09:20 -04:00
Brad King
eb705b9531 Update links to gitlab.kitware.com repos to add -/
GitLab now uses a `/-/` component between the `group/project` part of
the URL and the `{issues,merge_requests,tree}` part so that it can
support `group/subgroup/project` with arbitrary depth.
2020-05-26 11:38:01 -04:00
Brad King
b47b30365e Merge topic 'xl-cpp-install'
f7a94cf282 XL: Install our Fortran 'cpp' helper script with execute permission

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4735
2020-05-12 06:51:32 -04:00
Brad King
f7a94cf282 XL: Install our Fortran 'cpp' helper script with execute permission
This script was added by commit 19f267c75e (XL: Add support for Ninja
and XL Fortran, 2019-11-21, v3.17.0-rc1~368^2) but does not have a `.sh`
extension so our existing install rules neglect to give it execute
permission.  Our test suite works on XL Fortran in the build tree but
the script is broken without execute permission on installation.

Fixes: #20695
2020-05-11 12:13:25 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Brad King
0b872fd4be nghttp2: Build the library within CMake for use by our curl
Provide our own minimal `config.h` since the upstream one is much
larger to support other parts of its distribution.  Compile with
warnings disabled since this is third-party code.
2020-04-03 06:43:00 -04:00
Brad King
76f08a107b Merge topic 'aix-ExportImportList-install' into release-3.17
39e5a4da22 AIX: Install ExportImportList script with execute permission

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4545
2020-03-31 09:17:53 -04:00
Brad King
20819b1cdb Merge topic 'aix-ExportImportList-install'
39e5a4da22 AIX: Install ExportImportList script with execute permission

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4545
2020-03-31 09:17:53 -04:00
Brad King
39e5a4da22 AIX: Install ExportImportList script with execute permission
This script was added by commit 0f150b69d3 (AIX: Explicitly compute
shared object exports for both XL and GNU, 2019-07-11,
v3.16.0-rc1~418^2~2) but does not have a `.sh` extension so our existing
install rules neglect to give it execute permission.  Our test suite
works on AIX in the build tree but the script is broken without execute
permission on installation.

Fixes: #20520
2020-03-30 11:43:08 -04:00
Brad King
b7d43ea0da Merge topic 'cmstd-IBM-i' into release-3.17
917db8163d cmstd: Remove -isystem option for IBM i (OS400)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4430
2020-03-06 09:24:45 -05:00
Brad King
21bbc56fb5 Merge topic 'cmstd-IBM-i'
917db8163d cmstd: Remove -isystem option for IBM i (OS400)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4430
2020-03-06 09:24:45 -05:00
ThePrez
917db8163d cmstd: Remove -isystem option for IBM i (OS400)
Much like AIX, IBM i (OS identifier "OS400") implicitly adds `extern
"C"` around system header files included with the `-isystem` option.
Update the condition added by commit c688b401d3 (cmstd: Modernize CMake
system headers, 2019-08-04, v3.16.0-rc1~81^2~1) to treat `IBM i` as we
do AIX.
2020-03-05 15:07:46 -05:00
Brad King
b83d96f164 libarchive: Update to build within CMake
Hard-code more libarchive options as internal cache entries.  Doing so
makes some of our `IF(0)` conditions unnecessary, so remove those.
2020-02-13 12:59:29 -05:00
Brad King
15c573df41 Merge topic 'mark_as_advanced-without-cache'
3ec82b713e cmMarkAsAdvancedCommand: ignore variables which don't exist in the cache
701a5c60e0 cmake: avoid marking local or unused variables as advanced
af158149e7 FindOpenSSL: do not mark a local variable as advanced
74f659f1f2 FindCurses: only mark CURSES_EXTRA_LIBRARY when it is used
7e2ae4e96d FindOpenGL: only mark declared cache variables as advanced
7cc02a0c29 FindLua: only mark LUA_MATH_LIBRARY as advanced if required
85cd26b8a6 FindBoost: only mark Boost_DIR as advanced if defined
338c7916ba CTest: avoid marking undeclared cache variables as advanced
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4150
2020-01-22 09:50:49 -05:00
Ben Boeckel
701a5c60e0 cmake: avoid marking local or unused variables as advanced 2020-01-20 15:49:29 -05:00
Brad King
d92bf9e84f Enable RPATH for CMake's own binaries by default
Reconcile the changes made by:

* commit ae62f66033 (ENH: CMake does not need RPATHs at all for its own executables, 2006-03-01, v2.4.0~380)
* commit a056cffc5b (COMP: enable RPATH if any of the CMAKE_USE_SYSTEM_XXX variables is enabled, 2007-08-28, v2.6.0~1183)
* commit c0108d1e07 (COMP: use RPATH is building QtDialog and the Qt libs are not in /lib or /usr/lib, 2007-11-05, v2.6.0~915)

The overall goal of those changes was to get the RPATH set for external
libraries when needed and also to avoid re-linking or other RPATH
editing on installation.  We can use a simpler approach to satisfy both
goals: always use RPATH entries for libraries found externally.  If
there are no such libraries we will get no RPATH.  If there are such
libraries that are not in standard paths we will get a RPATH that points
at them.  This will work for running either from the build tree or the
install tree, so we can use the same for both to avoid editing on
installation.

Fixes: #20185
2020-01-14 12:03:06 -05:00
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones.  For example:

    #include <cm/string_view>

can be used safely for CMake development in place of the `<string_view>`
standard header.

Fixes: #19491
2019-09-20 10:01:37 -04:00
Brad King
4929453504 Merge topic 'docker-rel-linux'
689fdbfc61 Utilities/Release: Drop linux64 script in favor of docker build
2d7cfd30ac Utilities/Release: Drop source archive generation in scripts
facc240a45 Utilities/Release: Add docker specs to build and test Linux binaries
bf832ccf01 Utilities/Release: Add README.rst describing directory content
ab153f17bf Utilities/Release: Drop machine-specific README
ed294c1664 Add option to skip CMake tests that need network access
4b8a864d52 Add option to test CMake itself against its hosting CMake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gregor Jasny <gjasny@googlemail.com>
Merge-request: !3727
2019-08-29 09:32:13 -04:00
Brad King
8a8b2fa695 Merge topic 'libarchive-requirement'
752fa8be9d libarchive: We now require at least version 3.3.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3737
2019-08-27 10:17:20 -04:00
Marvin Schmidt
752fa8be9d libarchive: We now require at least version 3.3.3
It's the first version including Zstandard support.
2019-08-26 09:47:24 -04:00
Brad King
ed294c1664 Add option to skip CMake tests that need network access 2019-08-23 11:12:07 -04:00
Brad King
4b8a864d52 Add option to test CMake itself against its hosting CMake 2019-08-23 11:12:07 -04:00
Brad King
ed54d87789 Configure CMake itself with policies through CMake 3.15
In particular, set `CMP0091` to `NEW` to enable the MSVC runtime library
abstraction so it can be set via `CMAKE_MSVC_RUNTIME_LIBRARY` in the
cache.
2019-08-23 10:55:58 -04:00
Brad King
d56a4b16ca Help: Restore installation of top-level index
We removed installation of `Help/index.rst` in commit d2fde94809 (Help:
Add infrastructure for guide-level documentation, 2019-05-30), but the
file is required for `--help-full` to work.  Restore installation of the
file and update it to avoid referencing the `Help/guide` directory in
its toctree during processing by `cmRST`.
2019-08-19 11:41:32 -04:00
Brad King
ecdf38aa36 CMakeVersion: Move computation logic to main script 2019-07-29 11:25:43 -04:00
Kyle Edwards
dd3e476786 OpenSSL: Issue an error if OpenSSL is not found
When building with the built-in Curl, CMAKE_USE_OPENSSL is only set
to ON by default if an OpenSSL installation is detected. However, this
can cause the user to mistakenly build without OpenSSL support if
OpenSSL is not installed, because CMAKE_USE_OPENSSL is set to OFF in
that case. Always set CMAKE_USE_OPENSSL to ON by default on systems
where it could be available, skipping the initial detection, resulting
in an error when we try to use OpenSSL later on. Detect this error
and advise the user to either install OpenSSL or set CMAKE_USE_OPENSSL
to OFF.

Co-Authored-by: Brad King <brad.king@kitware.com>
2019-07-18 11:10:36 -04:00