Commit Graph

325 Commits

Author SHA1 Message Date
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
Brad King a5dd0c9d42 Add option to use a system-installed KWIML
Do not activate it with the general use-system-libs options for now
because KWIML is not commonly distributed or available.
2015-12-18 10:02:28 -05:00
Brad King 036b6ef7c4 Port CMake from cmIML to KWIML
KWIML no longer uses a configured prefix.
2015-12-18 10:02:07 -05:00
Brad King 45cd9e6337 Update libarchive configuration within CMake
Hard-code libarchive build options to the way CMake needs them.  Set
them as internal cache entries so users do not see them when building
CMake.
2015-10-28 08:44:48 -04:00
Stephen Kelly 256c78ad44 Build: Set CMP0053 to NEW.
If this policy is WARN, then the ReplaceVariableInString is executed with both
the new algorithm and the OLD slow algorithm.  The NEW algorithm should be used
wherever it works.
2015-09-26 21:17:22 +02:00
Raphael Kubo da Costa ffa6f057b4 Avoid using C11 to build CMake if _Thread_local support is broken
Support for C11's _Thread_local was introduced in GCC in the 4.9 series,
even though we make the C11 compiler flags available in CMake with GCC
>= 4.6.

FreeBSD's runetype.h uses _Thread_local, which causes CMake's own build
to fail when using GCC < 4.9 and -std=gnu11:

  /usr/include/runetype.h:92:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'const'
   extern _Thread_local const _RuneLocale *_ThreadRuneLocale;

Add a test for _Thread_local support and only build CMake itself with
C11 support if it works.

Bug: http://www.cmake.org/Bug/view.php?id=15741
2015-09-15 10:51:54 -04:00
Brad King 92b835ec9d Simplify condition for using rpcrt4 library on Windows
Drop the CMAKE_BUILD_ON_VISUAL_STUDIO variable and hard-code the
condition at its only use.
2015-08-27 13:35:13 -04:00
Brad King 26f5445bb4 Do not install 3rd-party dependencies by default
Disable the CMake_INSTALL_DEPENDENCIES option by default and turn it on
explicitly in our packaging scripts.  This simplifies packaging in
distributions that provide the dependencies for us without having to
install them.  We only need 3rd-party runtime dependencies to be
installed for packaging with redistributable binaries.
2015-08-05 13:29:57 -04:00
Konstantin Podsvirov 068e7962bb CMake: Add CMake_INSTALL_DEPENDENCIES option
By default this option is ON.  Turn OFF to disable installing runtime
3rd-party dependencies.
2015-07-27 10:30:41 -04:00
Konstantin Podsvirov c823f04e0c CMake: New option CMake_INSTALL_COMPONENTS
By default is OFF.
Now it's used with CPack IFW himself installer.
2015-07-07 09:16:40 -04:00
Konstantin Podsvirov 938bbc4352 CMake: Install COMPONENTs
Added components:
- cmake
- ctest
- cpack
- cmake-gui
- ccmake
- data
- sphinx-html
- sphinx-singlehtml
- sphinx-qthelp

Other now Unspecified.
2015-07-07 08:11:09 +03:00
Brad King b5906ed03a Check for std::unordered_map only if we are building CMake
When CMake_TEST_EXTERNAL_CMAKE is set then we are not actually
building CMake so we do not need this check.
2015-05-20 11:35:32 -04:00
Stephen Kelly d7923b82ad Use std::unordered_map instead of hash_map where available. 2015-05-19 00:07:02 +02:00
Brad King 3307e10fc4 Avoid using C++14 to build CMake if cstdio breaks
The GNU 4.8 standard library's cstdio header is not aware that C++14
honors C11's removal of "gets" from stdio.h and results in an error:

  /.../include/c++/4.8/cstdio:120:11: error: no member named 'gets' in the global namespace

Detect this problematic case and default to using C++11 instead of
C++14 for building CMake itself.
2015-05-08 11:04:21 -04:00
Brad King 73dcba5181 Simplify logic to compute install prefix in OS X CMake.app
Also avoid explicitly dereferencing a variable in an if() condition.
2015-04-09 08:02:40 -04:00
Brad King 77534e84b2 Add options to build CMake without any language dialects
If CMake_NO_<LANG>_STANDARD is set, do not set CMAKE_<LANG>_STANDARD.
This will allow users to build with their own -std= flags without
CMake adding any itself.
2015-03-10 14:49:40 -04:00
Brad King a576844263 FindJsonCpp: Drop new module due to upstream jsoncpp providing package
Since jsoncpp 0.7.0 (2014-11-20) the upstream may provide a CMake
package configuration file such that find_package(jsoncpp) will find a
jsoncppConfig.cmake file.  In order to avoid conflicting with this
(especially on case-insensitive filesystems), and since we always prefer
projects to provide package config files (that they maintain), it is
better to not provide FindJsonCpp publicly.

Move FindJsonCpp into a private source directory that is not installed
so that we can still use it for building CMake itself.

