Commit Graph

412 Commits

Author SHA1 Message Date
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
Brad King
d2fde94809 Help: Add infrastructure for guide-level documentation
Create a `Help/guide/` directory to hold guide-level documents.
Build them in most documentation formats, but not as man pages.

Initialize the guide directory with a placeholder for the tutorial.
2019-06-18 10:36:16 -04:00
Brad King
29f4f70b41 Add undocumented option to sign CMake's own binaries on Windows 2019-05-08 13:18:31 -04:00
Brad King
1069a3f02b Configure CMake itself with policies through CMake 3.14
In particular, set `CMP0082` to `NEW` to interleave install commands
in the top-level directory with subdirectory installations.
2019-05-08 13:18:30 -04:00
Brad King
9915003eae Merge topic 'import-zstd'
1761a9a546 CMake: Enable use of zstd in libarchive
2cf2921749 zstd: Add CMake build system
f92b4b52eb Merge branch 'upstream-zstd' into import-zstd
fbaf65639a zstd 2018-12-27 (470344d3)
9337cbfcca zstd: add script to import zstd from upstream

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Bartosz <gang65@poczta.onet.pl>
Merge-request: !3092
2019-03-14 11:08:43 -04:00
Brad King
1761a9a546 CMake: Enable use of zstd in libarchive
Build zstd as part of CMake or find one on the system.  Modify our
port of libarchive to use the zstd configured for use with CMake.

Issue: #18657
2019-03-13 10:47:21 -04:00
Chuck Atkins
2c280acdf8 JsonCpp: Ignore deprecation warnings 2019-03-12 17:14:02 +00:00
Regina Pfeifer
b5a69c6279 cmcompress: Delete unused 3rdParty module 2019-02-25 09:36:27 +01:00
Brad King
a37614667d Configure KWSys to honor CMake_NO_CXX_STANDARD
KWSys now computes a default `CMAKE_CXX_STANDARD` value if it is
not told what standard to use.  When `CMake_NO_CXX_STANDARD` is
enabled, tell KWSys not to do that.
2019-01-30 10:39:41 -05:00
Brad King
dc90cd6877 Merge topic 'fileapi'
b9c6f08276 Help: Add release note for fileapi feature
4b6b2a571c fileapi: extend codemodel v2 with directory details
eb8c7676a4 fileapi: extend codemodel v2 with a project model
42f0125ceb fileapi: Add test for cmakeFiles v1
6615408193 fileapi: add cmakeFiles v1
3f6ee75a66 fileapi: Add test for cache v2
7489e95b8e fileapi: add cache v2
ea0a060168 fileapi: Add test for codemodel v2
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2706
2018-12-13 09:57:59 -05:00
Brad King
1c03c12b1d jsoncpp: Require version 1.4.1 when using system-provided library
We need the `failIfExtra` diagnostic added by that version.
2018-12-11 12:50:21 -05:00
Regina Pfeifer
c2f6872c4e CTest: Remove submit method 'xmlrpc' 2018-11-29 00:29:12 +01:00
Cristian Adam
786dddc0fd Add option to build CMake itself with IPO/LTO
Create a `CMake_BUILD_LTO` option when building with a CMake that
is new enough to support `CheckIPOSupported` everywhere.
2018-10-25 11:52:43 -04:00
Brad King
89ab893469 Merge topic 'fix-no-testing'
a834bcaa91 Tests: Add missing BUILD_TESTING conditions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dan Ibanez <daibane@sandia.gov>
Merge-request: !2520
2018-10-25 07:25:13 -04:00
Brad King
a834bcaa91 Tests: Add missing BUILD_TESTING conditions
We should not call `add_test` unless `BUILD_TESTING` is enabled.

Fixes: #18500
2018-10-24 15:51:17 -04:00
Brad King
5112a76a17 Merge topic 'update-curl'
0310024563 curl: Update build within CMake to account for 7.61 changes
b9d1107790 curl: Backport to work with CMake 3.1 again
e9e8dcee6b Merge branch 'upstream-curl' into update-curl
18812a9c3d curl 2018-09-04 (432eb5f5)
ded211ae46 curl: Update script to get curl 7.61.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2509
2018-10-23 10:20:56 -04:00
Brad King
0310024563 curl: Update build within CMake to account for 7.61 changes
The_CURL_STATICLIB option was replaced by BUILD_SHARED_LIBS.

Drop our own CURL_STATICLIB compile definition because it is now
provided by curl's usage requirements.
2018-10-22 08:55:40 -04:00
Brad King
95b4b9137a Declare support for CMake versions through 3.12 for own build
CMake 3.12 introduced a `...<max>` syntax in the version given to
`cmake_minimum_required` to automatically set policies to NEW up
to that version.  Use it to avoid listing policies explicitly.

