Commit Graph

374 Commits

Author SHA1 Message Date
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
Brad King
fb0c3c564c Require CMake 3.1 to build CMake itself
This simplifies some policy settings and use of third-party
libraries with imported targets.
2017-08-10 15:08:02 -04:00
Brad King
88c9878af9 Make libuv available to all parts of CMake
The libuv library provides many useful platform abstractions and better
process management than KWSys.  We'd like to use it everywhere instead
of just in the server mode.  Drop the `CMAKE_USE_LIBUV` option and use
libuv everywhere except during bootstrap.
2017-08-08 09:34:54 -04:00
Brad King
49640d3629 HP-UX: Drop support for building CMake on HP-UX
CMake will soon require both C++11 and libuv to build.  Neither of
these works on HP-UX, so unfortunately we need to drop support for
the platform until someone can get them working.

Issue: #17137
2017-08-07 09:16:09 -04:00
Brad King
a9eaefaa1e Build with libuv on Cygwin to enable server-mode
With our last update of libuv, Cygwin is now supported.
2017-05-28 09:05:57 -04:00
Brad King
2731a91c98 Update SunPro flags used for CMake itself to support C++11 2017-05-08 10:53:46 -04:00
Brad King
86edc5b6a5 Choose compiler-specific flags earlier in CMake's own build
Add the flags early enough be used in the checks for C++ features.
2017-05-08 10:26:48 -04:00
Daniel Pfeifer
d0c3e47d80 clang-tidy: add option CMake_RUN_CLANG_TIDY 2017-05-04 17:39:23 +02:00
Daniel Pfeifer
d2b0a47c6f Add include-what-you-use mapping 2017-04-13 16:04:10 +02:00
Brad King
d33de80c8a Help/dev: Exclude this directory from user-facing documentation
Teach Sphinx and our own install rules to skip a `Help/dev` directory.
This will give us a place to put developer-only documentation that
should not be included in the user-facing documentation.  Add a
placeholder README.
2017-03-01 16:05:55 -05:00
Brad King
a333570914 Enable libuv on Solaris 10
We've ported our libuv to this platform so we can build it now.
2017-02-28 09:03:12 -05:00
Brad King
fecb70dd34 Update CMake pre-cached values for libarchive 3.3.0 2017-02-23 07:15:19 -05:00
Eric Berge
ba8bb32162 Disable libuv on Solaris 10
Two issues need to be resolved to add Solaris 10
libuv support:

1. libuv needs to provide alternative functionality
   for systems that do not support mkdtemp()
2. cmake should set SUNOS_NO_IFADDRS for Solaris 10
   builds (but not Solaris 11)
2016-12-21 15:34:11 -06:00
Brad King
cd8a57ae9b Add option to build CMake against a system librhash
Create a CMAKE_USE_SYSTEM_LIBRHASH option.
2016-11-10 08:29:38 -05:00
Brad King
31bb727f3b librhash: Build the library within CMake
Update `ustd.h` to include KWSys Large File Support configuration so
that consistent stream libraries are used (on AIX with XL).

Add a `cm_rhash.h` header to include the CMake-provided copy of the
`rhash.h` header from CMake sources.
2016-11-10 08:26:54 -05:00
Clinton Stimpson
baead1e2a8 Encoding: Remove option to use ANSI code page internally
The switch to use UTF-8 encoding has been defaulted to on for quite some
time since commit v3.2.0-rc1~116^2 (Encoding: Switch to use UTF-8
internally by default on Windows, 2014-12-26).
2016-11-02 08:48:34 -06:00
Dāvis Mosāns
335a29cb07 Enable Unicode output to Windows consoles
Use KWSys ConsoleBuf to replace the `streambuf` on `std::cout` and
`std::cerr` so that process output can be encoded correctly for display
in a Windows console.
2016-10-26 17:02:37 +03:00
Daniel Pfeifer
326d5fa747 Allow custom built libarchive to use custom built expat.
Expat is built anyway.
2016-10-10 00:21:00 +02:00
Daniel Pfeifer
7d45db9956 Don't require liblzma when using system libarchive 2016-10-10 00:12:34 +02:00
Daniel Pfeifer
a28b8f95bc Don't require libbz2 when using system libarchive 2016-10-10 00:08:06 +02:00
Chuck Atkins
20e8dcf162 Set minimum version for LibUV to 1.0.0
Older versions of libuv did not have the uv_loop_close API.  It first
showed up in unstable releases ~ v0.11.20 but was not available in
a stable release until v1.0
2016-10-07 09:07:32 -04:00
Chuck Atkins
845b98f45b Use find_package for JsonCpp and LibUV instead of include 2016-10-07 09:07:32 -04:00
Brad King
523f8ec82c server-mode: Add option to enable/disable test case explicitly
Add a `CMake_TEST_SERVER_MODE` option that can be set in testing builds
to enable/disable server mode tests explicitly.  This will allow testing
in combination with `CMake_TEST_EXTERNAL_CMAKE` or for server mode to be
built on systems that have a python version that cannot run the test.
2016-09-29 13:40:21 -04:00
Brad King
6b97a5efc6 server-mode: Add option to enable/disable the mode explicitly
Provide a way for scripts building CMake to enable server mode
explicitly and assume the risk of a build failure if it is not
supported.  This will allow such scripts to ensure that server
mode is available if the build succeeds.  It also allows scripts
to explicitly disable server mode even if it would be supported.
2016-09-29 13:38:47 -04:00
Brad King
a833496199 server-mode: Rename variable CMake_{HAVE => ENABLE}_SERVER_MODE
The latter is a better name for making it a public-facing option.
2016-09-29 13:20:10 -04:00
Brad King
97b6e17c33 server-mode: Enable from bootstrapped CMake build
CMake is frequently built from source via bootstrap.
There is no reason we cannot support server mode.
2016-09-29 13:12:49 -04:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Tobias Hunger
b13d3e0d0b cmake-server: Bare-bones server implementation
Adds a bare-bones cmake-server implementation and makes it possible
to start that with "cmake -E server".