Reported-by: Ryan Pavlik <ryan.pavlik@gmail.com>
2015-02-20 08:22:02 -05:00
Gregor Jasny 3526daf5a2 Require libarchive 3.0.0 or later
Older versions do not provide archive_entry_copy_sourcepath_w.
2015-01-29 08:46:01 -05:00
Rolf Eike Beer 43eca4026d drop reference to removed Windows 9x support 2015-01-27 13:38:22 +01:00
Brad King 6ce346c53c curl: Add CURL_CA_PATH option to CMake build process
Move CMAKE_USE_OPENSSL and CURL_CA_BUNDLE up to the top of CMake so that
CMake's own sources can know their values.  Add the CURL_CA_PATH option
at the top and honor it as part of the curl build.
2015-01-23 08:23:52 -05:00
Brad King 27c6da933e Add option to build CMake against a system jsoncpp
Create a CMAKE_USE_SYSTEM_JSONCPP option.
2015-01-20 10:37:35 -05:00
Brad King 287070ceb8 Merge topic 'windows-utf-8'
cdc29c36 Encoding:  Switch to use UTF-8 internally by default on Windows.
2015-01-16 09:44:01 -05:00
Clinton Stimpson cdc29c3608 Encoding: Switch to use UTF-8 internally by default on Windows.
This fixes several reported bugs about CMake not handling
non-ascii paths on Windows.

Practically, the use of some unicode characters may still
be limited by the build or compiler tools.

For example, a user may be limited by the build tools to
using characters within the Windows ANSI code page (which can
include non-ascii characters in the current system language).
2015-01-16 09:39:32 -05:00
Brad King 1fc556536e jsoncpp: Build the library within CMake
Update json/json.h to account for our lack of autolink.h.  Update
json/config.h to include KWSys Large File Support configuration so that
consistent stream libraries are used (on AIX with XL).

Add a cm_jsoncpp_reader.h header to include the CMake-provided copy of
the json/reader.h header from CMake sources.
2015-01-15 11:37:17 -05:00
Brad King de022e8908 Add options to build CMake without latest language dialects
Set CMAKE_C_STANDARD and CMAKE_CXX_STANDARD only if they are not
already defined.  This will allow users to add the settings with
different values to their local cache (e.g. on the command line).
2014-12-05 14:07:59 -05:00
Brad King 4d9fec4fb3 Merge topic 'use-latest-language-dialects'
d49f1c5e Build CMake with most-recent available language dialect.
2014-12-01 08:57:16 -05:00
Ådne Hovda 6b045c3ba8 ccmake: Add CMAKE_USE_SYSTEM_FORM option to use libform instead of cmForm 2014-11-25 11:29:58 -05:00
Stephen Kelly d49f1c5e94 Build CMake with most-recent available language dialect.
When CMake is built with CMake 3.1 or later, appropriate -std=
options will be added for GNU and Clang compilers while building
C and CXX code.

This allows taking advantage of 'hidden' language features such
as move-constructors, and allows the standard library to enable
the use of more-advanced features too, where available.

This does not change CMake host compiler requirements.
2014-11-19 00:32:03 +01:00
Brad King 1959304295 curl: Configure build to work within CMake
Set curl build options as needed for CMake rather than presenting them
to the user in the cache.  Drop the CMAKE_BUILD_CURL_SHARED option for
now.