The syntax is compatible with older versions of CMake such that they use
the extended version string for the `CMAKE_MINIMUM_REQUIRED_VERSION`
variable (which we don't use) but otherwise ignore it.
2018-10-17 14:29:16 -04:00
Brad King
6744e44970 Update CMake pre-cached values for libarchive 3.3.3
The ENABLE_LZ4 option was added.
2018-09-26 09:55:09 -04:00
Chuck Atkins
da1dc4e450 libarchive: Bump the minimum version from 3.0.0 to 3.1.0
cmArchiveWrite uses the gzip:timestamp write filter option which was not
available until v3.1.0.
2018-08-29 11:20:11 -04:00
Brad King
aefb8559dc IWYU: Fix workaround mapping for std::hash
It is provided by `functional`, not `utility`.  Fix the mapping added by
commit 276d3c7afe (IWYU: Add workaround mapping for std::hash,
2018-07-31).  Also generalize the workaround from commit v3.12.0-rc1~39^2~1
(IWYU: Define a macro to tell code it is preprocessing for iwyu,
2018-05-25) to allow local builds to configure specific flags.  This
is needed because iwyu behaves differently in different environments.
2018-08-07 12:04:58 -04:00
Brad King
281f59536f IWYU: Define a macro to tell code it is preprocessing for iwyu
There are some cases where satisfying IWYU breaks compilation, such as
forward-declaring the `std::hash<>` template with C++ standard libraries
that use an inline namespace inside `std`.  Define a macro during
include-what-you-use preprocessing so that code can adapt.
2018-05-25 12:46:19 -04:00
Brad King
d9b4dcc91e Merge topic 'libuv_version_bump'
f5f72ff844 Explicitly require LibUV 1.10 or higher to build CMake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1966
2018-04-17 07:18:35 -04:00
ErofeevK
f5f72ff844 Explicitly require LibUV 1.10 or higher to build CMake
CMake 3.11 now uses `uv_translate_sys_error` introduced in LibUV 1.10.
2018-04-16 11:33:52 -04:00
Brad King
99bf77f49c ccmake: Check for curses more robustly before enabling
Compute a default for `BUILD_CursesDialog` by building a small test
project that uses curses.  Disable `ccmake` by default if it fails,
and do not search for Curses as part of the main build.  This avoids
creating FindCurses cache entries when we are not considering ccmake.

If `BUILD_CursesDialog` is enabled (e.g. by the user) then warn if
curses cannot be found.
2018-03-21 13:57:45 -04:00
Brad King
94eee5e683 CMakeLib: Link to system thread libraries to support std::thread
Some environments require linking to thread libraries for `std::thread`.
Express this direct dependency of CMakeLib explicitly.  Previously this
was done indirectly through our bundled libuv, but that does not work
when using a system libuv.

Fixes: #17757
2018-02-22 12:59:20 -05:00
Brad King
31d59ff3b1 Compile CMake as C++17 if supported by the compiler
Add a check that a simple source file can compile as C++17 that uses
some of the features we need.  Do this only when hosted by CMake 3.8
or above because those versions are aware of C++17.

Check for unordered_map as we do in bootstrap since commit 375eca7881
(bootstrap: Check support for unordered_map from compiler mode,
2017-11-30).  Also maintain the existing C++14 cstdio check.
2017-12-22 09:05:54 -05:00
Brad King
31c6b9adbf Generalize check for C++14 constructs
The check for C++14 and cstdio is a special case of the more general
problem of checking that the compiler's C++14 mode supports everything
we need.  Rename the checks accordingly.
2017-12-22 09:05:54 -05:00
Brad King
4ff89fb608 AIX: Add -pthread flag to enable std::thread with GCC 2017-11-28 11:24:26 -05:00
Brad King
4d52b46c70 Merge topic 'tidy-sha1-comment'
08353542 clang-tidy: Clarify comment explaining purpose of CLANG_TIDY_SHA1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1497
2017-11-20 13:37:50 -05:00
Brad King
08353542e5 clang-tidy: Clarify comment explaining purpose of CLANG_TIDY_SHA1
Suggested-by: Bill Hoffman <bill.hoffman@kitware.com>
2017-11-17 10:51:02 -05:00
Brad King
be592b23bd IWYU: Suppress warnings from the internal Clang
Do not obscure IWYU's report with warnings from its internal Clang.
We have other testing for such warnings.  Also, when compiling with
a non-Clang compiler we might use warning options that IWYU's Clang
does not understand, and we don't want to see warnings about that.
2017-11-17 10:03:41 -05:00
Matthias Maennich
ffefdb2c08 clang-tidy: Make .clang-tidy a build-time dependency
Currently a change to the clang-tidy configuration remains unnoticed for
incremental builds in the way that it won't trigger a rebuild. This can be
considered a missing dependency that this patch fixes by introducing a
compile time definition (-DCLANG_TIDY_SHA1) that triggers a rebuild upon
change. Currently this only applies to the target CMakeLib.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:39 -04:00
Justin Berger
dc7a18d82e server: test buffer parsing 2017-08-31 15:35:04 -04:00
Daniel Pfeifer
7f29bbe6f2 server: always enable server 2017-08-26 07:46:58 +02:00
Daniel Pfeifer
4614a3b287 server: backport to C++11 2017-08-26 07:46:57 +02:00
Brad King
c1f3eb9f2d Merge topic 'require-c++11'
fd4fd9a2 Require C++11 to build CMake itself

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1132
2017-08-21 08:48:24 -04:00
Brad King
fd4fd9a276 Require C++11 to build CMake itself
CMake can now compile as C++11 on all supported platforms.  Check that
std::unique_ptr is available and fail early if missing.  This will allow
us to use C++11 more broadly in CMake's implementation (previously it
was restricted to the serve mode implementation).

Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
2017-08-16 10:13:38 -04:00