Skip to content

Commit

Permalink
Merge pull request #74 from Microsoft/dev/jgoshi/FIcmake3.14
Browse files Browse the repository at this point in the history
FI cmake 3.14
  • Loading branch information
jgoshi authored Mar 14, 2019
2 parents 9b468f6 + ee3e28e commit 0ff031d
Show file tree
Hide file tree
Showing 2,643 changed files with 81,992 additions and 32,855 deletions.
17 changes: 10 additions & 7 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
Checks: "-*,\
bugprone-*,\
-bugprone-macro-parentheses,\
-bugprone-misplaced-widening-cast,\
google-readability-casting,\
misc-*,\
-misc-incorrect-roundings,\
Expand All @@ -8,28 +11,28 @@ misc-*,\
-misc-static-assert,\
modernize-*,\
-modernize-deprecated-headers,\
-modernize-pass-by-value,\
-modernize-raw-string-literal,\
-modernize-return-braced-init-list,\
-modernize-use-auto,\
-modernize-use-default-member-init,\
-modernize-use-emplace,\
-modernize-use-equals-default,\
-modernize-use-equals-delete,\
-modernize-use-noexcept,\
-modernize-use-transparent-functors,\
-modernize-use-using,\
performance-*,\
-performance-inefficient-string-concatenation,\
-performance-inefficient-vector-operation,\
readability-*,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-implicit-bool-cast,\
-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-named-parameter,\
-readability-redundant-declaration,\
-readability-redundant-member-init,\
-readability-simplify-boolean-expr,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: '1'
- key: modernize-use-equals-default.IgnoreMacros
value: '0'
...
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ configure eol=lf

*.pfx -text
*.png -text
*.png.in -text

*.c our-c-style
*.cc our-c-style
Expand Down
8 changes: 7 additions & 1 deletion Auxiliary/vim/syntax/cmake.vim
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ syn keyword cmakeVariable contained
\ CTEST_CUSTOM_POST_TEST
\ CTEST_CUSTOM_PRE_MEMCHECK
\ CTEST_CUSTOM_PRE_TEST
\ CTEST_CUSTOM_TEST_IGNORE
\ CTEST_CUSTOM_TESTS_IGNORE
\ CTEST_CUSTOM_WARNING_EXCEPTION
\ CTEST_CUSTOM_WARNING_MATCH
\ CTEST_CVS_CHECKOUT
Expand Down Expand Up @@ -873,8 +873,12 @@ syn keyword cmakeKWExternalProject contained
\ LOG_
\ LOG_BUILD
\ LOG_CONFIGURE
\ LOG_DIR
\ LOG_DOWNLOAD
\ LOG_INSTALL
\ LOG_MERGED_STDOUTERR
\ LOG_OUTPUT_ON_FAILURE
\ LOG_PATCH
\ LOG_TEST
\ LOG_UPDATE
\ MAKE_EXE
Expand Down Expand Up @@ -2208,6 +2212,8 @@ syn keyword cmakeGeneratorExpressions contained
\ DEBUG_MODE
\ EXPORT
\ FOO_EXTRA_THINGS
\ Fortran_COMPILER_ID
\ Fortran_COMPILER_VERSION
\ GENEX_EVAL
\ GNU
\ IF
Expand Down
45 changes: 21 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1...3.12 FATAL_ERROR)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake)
project(CMake)
Expand Down Expand Up @@ -117,6 +117,18 @@ option(CMake_BUILD_DEVELOPER_REFERENCE
"Build CMake Developer Reference" OFF)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)

# option to build using interprocedural optimizations (IPO/LTO)
if (NOT CMAKE_VERSION VERSION_LESS 3.12.2)
option(CMake_BUILD_LTO "Compile CMake with link-time optimization if supported" OFF)
if(CMake_BUILD_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT HAVE_IPO)
if(HAVE_IPO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()
endif()

#-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script
Expand All @@ -125,10 +137,6 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Options have dependencies.
include(CMakeDependentOption)

# Optionally use system xmlrpc. We no longer build or use it by default.
option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
mark_as_advanced(CTEST_USE_XMLRPC)

# Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV ZLIB)
Expand Down Expand Up @@ -159,10 +167,8 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)