Change the curl library name to 'cmcurl'.  Disable blocks of code within
curl CMakeLists.txt files that we do not need for CMake, but leave the
code in place to make merging with curl updates easier.
2014-11-10 10:13:37 -05:00
Brad King 95d84f76d9 Merge topic 'cmake-cmp0054-warnings'
29c3edb8 Avoid if() quoted auto-dereference
2014-10-21 15:08:07 -04:00
Ben Boeckel 29c3edb87a Avoid if() quoted auto-dereference
When testing CMAKE_<LANG>_COMPILER_ID values, do not explicitly
dereference or quote the variable. We want if() to auto-dereference the
variable and not its value. Also replace MATCHES with STREQUAL where
equivalent.
2014-10-20 11:49:16 -04:00
Stephen Kelly 2db55ffa56 Remove borland workarounds.
CMake 3.0 is the last release to require to be able to build with
Borland.
2014-10-15 23:16:44 +02:00
Brad King 7a5d9256a3 Remove unused legacy 'DartLocal.conf' file 2014-09-24 10:26:04 -04:00
Brad King 858d5a0b3e Fix if() checks of CMAKE_SYSTEM_NAME on Cygwin
The CMAKE_SYSTEM_NAME is "CYGWIN", but we also define a variable
named "CYGWIN" to "1".  Avoid allowing if() to expand the "CYGWIN"
string as a variable.
2014-09-11 21:23:24 +02:00
Daniel Pfeifer 8436d18115 CMake: Enable use of liblzma in libarchive (#14504)
Build liblzma as part of CMake or find one on the system.  Modify our
port of libarchive to use the liblzma configured for use with CMake.
2014-07-29 08:45:36 -04:00
Brad King 38d3fe0785 Tests: Build and test KWIML even when testing an external CMake
The CMake_TEST_EXTERNAL_CMAKE option added by commit 9608ef6f (Tests:
Optionally configure tests exclusively, 2014-03-03) is intended to allow
one to run the CMake test suite with a compiler that may not be
supported for hosting the build of CMake itself.  However, we currently
use the CMake test infrastructure to test KWIML everywhere that CMake
supports.  In order to continue testing KWIML even in places that CMake
itself does not build, include it even when testing an external CMake.
2014-07-07 11:32:06 -04:00
Brad King 57ddde524b Update CDash server URL
It is now at open.cdash.org and does not start in "/CDash".
2014-06-24 13:54:52 -04:00
Brad King e2b02823e7 Update libarchive configuration within CMake
Hard-code libarchive build options to the way CMake needs them.  Set
them as internal cache entries so users do not see them when building
CMake.
2014-04-03 15:20:58 -04:00
Clinton Stimpson 91fd99b865 Encoding: Provide option to configure CMake to use UTF-8 encoding. 2014-03-14 08:48:18 -06:00
Brad King 9608ef6f40 Tests: Optionally configure tests exclusively, with an external CMake
Add an undocumented CMake_TEST_EXTERNAL_CMAKE option to name an external
CMake 'bin' directory.  Skip all main CMake binary builds and instead
configure the Tests directory to run using the external CMake provided.
This will provide a means to exercise the CMake test suite generating
for target platforms and compilers with which the CMake source does not
build.  That will allow us to raise the level of C++ features required
of a compiler to build our source while retaining tests for generating
projects with older compiler tools.
2014-03-03 15:49:17 -05:00
Brad King 9f5bd180c8 Tests: Drop CMAKE_TEST_GENERATOR(|_TOOLSET) variables
s/CMAKE_TEST_GENERATOR/CMAKE_GENERATOR/g
2014-03-03 15:26:49 -05:00
Brad King 3c01ee5adc Tests: Drop CMAKE_TEST_MSVC and test MSVC directly
Now that we no longer support running tests using a different generator
we can trust the MSVC platform indicator directly.
2014-03-03 15:26:48 -05:00
Brad King daf0a5fede Tests: Drop CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM options
Drop the option to test with a different generator and make program than
was used to build.  This was used only to test support for the Open
Watcom compiler which at one time could not build CMake.  Instead we
will allow CMake to be configured to skip building binaries and just run
the test suite using an external CMake (in a future change).

For now leave the two option variables hard-coded to the old option
defaults until code can be updated to stop using them.
2014-03-03 15:26:46 -05:00
Stephen Kelly 4b67c4b94c Remove compatibility CTest code. 2014-02-28 14:55:47 +01:00
Stephen Kelly 884fb7f5b9 Remove obsolete workaround for old cmake versions. 2014-01-07 16:05:19 +01:00
Brad King 7fc7624af5 Tests: Move CMAKE_TEST_MAKEPROGRAM into Tests/CMakeLists.txt
Also drop the temporary MAKEPROGRAM variable and the DART_ROOT special
case.  We never run dashboard clients with Dart anymore.
2013-11-18 08:26:22 -05:00
Brad King 06b0dbe061 OS X: Drop version number from CMake.app bundle name (#11693)
Always name the application bundle "CMake.app".  Users can rename it
after installation if they wish.  This is the typical approach used by
OS X applications, including Xcode.  It allows CMake to be upgraded
without manually re-running CMake in every build tree to update the path
to CMake.  It also makes the executable location in the CMake build tree
more predicatable.
2013-11-12 15:47:06 -05:00
Brad King ec6df3675e Teach --help-* options to load documentation from .rst files
Install the Help directory next to Modules to make it available in CMake
distributions.  Use cmRST to read Help .rst documents and print them as
help output.

Add options

 --help-manual-list
 --help-manual

to list available manuals or print one of them.  Implement the options

 --help-commands
 --help-modules
 --help-policies
 --help-properties
 --help-variables

by mapping to the corresponding manual page.  Implement the options

 --help-command-list
 --help-module-list
 --help-policy-list
 --help-property-list
 --help-variable-list

by globbing the available Help .rst documents of the corresponding type
and reading their titles.  Implement the options

 --help-command
 --help-module
 --help-policy
 --help-property
 --help-variable

by globbing the matching Help .rst document(s) and printing them.
2013-10-16 09:22:35 -04:00
Brad King 277bd1db98 Drop CMAKE_STRICT mode
With our modern development workflow it is less likely a property will
be added to C++ code without documentation.  This mode only existed to
support the DocTest which had very limited coverage of the properties
anyway.
2013-10-15 10:47:38 -04:00
Brad King 09be0bb049 Set IDE folder for CMake 'documentation' target only if it exists
The documentation target will be come optional, so do not reference it
when it does not exist.
2013-10-15 10:46:55 -04:00