Communication happens via stdin/stdout for now.

Protocol is based on Json objects surrounded by magic strings
("[== CMake Server ==[" and "]== CMake Server ==]"), which simplifies
Json parsing significantly.

This patch also defines an interface used to implement different
versions of the protocol spoken by the server, but does not include
any protocol implementaiton.
2016-09-19 08:57:57 -04:00
Brad King
ae783c9ba9 Require CMake 2.8.12.2 to build CMake itself
This will enable use of features such as ALIAS targets within CMake's
own build.
2016-09-15 09:24:25 -04:00
Brad King
7cf369fe27 Do not build libuv on HP-UX
Some work may be needed to port to HP-UX.
2016-08-31 09:09:23 -04:00
Brad King
075cae5147 Do not build libuv on SPARC
Some work may be needed to port to SPARC with Solaris and Linux.
2016-08-31 09:05:15 -04:00
Brad King
9a53af4068 Do not build libuv on Cygwin
Currently libuv does not support Cygwin (see libuv issue 832)
in part due to lack of pthread APIs:

  https://cygwin.com/cygwin-api/std-notimpl.html
2016-08-31 09:05:15 -04:00
Brad King
219f741128 Do not build libuv on Mac OS X 10.4 and lower
It needs APIs that have been available only since 10.5.
Also check that the CoreServices header can be included.
2016-08-31 09:05:14 -04:00
Brad King
8a5beef32e Add option to build CMake against a system libuv
Create a CMAKE_USE_SYSTEM_LIBUV option.
2016-08-31 09:05:14 -04:00
Brad King
13b7e7587d libuv: Build the library within CMake
Take logic from upstream `Makefile.am` and `configure.ac` to build libuv
sources.

Update `uv.h` to include KWSys Large File Support configuration so that
consistent stream libraries are used (on AIX with XL).

Add a `cm_uv.h` header to include the CMake-provided copy of the `uv.h`
header from CMake sources.
2016-08-31 09:02:19 -04:00
Konstantin Podsvirov
c18dc6fbe5 Added CMake_BUILD_DEVELOPER_REFERENCE option
By default is OFF and marked as advanced.

It's also add custom cmake-developer-reference (ALL) target

Generated output will be installed to ${CMAKE_DOC_DIR}/developer-reference.
2016-08-16 19:02:35 +03:00
Daniel Pfeifer
ea5477e43d Make C++ feature checks extensible
Turn the feature check for cxx11_unordered_map into a function such that
we can use it for other features as well.  Drop the 11 suffix, as we may
want to check features from other standards.
2016-06-27 10:37:40 -04:00
Brad King
9ad10c8feb cmake-gui: Reference LGPLv3 when redistributing Qt
Download http://www.gnu.org/licenses/lgpl.txt and place it as
Licenses/LGPLv3.txt in our source tree.  When building cmake-gui, use
option CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL to enable notification in the
"About" dialog of how the distribution of Qt is licensed.  Install the
license file as ${CMAKE_ROOT}/Licenses/LGPLv3.txt so that the dialog can
display a path to it.
2016-06-17 15:02:54 -04:00
Brad King
190a5fdffd Automatically use OpenSSL by default on Linux and FreeBSD if available
Since https is almost ubiquitous nowadays we should support it by
default whenever possible.  When building our own curl, we already
automatically enable SSL/TLS support on Windows and OS X by using the
OS-native APIs.  On UNIX platforms we need to use OpenSSL but have not
done so by default before, leading to possible user confusion when https
transfers fail later.  Fix this by searching for OpenSSL quietly and
enabling use of it automatically if it is found.

Do this only on Linux and FreeBSD for now because on other UNIX
platforms (e.g. AIX, HP-UX, SunOS) it seems too easy to find an
OpenSSL that is not compatible with the target compiler.
2016-02-29 11:51:04 -05:00