# Optionally use system utility libraries.
option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
"${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
"${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}" "NOT CTEST_USE_XMLRPC" ON)
option(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" "${CMAKE_USE_SYSTEM_LIBRARY_CURL}")
option(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" "${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}")
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
"${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2"
Expand Down Expand Up @@ -200,7 +206,7 @@ endmacro()
macro(CMAKE_SETUP_TESTING)
if(BUILD_TESTING)
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
foreach(util CURL EXPAT XMLRPC ZLIB)
foreach(util CURL EXPAT ZLIB)
if(CMAKE_USE_SYSTEM_${util})
set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
endif()
Expand Down Expand Up @@ -326,6 +332,9 @@ macro (CMAKE_BUILD_UTILITIES)
set(KWSYS_USE_ConsoleBuf 1)
set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
set(KWSYS_INSTALL_DOC_DIR "${CMAKE_DOC_DIR}")
if(CMake_NO_CXX_STANDARD)
set(KWSYS_CXX_STANDARD "")
endif()
add_subdirectory(Source/kwsys)
set(kwsys_folder "Utilities/KWSys")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
Expand Down Expand Up @@ -532,7 +541,7 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build jsoncpp library.
if(CMAKE_USE_SYSTEM_JSONCPP)
find_package(JsonCpp)
find_package(JsonCpp 1.4.1)
if(NOT JsonCpp_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!")
Expand All @@ -559,18 +568,6 @@ macro (CMAKE_BUILD_UTILITIES)
CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty")
endif()

#---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest.
if(CTEST_USE_XMLRPC)
find_package(XMLRPC QUIET REQUIRED libwww-client)
if(NOT XMLRPC_FOUND)
message(FATAL_ERROR
"CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
endif()
set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
endif()

#---------------------------------------------------------------------
# Use curses?
if (UNIX)
Expand Down Expand Up @@ -724,7 +721,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
# the build tree, which is both the build and the install RPATH.
if (UNIX)
if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
OR CMAKE_USE_SYSTEM_EXPAT OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ CMake uses `Kitware's GitLab Instance`_ to manage development and code review.
To contribute patches:

#. Fork the upstream `CMake Repository`_ into a personal account.
#. Run `Utilities/SetupForDevelopment.sh`_ for local configuration.
#. Run `Utilities/SetupForDevelopment.sh`_ for local git configuration.
#. See `Building CMake`_ for building CMake locally.
#. See the `CMake Source Code Guide`_ for coding guidelines.
#. Base all new work on the upstream ``master`` branch.
Base work on the upstream ``release`` branch only if it fixes a
Expand All @@ -45,6 +46,7 @@ The merge request will enter the `CMake Review Process`_ for consideration.
.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
.. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh
.. _`Building CMake`: README.rst#building-cmake
.. _`CMake Source Code Guide`: Help/dev/source.rst
.. _`commit messages`: Help/dev/review.rst#commit-messages
.. _`CMake Review Process`: Help/dev/review.rst
Expand Down
1 change: 1 addition & 0 deletions CTestCustom.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
"(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)"
"(Lexer|Parser).*warning.*variable.*was set but never used"
"LexerParser.*warning.*empty expression statement has no effect; remove unnecessary"
"PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c"
"[Qq]t([Cc]ore|[Gg]ui|[Ww]idgets).*warning.*conversion.*may alter its value"
"warning:.*is.*very unsafe.*consider using.*"
Expand Down
7 changes: 0 additions & 7 deletions CompileFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "AIX")
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "IRIX")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
endif()
endif()

if(CMAKE_SYSTEM MATCHES "OSF1-V")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
Expand Down
7 changes: 6 additions & 1 deletion Copyright.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CMake - Cross Platform Makefile Generator
Copyright 2000-2018 Kitware, Inc. and Contributors
Copyright 2000-2019 Kitware, Inc. and Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -39,6 +39,7 @@ The following individuals and institutions are among the Contributors:
* Alexander Neundorf <[email protected]>
* Alexander Smorkalov <[email protected]>
* Alexey Sokolov <[email protected]>
* Alex Merry <[email protected]>
* Alex Turbov <[email protected]>
* Andreas Pakulat <[email protected]>
* Andreas Schneider <[email protected]>
Expand All @@ -62,13 +63,17 @@ The following individuals and institutions are among the Contributors:
* Ilya Lavrenov <[email protected]>
* Insight Software Consortium <insightsoftwareconsortium.org>
* Jan Woetzel
* Julien Schueller
* Kelly Thompson <[email protected]>
* Laurent Montel <[email protected]>
* Konstantin Podsvirov <[email protected]>
* Mario Bensi <[email protected]>
* Martin Gräßlin <[email protected]>
* Mathieu Malaterre <[email protected]>
* Matthaeus G. Chajdas
* Matthias Kretz <[email protected]>
* Matthias Maennich <[email protected]>
* Michael Hirsch, Ph.D. <www.scivision.co>
* Michael Stürmer
* Miguel A. Figueroa-Villanueva
* Mike Jackson
Expand Down
2 changes: 1 addition & 1 deletion Help/command/FIND_XXX.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:

2. Search paths specified in cmake-specific cache variables.
These are intended to be used on the command line with a ``-DVAR=value``.
The values are interpreted as :ref:`;-lists <CMake Language Lists>`.
The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed.

* |CMAKE_PREFIX_PATH_XXX|
Expand Down
4 changes: 2 additions & 2 deletions Help/command/add_compile_definitions.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
add_compile_definitions
-----------------------

Adds preprocessor definitions to the compilation of source files.
Add preprocessor definitions to the compilation of source files.

::
.. code-block:: cmake
add_compile_definitions(<definition> ...)
Expand Down
43 changes: 33 additions & 10 deletions Help/command/add_compile_options.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
add_compile_options
-------------------

Adds options to the compilation of source files.
Add options to the compilation of source files.

::
.. code-block:: cmake
add_compile_options(<option> ...)
Adds options to the compiler command line for targets in the current
directory and below that are added after this command is invoked.
See documentation of the :prop_dir:`directory <COMPILE_OPTIONS>` and
:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties.
Adds options to the :prop_dir:`COMPILE_OPTIONS` directory property.
These options are used when compiling targets from the current
directory and below.

This command can be used to add any options, but alternative commands
exist to add preprocessor definitions (:command:`target_compile_definitions`
and :command:`add_compile_definitions`) or include directories
(:command:`target_include_directories` and :command:`include_directories`).
Arguments
^^^^^^^^^

Arguments to ``add_compile_options`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.

.. include:: OPTIONS_SHELL.txt

Example
^^^^^^^

Since different compilers support different options, a typical use of
this command is in a compiler-specific conditional clause:

.. code-block:: cmake
if (MSVC)
# warning level 4 and all warnings as errors
add_compile_options(/W4 /WX)
else()
# lots of warnings and all warnings as errors
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()
See Also
^^^^^^^^

This command can be used to add any options. However, for
adding preprocessor definitions and include directories it is recommended
to use the more specific commands :command:`add_compile_definitions`
and :command:`include_directories`.

The command :command:`target_compile_options` adds target-specific options.
6 changes: 4 additions & 2 deletions Help/command/add_custom_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ There are two main signatures for ``add_custom_command``.
Generating Files
^^^^^^^^^^^^^^^^

The first signature is for adding a custom command to produce an output::
The first signature is for adding a custom command to produce an output:

.. code-block:: cmake
add_custom_command(OUTPUT output1 [output2 ...]
COMMAND command1 [ARGS] [args1...]
Expand Down Expand Up @@ -200,7 +202,7 @@ before or after building the target. The command becomes part of the
target and will only execute when the target itself is built. If the
target is already built, the command will not execute.

::
.. code-block:: cmake
add_custom_command(TARGET <target>
PRE_BUILD | PRE_LINK | POST_BUILD
Expand Down
2 changes: 1 addition & 1 deletion Help/command/add_custom_target.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_custom_target

Add a target with no output so it will always be built.

::
.. code-block:: cmake
add_custom_target(Name [ALL] [command1 [args1...]]
[COMMAND command2 [args2...] ...]
Expand Down
4 changes: 2 additions & 2 deletions Help/command/add_definitions.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
add_definitions
---------------

Adds -D define flags to the compilation of source files.
Add -D define flags to the compilation of source files.

::
.. code-block:: cmake
add_definitions(-DFOO -DBAR ...)
Expand Down
4 changes: 2 additions & 2 deletions Help/command/add_dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ add_dependencies

Add a dependency between top-level targets.

::
.. code-block:: cmake
add_dependencies(<target> [<target-dependency>]...)
Make a top-level ``<target>`` depend on other top-level targets to
Makes a top-level ``<target>`` depend on other top-level targets to
ensure that they build before ``<target>`` does. A top-level target
is one created by one of the :command:`add_executable`,
:command:`add_library`, or :command:`add_custom_target` commands
Expand Down
Loading

0 comments on commit 0ff031d

Please sign in to comment.