summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CompileFlags.cmake7
-rw-r--r--Help/command/find_package.rst6
-rw-r--r--Help/command/set_directory_properties.rst2
-rw-r--r--Help/command/set_property.rst9
-rw-r--r--Help/command/set_source_files_properties.rst6
-rw-r--r--Help/command/set_tests_properties.rst7
-rw-r--r--Help/manual/cmake-modules.7.rst1
-rw-r--r--Help/module/CheckFortranSourceRuns.rst1
-rw-r--r--Help/release/dev/check-fortran-run.rst6
-rw-r--r--Help/release/dev/deprecate-policy-old.rst8
-rw-r--r--Modules/CMakeBackwardCompatibilityCXX.cmake3
-rw-r--r--Modules/CMakeCompilerABI.h8
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake3
-rw-r--r--Modules/CMakeDetermineSystem.cmake1
-rw-r--r--Modules/CMakeFortranCompilerABI.F8
-rw-r--r--Modules/CMakeFortranCompilerId.F.in16
-rw-r--r--Modules/CMakePlatformId.h.in3
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake3
-rw-r--r--Modules/CheckFortranSourceRuns.cmake158
-rw-r--r--Modules/Platform/IRIX.cmake53
-rw-r--r--Modules/Platform/IRIX64.cmake73
-rw-r--r--Modules/ProcessorCount.cmake18
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx1
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx1
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx1
-rw-r--r--Source/CTest/cmParseMumpsCoverage.cxx1
-rw-r--r--Source/CTest/cmProcess.cxx2
-rw-r--r--Source/LexerParser/cmCommandArgumentLexer.cxx4
-rw-r--r--Source/LexerParser/cmCommandArgumentLexer.in.l4
-rw-r--r--Source/LexerParser/cmDependsJavaLexer.cxx6
-rw-r--r--Source/LexerParser/cmDependsJavaLexer.in.l6
-rw-r--r--Source/LexerParser/cmExprLexer.cxx6
-rw-r--r--Source/LexerParser/cmExprLexer.in.l6
-rw-r--r--Source/LexerParser/cmFortranLexer.cxx4
-rw-r--r--Source/LexerParser/cmFortranLexer.in.l4
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx1
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmDocumentation.cxx119
-rw-r--r--Source/cmDocumentation.h11
-rw-r--r--Source/cmDocumentationSection.h2
-rw-r--r--Source/cmExportInstallFileGenerator.cxx3
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx1
-rw-r--r--Source/cmFileAPICMakeFiles.cxx1
-rw-r--r--Source/cmFileAPICache.cxx1
-rw-r--r--Source/cmFileCommand.cxx1
-rw-r--r--Source/cmFindLibraryCommand.cxx1
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx8
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx1
-rw-r--r--Source/cmInstallExportGenerator.cxx1
-rw-r--r--Source/cmJsonObjects.cxx1
-rw-r--r--Source/cmListCommand.cxx1
-rw-r--r--Source/cmMakefile.cxx6
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx1
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx1
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx1
-rw-r--r--Source/cmNinjaTargetGenerator.cxx1
-rw-r--r--Source/cmPipeConnection.cxx2
-rw-r--r--Source/cmQtAutoGen.cxx1
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx40
-rw-r--r--Source/cmQtAutoGenerator.cxx1
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx4
-rw-r--r--Source/cmQtAutoGeneratorMocUic.h2
-rw-r--r--Source/cmServerConnection.cxx2
-rw-r--r--Source/cmString.hxx1
-rw-r--r--Source/cmTestGenerator.cxx3
-rw-r--r--Source/cmake.cxx25
-rw-r--r--Source/cmake.h3
-rw-r--r--Source/cmakemain.cxx10
-rw-r--r--Source/cmcmd.cxx10
-rw-r--r--Source/kwsys/ProcessUNIX.c2
-rw-r--r--Source/kwsys/testCommandLineArguments.cxx35
-rw-r--r--Tests/CMakeLib/testUVRAII.cxx2
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in72
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt1
-rw-r--r--Tests/FortranOnly/CMakeLists.txt11
-rw-r--r--Tests/RunCMake/Autogen/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Autogen/NoQt-stderr.txt8
-rw-r--r--Tests/RunCMake/Autogen/NoQt.cmake6
-rw-r--r--Tests/RunCMake/Autogen/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/Autogen/empty.cpp0
-rw-r--r--Tests/RunCMake/CMP0064/CMP0064-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake29
-rw-r--r--Tests/RunCMake/CommandLine/no-S-B-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/no-S-B-stderr.txt1
-rw-r--r--Tests/RunCMake/FindBoost/RunCMakeTest.cmake1
-rw-r--r--Tests/SubDirSpaces/CMakeLists.txt2
-rw-r--r--Utilities/IWYU/mapping.imp3
-rw-r--r--Utilities/cmcurl/CMakeLists.txt2
-rw-r--r--Utilities/cmliblzma/liblzma/simple/x86.c2
-rw-r--r--Utilities/cmlibuv/src/unix/process.c2
93 files changed, 475 insertions, 440 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index ec9b31b..5d0e144 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -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 ")
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 937a930..cafef8c 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -23,9 +23,9 @@ Finds and loads settings from an external project. ``<PackageName>_FOUND``
will be set to indicate whether the package was found. When the
package is found package-specific information is provided through
variables and :ref:`Imported Targets` documented by the package itself. The
-``QUIET`` option disables messages if the package cannot be found. The
-``REQUIRED`` option stops processing with an error message if the package
-cannot be found.
+``QUIET`` option disables informational messages, including those indicating
+that the package cannot be found if it is not ``REQUIRED``. The ``REQUIRED``
+option stops processing with an error message if the package cannot be found.
A package-specific list of required components may be listed after the
``COMPONENTS`` option (or after the ``REQUIRED`` option if present).
diff --git a/Help/command/set_directory_properties.rst b/Help/command/set_directory_properties.rst
index cc71522..f02a8e6 100644
--- a/Help/command/set_directory_properties.rst
+++ b/Help/command/set_directory_properties.rst
@@ -9,5 +9,7 @@ Set properties of the current directory and subdirectories.
Sets properties of the current directory and its subdirectories in key-value pairs.
+See also the :command:`set_property(DIRECTORY)` command.
+
See :ref:`Directory Properties` for the list of properties known to CMake
and their individual documentation for the behavior of each property.
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index 2d270ec..2624b4b 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -24,17 +24,19 @@ It must be one of the following:
Scope is unique and does not accept a name.
``DIRECTORY``
- Scope defaults to the current directory but another
- directory (already processed by CMake) may be named by full or
- relative path.
+ Scope defaults to the current directory but another directory
+ (already processed by CMake) may be named by full or relative path.
+ See also the :command:`set_directory_properties` command.
``TARGET``
Scope may name zero or more existing targets.
+ See also the :command:`set_target_properties` command.
``SOURCE``
Scope may name zero or more source files. Note that source
file properties are visible only to targets added in the same
directory (CMakeLists.txt).
+ See also the :command:`set_source_files_properties` command.
``INSTALL``
Scope may name zero or more installed file paths.
@@ -54,6 +56,7 @@ It must be one of the following:
``TEST``
Scope may name zero or more existing tests.
+ See also the :command:`set_tests_properties` command.
``CACHE``
Scope must name zero or more cache existing entries.
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index 8538a1e..91f995c 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -10,6 +10,10 @@ Source files can have properties that affect how they are built.
[prop2 value2 [...]])
Sets properties associated with source files using a key/value paired
-list. See :ref:`Source File Properties` for the list of properties known
+list.
+
+See also the :command:`set_property(SOURCE)` command.
+
+See :ref:`Source File Properties` for the list of properties known
to CMake. Source file properties are visible only to targets added
in the same directory (CMakeLists.txt).
diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst
index 55fd635..9bc94ae 100644
--- a/Help/command/set_tests_properties.rst
+++ b/Help/command/set_tests_properties.rst
@@ -10,5 +10,8 @@ Set a property of the tests.
Sets a property for the tests. If the test is not found, CMake
will report an error.
:manual:`Generator expressions <cmake-generator-expressions(7)>` will be
-expanded the same as supported by the test's :command:`add_test` call. See
-:ref:`Test Properties` for the list of properties known to CMake.
+expanded the same as supported by the test's :command:`add_test` call.
+
+See also the :command:`set_property(TEST)` command.
+
+See :ref:`Test Properties` for the list of properties known to CMake.
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 940186a..71a8b00 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -28,6 +28,7 @@ These modules are loaded using the :command:`include` command.
/module/CheckFortranCompilerFlag
/module/CheckFortranFunctionExists
/module/CheckFortranSourceCompiles
+ /module/CheckFortranSourceRuns
/module/CheckFunctionExists
/module/CheckIPOSupported
/module/CheckIncludeFileCXX
diff --git a/Help/module/CheckFortranSourceRuns.rst b/Help/module/CheckFortranSourceRuns.rst
new file mode 100644
index 0000000..a1bff70
--- /dev/null
+++ b/Help/module/CheckFortranSourceRuns.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CheckFortranSourceRuns.cmake
diff --git a/Help/release/dev/check-fortran-run.rst b/Help/release/dev/check-fortran-run.rst
new file mode 100644
index 0000000..b5f6558
--- /dev/null
+++ b/Help/release/dev/check-fortran-run.rst
@@ -0,0 +1,6 @@
+check-fortran-run
+-----------------
+
+* A :module:`CheckFortranSourceRuns` module was added to provide a
+ :command:`check_fortran_source_runs` command to check if a Fortran
+ source snippet compiles and runs.
diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst
new file mode 100644
index 0000000..2c99780
--- /dev/null
+++ b/Help/release/dev/deprecate-policy-old.rst
@@ -0,0 +1,8 @@
+deprecate-policy-old
+--------------------
+
+* An explicit deprecation diagnostic was added for policies ``CMP0064``
+ and ``CMP0065`` (``CMP0063`` and below were already deprecated).
+ The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
+ of all policies are deprecated and that projects should port to the
+ NEW behaviors.
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index 628b541..02744a9 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -22,9 +22,6 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
if(NOT CMAKE_COMPILER_IS_GNUCXX)
include(TestCXXAcceptsFlag)
set(CMAKE_TRY_ANSI_CXX_FLAGS "")
- if(CMAKE_SYSTEM_NAME MATCHES "IRIX")
- set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
- endif()
if(CMAKE_SYSTEM_NAME MATCHES "OSF")
set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
endif()
diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h
index 6f36b03..45532af 100644
--- a/Modules/CMakeCompilerABI.h
+++ b/Modules/CMakeCompilerABI.h
@@ -10,16 +10,10 @@ const char info_sizeof_dptr[] = {
};
/* Application Binary Interface. */
-#if defined(__sgi) && defined(_ABIO32)
-# define ABI_ID "ELF O32"
-#elif defined(__sgi) && defined(_ABIN32)
-# define ABI_ID "ELF N32"
-#elif defined(__sgi) && defined(_ABI64)
-# define ABI_ID "ELF 64"
/* Check for (some) ARM ABIs.
* See e.g. http://wiki.debian.org/ArmEabiPort for some information on this. */
-#elif defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
+#if defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
# define ABI_ID "ELF ARMEABI"
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEB__)
# define ABI_ID "ELF ARM"
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index f2d43b6..9b2a91f 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -135,9 +135,6 @@ function(compiler_id_detection outvar lang)
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
-#elif defined(__sgi)
-# define ${CID_PREFIX}COMPILER_ID \"MIPSpro\"
-
#elif defined(__hpux) || defined(__hpua)
# define ${CID_PREFIX}COMPILER_ID \"HP\"
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 600d558..dc208c6 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -13,7 +13,6 @@
# BSD/OS BSD/OS
# FreeBSD FreeBSD
# HP-UX HP-UX
-# IRIX IRIX
# Linux Linux
# GNU/kFreeBSD GNU/kFreeBSD
# NetBSD NetBSD
diff --git a/Modules/CMakeFortranCompilerABI.F b/Modules/CMakeFortranCompilerABI.F
index b34c284..f4a5489 100644
--- a/Modules/CMakeFortranCompilerABI.F
+++ b/Modules/CMakeFortranCompilerABI.F
@@ -33,13 +33,7 @@
#if 0
! Application Binary Interface
#endif
-#if defined(__sgi) && defined(_ABIO32)
- PRINT *, 'INFO:abi[ELF O32]'
-#elif defined(__sgi) && defined(_ABIN32)
- PRINT *, 'INFO:abi[ELF N32]'
-#elif defined(__sgi) && defined(_ABI64)
- PRINT *, 'INFO:abi[ELF 64]'
-#elif defined(__ELF__)
+#if defined(__ELF__)
PRINT *, 'INFO:abi[ELF]'
#endif
PRINT *, 'ABI Detection'
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index da3d953..5995694 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -105,8 +105,6 @@
# endif
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
PRINT *, 'INFO:compiler[VisualAge]'
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
- PRINT *, 'INFO:compiler[MIPSpro]'
#elif defined(__hpux) || defined(__hpux__)
PRINT *, 'INFO:compiler[HP]'
#elif defined(NAGFOR)
@@ -114,11 +112,7 @@
#define COMPILER_VERSION_MAJOR DEC(__NAG_COMPILER_RELEASE/10)
#define COMPILER_VERSION_MINOR DEC(__NAG_COMPILER_RELEASE % 10)
#define COMPILER_VERSION_PATCH DEC(__NAG_COMPILER_BUILD)
-#elif 1
-# if 0
-! The above 'elif 1' instead of 'else' is to work around a bug in the
-! SGI preprocessor which produces both the __sgi and else blocks.
-# endif
+#else
PRINT *, 'INFO:compiler[]'
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
@@ -148,8 +142,6 @@
PRINT *, 'INFO:platform[SunOS]'
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
PRINT *, 'INFO:platform[AIX]'
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
- PRINT *, 'INFO:platform[IRIX]'
#elif defined(__hpux) || defined(__hpux__)
PRINT *, 'INFO:platform[HP-UX]'
#elif defined(__HAIKU__)
@@ -178,11 +170,7 @@
PRINT *, 'INFO:platform[ULTRIX]'
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
PRINT *, 'INFO:platform[Xenix]'
-#elif 1
-# if 0
-! The above 'elif 1' instead of 'else' is to work around a bug in the
-! SGI preprocessor which produces both the __sgi and else blocks.
-# endif
+#else
PRINT *, 'INFO:platform[]'
#endif
#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC))
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index dd77379..c2b5aa9 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -32,9 +32,6 @@
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-# define PLATFORM_ID "IRIX"
-
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index b3e83dd..1820407 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -26,7 +26,8 @@ Check if given Fortran source compiles and links into an executable.
if anything in the output matches any of the specified regular expressions.
By default, the test source file will be given a ``.F`` file extension. The
- ``SRC_EXT`` option can be used to override this with ``.<extension>`` instead.
+ ``SRC_EXT`` option can be used to override this with ``.<extension>`` instead--
+ ``.F90`` is a typical choice.
The underlying check is performed by the :command:`try_compile` command. The
compile and link commands can be influenced by setting any of the following
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
new file mode 100644
index 0000000..58d90d7
--- /dev/null
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -0,0 +1,158 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+CheckFortranSourceRuns
+----------------------
+
+Check if given Fortran source compiles and links into an executable and can
+subsequently be run.
+
+.. command:: check_fortran_source_runs
+
+ .. code-block:: cmake
+
+ check_fortran_source_runs(<code> <resultVar>
+ [SRC_EXT <extension>])
+
+ Check that the source supplied in ``<code>`` can be compiled as a Fortran source
+ file, linked as an executable and then run. The ``<code>`` must contain at
+ least ``program; end program`` statements. If the ``<code>`` could be built and run
+ successfully, the internal cache variable specified by ``<resultVar>`` will
+ be set to 1, otherwise it will be set to an value that evaluates to boolean
+ false (e.g. an empty string or an error message).
+
+ By default, the test source file will be given a ``.F90`` file extension. The
+ ``SRC_EXT`` option can be used to override this with ``.<extension>`` instead.
+
+ The underlying check is performed by the :command:`try_run` command. The
+ compile and link commands can be influenced by setting any of the following
+ variables prior to calling ``check_fortran_source_runs()``:
+
+ ``CMAKE_REQUIRED_FLAGS``
+ Additional flags to pass to the compiler. Note that the contents of
+ :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
+ configuration-specific variable are automatically added to the compiler
+ command before the contents of ``CMAKE_REQUIRED_FLAGS``.
+
+ ``CMAKE_REQUIRED_DEFINITIONS``
+ A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
+ ``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
+ ``<resultVar>`` will also be added automatically.
+
+ ``CMAKE_REQUIRED_INCLUDES``
+ A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler. These will be the only header search paths used by
+ ``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
+ directory property will be ignored.
+
+ ``CMAKE_REQUIRED_LINK_OPTIONS``
+ A :ref:`;-list <CMake Language Lists>` of options to add to the link
+ command (see :command:`try_run` for further details).
+
+ ``CMAKE_REQUIRED_LIBRARIES``
+ A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. These can be the name of system libraries or they can be
+ :ref:`Imported Targets <Imported Targets>` (see :command:`try_run` for
+ further details).
+
+ ``CMAKE_REQUIRED_QUIET``
+ If this variable evaluates to a boolean true value, all status messages
+ associated with the check will be suppressed.
+
+ The check is only performed once, with the result cached in the variable
+ named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``<code>`` changes.
+ In order to force the check to be re-evaluated, the variable named by
+ ``<resultVar>`` must be manually removed from the cache.
+
+#]=======================================================================]
+
+include_guard(GLOBAL)
+
+macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
+ if(NOT DEFINED "${VAR}")
+ set(_SRC_EXT)
+ set(_key)
+ foreach(arg ${ARGN})
+ if("${arg}" MATCHES "^(SRC_EXT)$")
+ set(_key "${arg}")
+ elseif(_key)
+ list(APPEND _${_key} "${arg}")
+ else()
+ message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
+ endif()
+ endforeach()
+ if(NOT _SRC_EXT)
+ set(_SRC_EXT F90)
+ endif()
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
+ "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
+ if(CMAKE_REQUIRED_LIBRARIES)
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES
+ LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+ else()
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
+ "${SOURCE}\n")
+
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR}")
+ endif()
+ try_run(${VAR}_EXITCODE ${VAR}_COMPILED
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS}
+ ${CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
+ "${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}"
+ COMPILE_OUTPUT_VARIABLE OUTPUT)
+
+ # if it did not compile make the return value fail code of 1
+ if(NOT ${VAR}_COMPILED)
+ set(${VAR}_EXITCODE 1)
+ endif()
+ # if the return value was 0 then it worked
+ if("${${VAR}_EXITCODE}" EQUAL 0)
+ set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR} - Success")
+ endif()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n"
+ "${OUTPUT}\n"
+ "Return value: ${${VAR}}\n"
+ "Source file was:\n${SOURCE}\n")
+ else()
+ if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ set(${VAR} "${${VAR}_EXITCODE}")
+ else()
+ set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ endif()
+
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR} - Failed")
+ endif()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n"
+ "${OUTPUT}\n"
+ "Return value: ${${VAR}_EXITCODE}\n"
+ "Source file was:\n${SOURCE}\n")
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake
deleted file mode 100644
index 12b0f37..0000000
--- a/Modules/Platform/IRIX.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-set(CMAKE_DL_LIBS "")
-set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
-if(NOT CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_CREATE_STATIC_LIBRARY
- "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
- set (CMAKE_CXX_FLAGS_INIT "")
- set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
- set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
- set (CMAKE_C_FLAGS_INIT "")
-endif()
-# set flags for gcc support
-include(Platform/UnixPaths)
-
-if(NOT CMAKE_COMPILER_IS_GNUCC)
- set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_C_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-if(NOT CMAKE_COMPILER_IS_GNUCXX)
- set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-if(NOT CMAKE_COMPILER_IS_GNUG77)
- set (CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_Fortran_COMPILER> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-# Initialize C link type selection flags. These flags are used when
-# building a shared library, shared module, or executable that links
-# to other libraries to select whether to use the static or shared
-# versions of the libraries.
-foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
- set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach()
-
-# The IRIX linker needs to find transitive shared library dependencies
-# in the -L path.
-set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake
deleted file mode 100644
index ee9b96e..0000000
--- a/Modules/Platform/IRIX64.cmake
+++ /dev/null
@@ -1,73 +0,0 @@
-set(CMAKE_DL_LIBS "")
-set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
-set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-if(NOT CMAKE_COMPILER_IS_GNUCC)
- # Set default flags init.
- set(CMAKE_C_FLAGS_INIT "")
- set(CMAKE_CXX_FLAGS_INIT "")
- set(CMAKE_Fortran_FLAGS_INIT "")
- set(CMAKE_EXE_LINKER_FLAGS_INIT "")
- set(CMAKE_SHARED_LINKER_FLAGS_INIT "")
- set(CMAKE_MODULE_LINKER_FLAGS_INIT "")
-
- # If no -o32, -n32, or -64 flag is given, set a reasonable default.
- if("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
- else()
- # Check if this is a 64-bit CMake.
- if(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
- exec_program(file ARGS ${CMAKE_COMMAND} OUTPUT_VARIABLE CMAKE_FILE_SELF)
- set(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL
- "Output of file command on ${CMAKE_COMMAND}.")
- endif()
-
- # Set initial flags to match cmake executable.
- if(CMAKE_FILE_SELF MATCHES " 64-bit ")
- set(CMAKE_C_FLAGS_INIT "-64")
- set(CMAKE_CXX_FLAGS_INIT "-64")
- set(CMAKE_Fortran_FLAGS_INIT "-64")
- set(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
- set(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
- set(CMAKE_MODULE_LINKER_FLAGS_INIT "-64")
- endif()
- endif()
-
- # Set remaining defaults.
- set(CMAKE_CXX_CREATE_STATIC_LIBRARY
- "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
- set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
- set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-endif()
-include(Platform/UnixPaths)
-
-if(NOT CMAKE_COMPILER_IS_GNUCC)
- set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_C_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-if(NOT CMAKE_COMPILER_IS_GNUCXX)
- set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-# Initialize C link type selection flags. These flags are used when
-# building a shared library, shared module, or executable that links
-# to other libraries to select whether to use the static or shared
-# versions of the libraries.
-foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
- set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach()
-
-# The IRIX linker needs to find transitive shared library dependencies
-# in the -L path.
-set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 05f56d8..e4b4e53 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -12,7 +12,7 @@ Determine the number of processors/cores and save value in ${var}
Sets the variable named ${var} to the number of physical cores
available on the machine if the information can be determined.
Otherwise it is set to 0. Currently this functionality is implemented
-for AIX, cygwin, FreeBSD, HPUX, IRIX, Linux, macOS, QNX, Sun and
+for AIX, cygwin, FreeBSD, HPUX, Linux, macOS, QNX, Sun and
Windows.
This function is guaranteed to return a positive integer (>=1) if it
@@ -115,22 +115,6 @@ function(ProcessorCount var)
endif()
if(NOT count)
- # IRIX (systems with hinv):
- find_program(ProcessorCount_cmd_hinv hinv
- PATHS /sbin)
- mark_as_advanced(ProcessorCount_cmd_hinv)
- if(ProcessorCount_cmd_hinv)
- execute_process(COMMAND ${ProcessorCount_cmd_hinv}
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE
- OUTPUT_VARIABLE hinv_output)
- string(REGEX MATCHALL "([0-9]+) .* Processors" procs "${hinv_output}")
- set(count "${CMAKE_MATCH_1}")
- #message("ProcessorCount: trying hinv '${ProcessorCount_cmd_hinv}'")
- endif()
- endif()
-
- if(NOT count)
# AIX (systems with lsconf):
find_program(ProcessorCount_cmd_lsconf lsconf
PATHS /usr/sbin)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 2c83140..7ae4417 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 13)
-set(CMake_VERSION_PATCH 20190111)
+set(CMake_VERSION_PATCH 20190115)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index ee1070f..b43f1c9 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -10,6 +10,7 @@
#include "cmWorkingDirectory.h"
#include <cstring>
+#include <map>
#include <ostream>
#include <utility>
#include <vector>
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 9f7b236..ff69418 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -13,6 +13,7 @@
#include "cmsys/FStream.hxx"
+#include <map>
#include <utility>
#include <vector>
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index ef0d118..e55ea87 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -6,6 +6,7 @@
#include <sstream>
#include <stdio.h>
#include <string>
+#include <vector>
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx
index 18412ba..488d237 100644
--- a/Source/CTest/cmParseMumpsCoverage.cxx
+++ b/Source/CTest/cmParseMumpsCoverage.cxx
@@ -9,6 +9,7 @@
#include <map>
#include <string>
#include <utility>
+#include <vector>
cmParseMumpsCoverage::cmParseMumpsCoverage(
cmCTestCoverageHandlerContainer& cont, cmCTest* ctest)
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index c4cf046..7737f65 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -7,7 +7,6 @@
#include "cmCTestTestHandler.h"
#include "cmsys/Process.h"
-#include <algorithm>
#include <fcntl.h>
#include <iostream>
#include <signal.h>
@@ -15,6 +14,7 @@
#if !defined(_WIN32)
# include <unistd.h>
#endif
+#include <utility>
#define CM_PROCESS_BUF_SIZE 65536
diff --git a/Source/LexerParser/cmCommandArgumentLexer.cxx b/Source/LexerParser/cmCommandArgumentLexer.cxx
index 6b4fc85..c96f8b3 100644
--- a/Source/LexerParser/cmCommandArgumentLexer.cxx
+++ b/Source/LexerParser/cmCommandArgumentLexer.cxx
@@ -664,6 +664,8 @@ Modify cmCommandArgumentLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include "cmCommandArgumentParserHelper.h"
/* Replace the lexer input function. */
@@ -2246,3 +2248,5 @@ void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
BEGIN(ESCAPES);
}
}
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmCommandArgumentLexer.in.l b/Source/LexerParser/cmCommandArgumentLexer.in.l
index 5927b9e..79275dd 100644
--- a/Source/LexerParser/cmCommandArgumentLexer.in.l
+++ b/Source/LexerParser/cmCommandArgumentLexer.in.l
@@ -18,6 +18,8 @@ Modify cmCommandArgumentLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include "cmCommandArgumentParserHelper.h"
/* Replace the lexer input function. */
@@ -145,3 +147,5 @@ void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
BEGIN(ESCAPES);
}
}
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmDependsJavaLexer.cxx b/Source/LexerParser/cmDependsJavaLexer.cxx
index 36cac61..ed6eea9 100644
--- a/Source/LexerParser/cmDependsJavaLexer.cxx
+++ b/Source/LexerParser/cmDependsJavaLexer.cxx
@@ -860,6 +860,8 @@ Modify cmDependsJavaLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include <iostream>
#include "cmDependsJavaParserHelper.h"
@@ -2811,3 +2813,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
}
#define YYTABLES_NAME "yytables"
+
+/*--------------------------------------------------------------------------*/
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmDependsJavaLexer.in.l b/Source/LexerParser/cmDependsJavaLexer.in.l
index 01a0fa3..b48d1bd 100644
--- a/Source/LexerParser/cmDependsJavaLexer.in.l
+++ b/Source/LexerParser/cmDependsJavaLexer.in.l
@@ -18,6 +18,8 @@ Modify cmDependsJavaLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include <iostream>
#include "cmDependsJavaParserHelper.h"
@@ -173,3 +175,7 @@ null { PRIMITIVE; return jp_NULLLITERAL; }
}
%%
+
+/*--------------------------------------------------------------------------*/
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmExprLexer.cxx b/Source/LexerParser/cmExprLexer.cxx
index cb24687..fd0f745 100644
--- a/Source/LexerParser/cmExprLexer.cxx
+++ b/Source/LexerParser/cmExprLexer.cxx
@@ -664,6 +664,8 @@ Modify cmExprLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include "cmExprParserHelper.h"
/* Replace the lexer input function. */
@@ -2223,3 +2225,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
}
#define YYTABLES_NAME "yytables"
+
+/*--------------------------------------------------------------------------*/
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmExprLexer.in.l b/Source/LexerParser/cmExprLexer.in.l
index 2197c2a..89d1381 100644
--- a/Source/LexerParser/cmExprLexer.in.l
+++ b/Source/LexerParser/cmExprLexer.in.l
@@ -18,6 +18,8 @@ Modify cmExprLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include "cmExprParserHelper.h"
/* Replace the lexer input function. */
@@ -61,3 +63,7 @@ Modify cmExprLexer.cxx:
. { yyextra->UnexpectedChar(yytext[0]); }
%%
+
+/*--------------------------------------------------------------------------*/
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx
index 82048df..f12df29 100644
--- a/Source/LexerParser/cmFortranLexer.cxx
+++ b/Source/LexerParser/cmFortranLexer.cxx
@@ -838,6 +838,8 @@ Modify cmFortranLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#undef YY_NO_UNPUT
#define cmFortranLexer_cxx
@@ -2610,3 +2612,5 @@ YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return YY_CURRENT_BUFFER;
}
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l
index b7e837b..f752f37 100644
--- a/Source/LexerParser/cmFortranLexer.in.l
+++ b/Source/LexerParser/cmFortranLexer.in.l
@@ -27,6 +27,8 @@ Modify cmFortranLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#undef YY_NO_UNPUT
#define cmFortranLexer_cxx
@@ -183,3 +185,5 @@ YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return YY_CURRENT_BUFFER;
}
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index 1f9f580..106e7a7 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -5,6 +5,7 @@
#include "cmsys/Directory.hxx"
#include <algorithm>
#include <stddef.h>
+#include <utility>
#include "cmAlgorithms.h"
#include "cmMakefile.h"
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 27b8599..29483f9 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -30,7 +30,7 @@ Notes about linking on various platforms:
------------------------------------------------------------------------------
-Linux, FreeBSD, macOS, IRIX, Sun, Windows:
+Linux, FreeBSD, macOS, Sun, Windows:
Linking to libraries using the full path works fine.
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 2dfba04..fafb079 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmDocumentation.h"
-#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmDocumentationSection.h"
#include "cmRST.h"
@@ -55,11 +54,6 @@ cmDocumentation::cmDocumentation()
this->ShowGenerators = true;
}
-cmDocumentation::~cmDocumentation()
-{
- cmDeleteAll(this->AllSections);
-}
-
bool cmDocumentation::PrintVersion(std::ostream& os)
{
/* clang-format off */
@@ -174,20 +168,16 @@ void cmDocumentation::WarnFormFromFilename(
void cmDocumentation::addCommonStandardDocSections()
{
- cmDocumentationSection* sec;
-
- sec = new cmDocumentationSection("Options", "OPTIONS");
- sec->Append(cmDocumentationStandardOptions);
- this->AllSections["Options"] = sec;
+ cmDocumentationSection sec{ "Options" };
+ sec.Append(cmDocumentationStandardOptions);
+ this->AllSections.emplace("Options", std::move(sec));
}
void cmDocumentation::addCMakeStandardDocSections()
{
- cmDocumentationSection* sec;
-
- sec = new cmDocumentationSection("Generators", "GENERATORS");
- sec->Append(cmDocumentationGeneratorsHeader);
- this->AllSections["Generators"] = sec;
+ cmDocumentationSection sec{ "Generators" };
+ sec.Append(cmDocumentationGeneratorsHeader);
+ this->AllSections.emplace("Generators", std::move(sec));
}
void cmDocumentation::addCTestStandardDocSections()
@@ -199,11 +189,7 @@ void cmDocumentation::addCTestStandardDocSections()
void cmDocumentation::addCPackStandardDocSections()
{
- cmDocumentationSection* sec;
-
- sec = new cmDocumentationSection("Generators", "GENERATORS");
- sec->Append(cmDocumentationGeneratorsHeader);
- this->AllSections["Generators"] = sec;
+ addCMakeStandardDocSections();
}
bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
@@ -364,91 +350,59 @@ void cmDocumentation::SetName(const std::string& name)
}
void cmDocumentation::SetSection(const char* name,
- cmDocumentationSection* section)
+ cmDocumentationSection section)
{
- if (this->AllSections.find(name) != this->AllSections.end()) {
- delete this->AllSections[name];
- }
- this->AllSections[name] = section;
+ this->SectionAtName(name) = std::move(section);
}
void cmDocumentation::SetSection(const char* name,
std::vector<cmDocumentationEntry>& docs)
{
- cmDocumentationSection* sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- sec->Append(docs);
- this->SetSection(name, sec);
+ cmDocumentationSection sec{ name };
+ sec.Append(docs);
+ this->SetSection(name, std::move(sec));
}
void cmDocumentation::SetSection(const char* name, const char* docs[][2])
{
- cmDocumentationSection* sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- sec->Append(docs);
- this->SetSection(name, sec);
+ cmDocumentationSection sec{ name };
+ sec.Append(docs);
+ this->SetSection(name, std::move(sec));
}
void cmDocumentation::SetSections(
- std::map<std::string, cmDocumentationSection*>& sections)
+ std::map<std::string, cmDocumentationSection> sections)
{
- for (auto const& s : sections) {
- this->SetSection(s.first.c_str(), s.second);
+ for (auto& s : sections) {
+ this->SetSection(s.first.c_str(), std::move(s.second));
}
}
+cmDocumentationSection& cmDocumentation::SectionAtName(const char* name)
+{
+ return this->AllSections.emplace(name, cmDocumentationSection{ name })
+ .first->second;
+}
void cmDocumentation::PrependSection(const char* name, const char* docs[][2])
{
- cmDocumentationSection* sec = nullptr;
- if (this->AllSections.find(name) == this->AllSections.end()) {
- sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- this->SetSection(name, sec);
- } else {
- sec = this->AllSections[name];
- }
- sec->Prepend(docs);
+ this->SectionAtName(name).Prepend(docs);
}
void cmDocumentation::PrependSection(const char* name,
std::vector<cmDocumentationEntry>& docs)
{
- cmDocumentationSection* sec = nullptr;
- if (this->AllSections.find(name) == this->AllSections.end()) {
- sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- this->SetSection(name, sec);
- } else {
- sec = this->AllSections[name];
- }
- sec->Prepend(docs);
+ this->SectionAtName(name).Prepend(docs);
}
void cmDocumentation::AppendSection(const char* name, const char* docs[][2])
{
- cmDocumentationSection* sec = nullptr;
- if (this->AllSections.find(name) == this->AllSections.end()) {
- sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- this->SetSection(name, sec);
- } else {
- sec = this->AllSections[name];
- }
- sec->Append(docs);
+ this->SectionAtName(name).Append(docs);
}
void cmDocumentation::AppendSection(const char* name,
std::vector<cmDocumentationEntry>& docs)
{
- cmDocumentationSection* sec = nullptr;
- if (this->AllSections.find(name) == this->AllSections.end()) {
- sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- this->SetSection(name, sec);
- } else {
- sec = this->AllSections[name];
- }
- sec->Append(docs);
+ this->SectionAtName(name).Append(docs);
}
void cmDocumentation::AppendSection(const char* name,
@@ -631,11 +585,10 @@ bool cmDocumentation::PrintHelpListPolicies(std::ostream& os)
bool cmDocumentation::PrintHelpListGenerators(std::ostream& os)
{
- std::map<std::string, cmDocumentationSection*>::iterator si;
- si = this->AllSections.find("Generators");
+ const auto si = this->AllSections.find("Generators");
if (si != this->AllSections.end()) {
this->Formatter.SetIndent(" ");
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
return true;
}
@@ -661,29 +614,27 @@ bool cmDocumentation::PrintHelpListVariables(std::ostream& os)
bool cmDocumentation::PrintUsage(std::ostream& os)
{
- std::map<std::string, cmDocumentationSection*>::iterator si;
- si = this->AllSections.find("Usage");
+ const auto si = this->AllSections.find("Usage");
if (si != this->AllSections.end()) {
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
return true;
}
bool cmDocumentation::PrintHelp(std::ostream& os)
{
- std::map<std::string, cmDocumentationSection*>::iterator si;
- si = this->AllSections.find("Usage");
+ auto si = this->AllSections.find("Usage");
if (si != this->AllSections.end()) {
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
si = this->AllSections.find("Options");
if (si != this->AllSections.end()) {
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
if (this->ShowGenerators) {
si = this->AllSections.find("Generators");
if (si != this->AllSections.end()) {
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
}
return true;
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 153bad6..b2ff01a 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -6,13 +6,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmDocumentationFormatter.h"
+#include "cmDocumentationSection.h"
#include <iosfwd>
#include <map>
#include <string>
#include <vector>
-class cmDocumentationSection;
struct cmDocumentationEntry;
/** Class to generate documentation. */
@@ -21,8 +21,6 @@ class cmDocumentation : public cmDocumentationEnums
public:
cmDocumentation();
- ~cmDocumentation();
-
/**
* Check command line arguments for documentation options. Returns
* true if documentation options are found, and false otherwise.
@@ -52,11 +50,11 @@ public:
/** Set a section of the documentation. Typical sections include Name,
Usage, Description, Options */
- void SetSection(const char* sectionName, cmDocumentationSection* section);
+ void SetSection(const char* sectionName, cmDocumentationSection section);
void SetSection(const char* sectionName,
std::vector<cmDocumentationEntry>& docs);
void SetSection(const char* sectionName, const char* docs[][2]);
- void SetSections(std::map<std::string, cmDocumentationSection*>& sections);
+ void SetSections(std::map<std::string, cmDocumentationSection> sections);
/** Add the documentation to the beginning/end of the section */
void PrependSection(const char* sectionName, const char* docs[][2]);
@@ -110,7 +108,8 @@ private:
bool ShowGenerators;
std::string NameString;
- std::map<std::string, cmDocumentationSection*> AllSections;
+ std::map<std::string, cmDocumentationSection> AllSections;
+ cmDocumentationSection& SectionAtName(const char* name);
std::string CurrentArgument;
diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h
index d9e8187..7031b52 100644
--- a/Source/cmDocumentationSection.h
+++ b/Source/cmDocumentationSection.h
@@ -19,7 +19,7 @@ class cmDocumentationSection
{
public:
/** Create a cmSection, with a special name for man-output mode. */
- cmDocumentationSection(const char* name, const char*)
+ explicit cmDocumentationSection(const char* name)
: Name(name)
{
}
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 93115b6..3821144 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -4,6 +4,7 @@
#include "cmAlgorithms.h"
#include "cmExportSet.h"
+#include "cmExportSetMap.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
@@ -21,8 +22,6 @@
#include <sstream>
#include <utility>
-class cmExportSetMap;
-
cmExportInstallFileGenerator::cmExportInstallFileGenerator(
cmInstallExportGenerator* iegen)
: IEGen(iegen)
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index e7f3ada..84fcb95 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -5,6 +5,7 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
#include <assert.h>
+#include <map>
#include <sstream>
#include <stdio.h>
#include <utility>
diff --git a/Source/cmFileAPICMakeFiles.cxx b/Source/cmFileAPICMakeFiles.cxx
index 799a047..5590bc2 100644
--- a/Source/cmFileAPICMakeFiles.cxx
+++ b/Source/cmFileAPICMakeFiles.cxx
@@ -12,6 +12,7 @@
#include "cm_jsoncpp_value.h"
#include <string>
+#include <vector>
namespace {
diff --git a/Source/cmFileAPICache.cxx b/Source/cmFileAPICache.cxx
index 074994a..f96bc90 100644
--- a/Source/cmFileAPICache.cxx
+++ b/Source/cmFileAPICache.cxx
@@ -10,6 +10,7 @@
#include <algorithm>
#include <string>
+#include <utility>
#include <vector>
namespace {
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index fc9c1d2..475eee4 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <utility>
#include <vector>
#include "cmAlgorithms.h"
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 5a5d036..bcf876d 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -7,6 +7,7 @@
#include <set>
#include <stdio.h>
#include <string.h>
+#include <utility>
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index db72353..ceee500 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -7,6 +7,7 @@
#include <sstream>
#include <utility>
+#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
@@ -494,6 +495,7 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
const std::string& targetName, const std::string& /*config*/, bool fast,
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
{
+ std::unique_ptr<cmMakefile> mfu;
cmMakefile* mf;
if (!this->Makefiles.empty()) {
mf = this->Makefiles[0];
@@ -504,7 +506,8 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
snapshot.GetDirectory().SetCurrentBinary(
this->CMakeInstance->GetHomeOutputDirectory());
snapshot.SetDefaultDefinitions();
- mf = new cmMakefile(this, snapshot);
+ mfu = cm::make_unique<cmMakefile>(this, snapshot);
+ mf = mfu.get();
}
makeCommand.push_back(this->SelectMakeProgram(makeProgram));
@@ -529,9 +532,6 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.push_back(std::move(tname));
}
- if (this->Makefiles.empty()) {
- delete mf;
- }
}
void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index caec67d..549a263 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -4,6 +4,7 @@
#include <algorithm>
#include <set>
+#include <utility>
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index d441e41..4cc081c 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -3,6 +3,7 @@
#include "cmInstallExportGenerator.h"
#include <algorithm>
+#include <map>
#include <sstream>
#include <utility>
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx
index 0da6f4f..bb56714 100644
--- a/Source/cmJsonObjects.cxx
+++ b/Source/cmJsonObjects.cxx
@@ -14,6 +14,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
+#include "cmPropertyMap.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmStateDirectory.h"
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 9b63d24..3644da1 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -12,6 +12,7 @@
#include <stdexcept>
#include <stdio.h>
#include <stdlib.h> // required for atoi
+#include <utility>
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 68a5101..891ca61 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4232,7 +4232,11 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
// Deprecate old policies, especially those that require a lot
// of code to maintain the old behavior.
- if (status == cmPolicies::OLD && id <= cmPolicies::CMP0063) {
+ if (status == cmPolicies::OLD && id <= cmPolicies::CMP0065 &&
+ !(this->GetCMakeInstance()->GetIsInTryCompile() &&
+ (
+ // Policies set by cmCoreTryCompile::TryCompileCode.
+ id == cmPolicies::CMP0065))) {
this->IssueMessage(cmake::DEPRECATION_WARNING,
cmPolicies::GetPolicyDeprecatedWarning(id));
}
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 846b12c..92eeb2e 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -6,6 +6,7 @@
#include <memory> // IWYU pragma: keep
#include <sstream>
#include <string>
+#include <utility>
#include <vector>
#include "cmGeneratedFileStream.h"
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 2d2915c..0c2d7b3 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -6,6 +6,7 @@
#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stddef.h>
+#include <utility>
#include <vector>
#include "cmGeneratedFileStream.h"
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 324afbf..b62da66 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -9,6 +9,7 @@
#include <memory> // IWYU pragma: keep
#include <set>
#include <sstream>
+#include <utility>
#include "cmAlgorithms.h"
#include "cmCustomCommandGenerator.h"
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 228c9fb..1ef12d0 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -10,6 +10,7 @@
#include <map>
#include <memory> // IWYU pragma: keep
#include <sstream>
+#include <utility>
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
diff --git a/Source/cmPipeConnection.cxx b/Source/cmPipeConnection.cxx
index 3dab2f0..999d6f3 100644
--- a/Source/cmPipeConnection.cxx
+++ b/Source/cmPipeConnection.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmPipeConnection.h"
-#include <algorithm>
+#include <utility>
#include "cmServer.h"
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index 000529d..2786646 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -9,6 +9,7 @@
#include <algorithm>
#include <iterator>
#include <sstream>
+#include <utility>
// - Static variables
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index 678ff14..f4cf3e0 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -13,6 +13,7 @@
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cmake.h"
#include <memory>
#include <utility>
@@ -86,10 +87,43 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
bool const validQt = (qtVersion.Major == 4) ||
(qtVersion.Major == 5) || (qtVersion.Major == 6);
- bool const mocIsValid = moc && (validQt || !mocExec.empty());
- bool const uicIsValid = uic && (validQt || !uicExec.empty());
- bool const rccIsValid = rcc && (validQt || !rccExec.empty());
+ bool const mocAvailable = (validQt || !mocExec.empty());
+ bool const uicAvailable = (validQt || !uicExec.empty());
+ bool const rccAvailable = (validQt || !rccExec.empty());
+ bool const mocIsValid = (moc && mocAvailable);
+ bool const uicIsValid = (uic && uicAvailable);
+ bool const rccIsValid = (rcc && uicAvailable);
+ // Disabled AUTOMOC/UIC/RCC warning
+ bool const mocDisabled = (moc && !mocAvailable);
+ bool const uicDisabled = (uic && !uicAvailable);
+ bool const rccDisabled = (rcc && !rccAvailable);
+ if (mocDisabled || uicDisabled || rccDisabled) {
+ std::string msg = "AUTOGEN: No valid Qt version found for target ";
+ msg += target->GetName();
+ msg += ". ";
+ {
+ std::vector<std::string> lst;
+ if (mocDisabled) {
+ lst.emplace_back("AUTOMOC");
+ }
+ if (uicDisabled) {
+ lst.emplace_back("AUTOUIC");
+ }
+ if (rccDisabled) {
+ lst.emplace_back("AUTORCC");
+ }
+ msg += cmJoin(lst, ", ");
+ }
+ msg += " disabled. Consider adding:\n";
+ if (uicDisabled) {
+ msg += " find_package(Qt5 COMPONENTS Widgets)\n";
+ } else {
+ msg += " find_package(Qt5 COMPONENTS Core)\n";
+ }
+ msg += "to your CMakeLists.txt file.";
+ target->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg);
+ }
if (mocIsValid || uicIsValid || rccIsValid) {
// Create autogen target initializer
Initializers_.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 734b2d7..f2f4cad 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -14,6 +14,7 @@
#include "cmake.h"
#include <algorithm>
+#include <utility>
// -- Class methods
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index e6ee85b..9658e97 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -1,19 +1,21 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmQtAutoGeneratorMocUic.h"
-#include "cmQtAutoGen.h"
#include <algorithm>
#include <array>
+#include <cstddef>
#include <functional>
#include <list>
#include <memory>
+#include <set>
#include <sstream>
#include <utility>
#include "cmAlgorithms.h"
#include "cmCryptoHash.h"
#include "cmMakefile.h"
+#include "cmQtAutoGen.h"
#include "cmSystemTools.h"
#include "cmake.h"
diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h
index edf597c..9ec1def 100644
--- a/Source/cmQtAutoGeneratorMocUic.h
+++ b/Source/cmQtAutoGeneratorMocUic.h
@@ -11,7 +11,6 @@
#include "cm_uv.h"
#include "cmsys/RegularExpression.hxx"
-#include <algorithm>
#include <condition_variable>
#include <cstddef>
#include <deque>
@@ -21,6 +20,7 @@
#include <set>
#include <string>
#include <thread>
+#include <utility>
#include <vector>
class cmMakefile;
diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx
index 1fc8cf8..5caa019 100644
--- a/Source/cmServerConnection.cxx
+++ b/Source/cmServerConnection.cxx
@@ -7,13 +7,13 @@
#include "cmServerDictionary.h"
#include "cm_uv.h"
-#include <algorithm>
#ifdef _WIN32
# include "io.h"
#else
# include <unistd.h>
#endif
#include <cassert>
+#include <utility>
cmStdIoConnection::cmStdIoConnection(
cmConnectionBufferStrategy* bufferStrategy)
diff --git a/Source/cmString.hxx b/Source/cmString.hxx
index e5ece52..49bad78 100644
--- a/Source/cmString.hxx
+++ b/Source/cmString.hxx
@@ -15,6 +15,7 @@
#include <ostream>
#include <string>
#include <type_traits>
+#include <utility>
namespace cm {
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index e4ced6e..1e2ddc7 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -11,12 +11,11 @@
#include "cmLocalGenerator.h"
#include "cmOutputConverter.h"
#include "cmProperty.h"
+#include "cmPropertyMap.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTest.h"
-class cmPropertyMap;
-
cmTestGenerator::cmTestGenerator(
cmTest* test, std::vector<std::string> const& configurations)
: cmScriptGenerator("CTEST_CONFIGURATION_TYPE", configurations)
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e1bae34..bfb066d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -610,16 +610,13 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
}
// Parse the args
-void cmake::SetArgs(const std::vector<std::string>& args,
- bool directoriesSetBefore)
+void cmake::SetArgs(const std::vector<std::string>& args)
{
- bool directoriesSet = directoriesSetBefore;
bool haveToolset = false;
bool havePlatform = false;
for (unsigned int i = 1; i < args.size(); ++i) {
std::string const& arg = args[i];
if (arg.find("-H", 0) == 0 || arg.find("-S", 0) == 0) {
- directoriesSet = true;
std::string path = arg.substr(2);
if (path.empty()) {
++i;
@@ -640,7 +637,6 @@ void cmake::SetArgs(const std::vector<std::string>& args,
} else if (arg.find("-O", 0) == 0) {
// There is no local generate anymore. Ignore -O option.
} else if (arg.find("-B", 0) == 0) {
- directoriesSet = true;
std::string path = arg.substr(2);
if (path.empty()) {
++i;
@@ -802,16 +798,27 @@ void cmake::SetArgs(const std::vector<std::string>& args,
this->SetGlobalGenerator(gen);
}
}
- // no option assume it is the path to the source
+ // no option assume it is the path to the source or an existing build
else {
- directoriesSet = true;
this->SetDirectoriesFromFile(arg.c_str());
}
}
- if (!directoriesSet) {
- this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
+
+ const bool haveSourceDir = !this->GetHomeDirectory().empty();
+ const bool haveBinaryDir = !this->GetHomeOutputDirectory().empty();
+
+ if (this->CurrentWorkingMode == cmake::NORMAL_MODE && !haveSourceDir &&
+ !haveBinaryDir) {
+ cmSystemTools::Error("No source or binary directory provided");
+ return;
+ }
+
+ if (!haveSourceDir) {
this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
}
+ if (!haveBinaryDir) {
+ this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
+ }
}
void cmake::SetDirectoriesFromFile(const char* arg)
diff --git a/Source/cmake.h b/Source/cmake.h
index d00acc7..3c06c56 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -277,8 +277,7 @@ public:
int GetSystemInformation(std::vector<std::string>&);
///! Parse command line arguments
- void SetArgs(const std::vector<std::string>&,
- bool directoriesSetBefore = false);
+ void SetArgs(const std::vector<std::string>& args);
///! Is this cmake running as a result of a TRY_COMPILE command
bool GetIsInTryCompile() const;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 75dabde..e52f2b3 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -285,12 +285,12 @@ int do_cmake(int ac, char const* const* av)
} else if (cmHasLiteralPrefix(av[i], "-P")) {
if (i == ac - 1) {
cmSystemTools::Error("No script specified for argument -P");
- } else {
- workingMode = cmake::SCRIPT_MODE;
- args.push_back(av[i]);
- i++;
- args.push_back(av[i]);
+ return 1;
}
+ workingMode = cmake::SCRIPT_MODE;
+ args.push_back(av[i]);
+ i++;
+ args.push_back(av[i]);
} else if (cmHasLiteralPrefix(av[i], "--find-package")) {
workingMode = cmake::FIND_PACKAGE_MODE;
args.push_back(av[i]);
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 930ced9..24e3dc8 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -44,6 +44,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <utility>
class cmConnection;
@@ -270,9 +271,12 @@ static int HandleCppLint(const std::string& runCmd,
<< "\n";
return 1;
}
- std::cerr << "Warning: cpplint diagnostics:\n";
- // Output the output from cpplint to stderr
- std::cerr << stdOut;
+ if (!stdOut.empty()) {
+ std::cerr << "Warning: cpplint diagnostics:\n";
+ // Output the output from cpplint to stderr
+ std::cerr << stdOut;
+ }
+
// always return 0 so the build can continue as cpplint returns non-zero
// for any warning
return 0;
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 094c2ee..f65690b 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -1162,7 +1162,7 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length,
case KWSYSPE_PIPE_STDERR:
wd->PipeId = kwsysProcess_Pipe_STDERR;
break;
- };
+ }
return 1;
}
} else if (n < 0 && errno == EAGAIN) {
diff --git a/Source/kwsys/testCommandLineArguments.cxx b/Source/kwsys/testCommandLineArguments.cxx
index ef87436..15f9c02 100644
--- a/Source/kwsys/testCommandLineArguments.cxx
+++ b/Source/kwsys/testCommandLineArguments.cxx
@@ -165,25 +165,26 @@ int testCommandLineArguments(int argc, char* argv[])
}
size_t cc;
#define CompareTwoLists(list1, list_valid, lsize) \
- if (list1.size() != lsize) { \
- std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \
- << " should be: " << lsize << std::endl; \
- res = 1; \
- } else { \
- std::cout << #list1 " argument set:"; \
- for (cc = 0; cc < lsize; ++cc) { \
- std::cout << " " << list1[cc]; \
- if (!CompareTwoItemsOnList(list1[cc], list_valid[cc])) { \
- std::cerr << "Problem setting " #list1 ". Value of " << cc \
- << " is: [" << list1[cc] << "] <> [" << list_valid[cc] \
- << "]" << std::endl; \
- res = 1; \
- break; \
+ do { \
+ if (list1.size() != lsize) { \
+ std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \
+ << " should be: " << lsize << std::endl; \
+ res = 1; \
+ } else { \
+ std::cout << #list1 " argument set:"; \
+ for (cc = 0; cc < lsize; ++cc) { \
+ std::cout << " " << list1[cc]; \
+ if (!CompareTwoItemsOnList(list1[cc], list_valid[cc])) { \
+ std::cerr << "Problem setting " #list1 ". Value of " << cc \
+ << " is: [" << list1[cc] << "] <> [" << list_valid[cc] \
+ << "]" << std::endl; \
+ res = 1; \
+ break; \
+ } \
} \
+ std::cout << std::endl; \
} \
- std::cout << std::endl; \
- }
-
+ } while (0)
CompareTwoLists(numbers_argument, valid_numbers, 10);
CompareTwoLists(doubles_argument, valid_doubles, 3);
CompareTwoLists(bools_argument, valid_bools, 3);
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index e165ff7..1c1da76 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -1,9 +1,9 @@
#include "cmUVHandlePtr.h"
-#include <algorithm>
#include <chrono>
#include <iostream>
#include <thread>
+#include <utility>
#include "cm_uv.h"
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 803e5f0..6b166d6 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -597,7 +597,6 @@ if(BUILD_TESTING)
else()
if (CMAKE_CXX_COMPILER_ID MATCHES "PGI"
OR CMAKE_CXX_COMPILER_ID MATCHES "PathScale"
- OR CMAKE_SYSTEM_NAME MATCHES "IRIX64"
OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(run_pic_test 0)
else()
diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
index 9157c76..f01e616 100644
--- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
+++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
@@ -415,78 +415,6 @@ set(hp_f90_64_dirs "/usr/lib/hpux64;/opt/langtools/lib/hpux64")
list(APPEND platforms hp_f90_64)
#-----------------------------------------------------------------------------
-# IRIX
-
-# cc -o32 dummy.c -v
-set(irix64_cc_o32_text "/usr/lib/ld -elf -_SYSTYPE_SVR4 -require_dynamic_link _rld_new_interface -no_unresolved -Wx,-G 0 -o32 -mips2 -call_shared -g0 -KPIC -L/usr/lib/ -nocount /usr/lib/crt1.o -count dummy.o -nocount -lc /usr/lib/crtn.o")
-set(irix64_cc_o32_libs "c")
-set(irix64_cc_o32_dirs "/usr/lib")
-list(APPEND platforms irix64_cc_o32)
-
-# cc -n32 dummy.c -v
-set(irix64_cc_n32_text "/usr/lib32/cmplrs/ld32 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -n32 -L/usr/lib32/mips4/r10000 -L/usr/lib32/mips4 -L/usr/lib32 /usr/lib32/mips4/crt1.o dummy.o -dont_warn_unused -Bdynamic -lc /usr/lib32/mips4/crtn.o -warn_unused")
-set(irix64_cc_n32_libs "c")
-set(irix64_cc_n32_dirs "/usr/lib32/mips4/r10000;/usr/lib32/mips4;/usr/lib32")
-list(APPEND platforms irix64_cc_n32)
-
-# cc -64 dummy.c -v
-set(irix64_cc_64_text "/usr/lib32/cmplrs/ld64 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -64 -L/usr/lib64/mips4/r10000 -L/usr/lib64/mips4 -L/usr/lib64 /usr/lib64/mips4/crt1.o dummy.o -dont_warn_unused -Bdynamic -lc /usr/lib64/mips4/crtn.o -warn_unused")
-set(irix64_cc_64_libs "c")
-set(irix64_cc_64_dirs "/usr/lib64/mips4/r10000;/usr/lib64/mips4;/usr/lib64")
-list(APPEND platforms irix64_cc_64)
-
-# CC -o32 dummy.cxx -v
-set(irix64_CC_o32_text "/usr/lib/ld -elf -cxx -woff 134 -_SYSTYPE_SVR4 -require_dynamic_link _rld_new_interface -no_unresolved -Wx,-G 0 -o32 -mips2 -call_shared -g0 -KPIC -L/usr/lib/ -nocount /usr/lib/crt1.o /usr/lib/c++init.o -count dummy.o -nocount -dont_warn_unused -lC -warn_unused -lc /usr/lib/crtn.o")
-set(irix64_CC_o32_libs "C;c")
-set(irix64_CC_o32_dirs "/usr/lib")
-list(APPEND platforms irix64_CC_o32)
-
-# CC -n32 dummy.cxx -v
-set(irix64_CC_n32_text "/usr/lib32/cmplrs/ld32 -call_shared -init _main -fini _fini -no_unresolved -transitive_link -demangle -elf -_SYSTYPE_SVR4 -LANG:std -show -mips4 -n32 -L/usr/lib32/mips4/r10000 -L/usr/lib32/mips4 -L/usr/lib32 -cxx -woff 134 /usr/lib32/mips4/crt1.o /usr/lib32/c++init.o dummy.o -dont_warn_unused -lCsup -lC -lCio -Bdynamic -lc /usr/lib32/mips4/crtn.o -warn_unused")
-set(irix64_CC_n32_libs "Csup;C;Cio;c")
-set(irix64_CC_n32_dirs "/usr/lib32/mips4/r10000;/usr/lib32/mips4;/usr/lib32")
-list(APPEND platforms irix64_CC_n32)
-
-# CC -64 dummy.cxx -v
-set(irix64_CC_64_text "/usr/lib32/cmplrs/ld64 -call_shared -init _main -fini _fini -no_unresolved -transitive_link -demangle -elf -_SYSTYPE_SVR4 -LANG:std -show -mips4 -64 -L/usr/lib64/mips4/r10000 -L/usr/lib64/mips4 -L/usr/lib64 -cxx -woff 134 /usr/lib64/mips4/crt1.o /usr/lib64/c++init.o dummy.o -dont_warn_unused -lCsup -lC -lCio -Bdynamic -lc /usr/lib64/mips4/crtn.o -warn_unused")
-set(irix64_CC_64_libs "Csup;C;Cio;c")
-set(irix64_CC_64_dirs "/usr/lib64/mips4/r10000;/usr/lib64/mips4;/usr/lib64")
-list(APPEND platforms irix64_CC_64)
-
-# f77 -o32 dummy.f -v
-set(irix64_f77_o32_text "/usr/lib/ld -elf -_SYSTYPE_SVR4 -require_dynamic_link _rld_new_interface -no_unresolved -Wx,-G 0 -o32 -mips2 -call_shared -g0 -KPIC -L/usr/lib/ -nocount /usr/lib/crt1.o -count dummy.o -nocount -lftn -lm -lc /usr/lib/crtn.o")
-set(irix64_f77_o32_libs "ftn;m;c")
-set(irix64_f77_o32_dirs "/usr/lib")
-list(APPEND platforms irix64_f77_o32)
-
-# f77 -n32 dummy.f -v
-set(irix64_f77_n32_text "/usr/lib32/cmplrs/ld32 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -n32 -L/usr/lib32/mips4/r10000 -L/usr/lib32/mips4 -L/usr/lib32 /usr/lib32/mips4/crt1.o dummy.o -dont_warn_unused -lftn -lm -Bdynamic -lc /usr/lib32/mips4/crtn.o -warn_unused")
-set(irix64_f77_n32_libs "ftn;m;c")
-set(irix64_f77_n32_dirs "/usr/lib32/mips4/r10000;/usr/lib32/mips4;/usr/lib32")
-list(APPEND platforms irix64_f77_n32)
-
-# f77 -64 dummy.f -v
-set(irix64_f77_64_text "/usr/lib32/cmplrs/ld64 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -64 -L/usr/lib64/mips4/r10000 -L/usr/lib64/mips4 -L/usr/lib64 /usr/lib64/mips4/crt1.o dummy.o -dont_warn_unused -lftn -lm -Bdynamic -lc /usr/lib64/mips4/crtn.o -warn_unused")
-set(irix64_f77_64_libs "ftn;m;c")
-set(irix64_f77_64_dirs "/usr/lib64/mips4/r10000;/usr/lib64/mips4;/usr/lib64")
-list(APPEND platforms irix64_f77_64)
-
-# f90 -o32 dummy.f -v
-#f90 ERROR: specified abi -o32 not supported.
-
-# f90 -n32 dummy.f -v
-set(irix64_f90_n32_text "/usr/lib32/cmplrs/ld32 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -n32 -L/usr/lib32/mips4/r10000 -L/usr/lib32/mips4 -L/usr/lib32 /usr/lib32/mips4/crt1.o dummy.o -dont_warn_unused -lfortran -lffio -lftn -lm -Bdynamic -lc /usr/lib32/mips4/crtn.o -warn_unused")
-set(irix64_f90_n32_libs "fortran;ffio;ftn;m;c")
-set(irix64_f90_n32_dirs "/usr/lib32/mips4/r10000;/usr/lib32/mips4;/usr/lib32")
-list(APPEND platforms irix64_f90_n32)
-
-# f90 -64 dummy.f -v
-set(irix64_f90_64_text "/usr/lib32/cmplrs/ld64 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -64 -L/usr/lib64/mips4/r10000 -L/usr/lib64/mips4 -L/usr/lib64 /usr/lib64/mips4/crt1.o dummy.o -dont_warn_unused -lfortran -lffio -lftn -lm -Bdynamic -lc /usr/lib64/mips4/crtn.o -warn_unused")
-set(irix64_f90_64_libs "fortran;ffio;ftn;m;c")
-set(irix64_f90_64_dirs "/usr/lib64/mips4/r10000;/usr/lib64/mips4;/usr/lib64")
-list(APPEND platforms irix64_f90_64)
-
-#-----------------------------------------------------------------------------
# Cygwin
# gcc dummy.c -v
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 67fcc02..811fff3 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -332,7 +332,6 @@ if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
else()
if (CMAKE_CXX_COMPILER_ID MATCHES "PGI"
OR CMAKE_CXX_COMPILER_ID MATCHES "PathScale"
- OR CMAKE_SYSTEM_NAME MATCHES "IRIX64"
OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(run_pic_test 0)
else()
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index 59e6d59..77f6041 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -70,8 +70,15 @@ if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL XL)
include(CheckFortranCompilerFlag)
CHECK_Fortran_COMPILER_FLAG(-_this_is_not_a_flag_ Fortran_BOGUS_FLAG)
if (Fortran_BOGUS_FLAG)
- message (SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed")
- endif ()
+ message(SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed")
+ endif()
+
+ unset(Fortran_RUN_FLAG CACHE)
+ include(CheckFortranSourceRuns)
+ check_fortran_source_runs("program a; end program" Fortran_RUN_FLAG SRC_EXT F90)
+ if(NOT Fortran_RUN_FLAG)
+ message(SEND_ERROR "CHECK_Fortran_SOURCE_RUNS() failed")
+ endif()
endif()
# Test generation of preprocessed sources.
diff --git a/Tests/RunCMake/Autogen/CMakeLists.txt b/Tests/RunCMake/Autogen/CMakeLists.txt
new file mode 100644
index 0000000..9a66cde
--- /dev/null
+++ b/Tests/RunCMake/Autogen/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.13)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Autogen/NoQt-stderr.txt b/Tests/RunCMake/Autogen/NoQt-stderr.txt
new file mode 100644
index 0000000..6b4a933
--- /dev/null
+++ b/Tests/RunCMake/Autogen/NoQt-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Warning \(dev\) in CMakeLists.txt:
+ AUTOGEN: No valid Qt version found for target main. AUTOMOC, AUTOUIC,
+ AUTORCC disabled. Consider adding:
+
+ find_package\(Qt5 COMPONENTS Widgets\)
+
+ to your CMakeLists.txt file.
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Autogen/NoQt.cmake b/Tests/RunCMake/Autogen/NoQt.cmake
new file mode 100644
index 0000000..b2d375a
--- /dev/null
+++ b/Tests/RunCMake/Autogen/NoQt.cmake
@@ -0,0 +1,6 @@
+enable_language(CXX)
+
+add_executable(main empty.cpp)
+set_property(TARGET main PROPERTY AUTOMOC 1)
+set_property(TARGET main PROPERTY AUTORCC 1)
+set_property(TARGET main PROPERTY AUTOUIC 1)
diff --git a/Tests/RunCMake/Autogen/RunCMakeTest.cmake b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
new file mode 100644
index 0000000..e52f28d
--- /dev/null
+++ b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(NoQt)
diff --git a/Tests/RunCMake/Autogen/empty.cpp b/Tests/RunCMake/Autogen/empty.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/Autogen/empty.cpp
diff --git a/Tests/RunCMake/CMP0064/CMP0064-OLD-stderr.txt b/Tests/RunCMake/CMP0064/CMP0064-OLD-stderr.txt
new file mode 100644
index 0000000..987a503
--- /dev/null
+++ b/Tests/RunCMake/CMP0064/CMP0064-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0064-OLD.cmake:1 \(cmake_policy\):
+ The OLD behavior for policy CMP0064 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 5afa242..54b3ac7 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -150,6 +150,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()
add_RunCMake_test(AndroidTestUtilities)
+add_RunCMake_test(Autogen)
add_RunCMake_test(BuildDepends)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 4cd34de..0e04ad1 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -4,17 +4,17 @@ include(RunCMake)
run_cmake_command(NoArgs ${CMAKE_COMMAND})
run_cmake_command(Wizard ${CMAKE_COMMAND} -i)
-run_cmake_command(C-no-arg ${CMAKE_COMMAND} -C)
-run_cmake_command(C-no-file ${CMAKE_COMMAND} -C nosuchcachefile.txt)
-run_cmake_command(Cno-file ${CMAKE_COMMAND} -Cnosuchcachefile.txt)
+run_cmake_command(C-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -C)
+run_cmake_command(C-no-file ${CMAKE_COMMAND} -B DummyBuildDir -C nosuchcachefile.txt)
+run_cmake_command(Cno-file ${CMAKE_COMMAND} -B DummyBuildDir -Cnosuchcachefile.txt)
run_cmake_command(cache-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeCache.txt)
run_cmake_command(lists-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeLists.txt)
-run_cmake_command(D-no-arg ${CMAKE_COMMAND} -D)
-run_cmake_command(D-no-src ${CMAKE_COMMAND} -D VAR=VALUE)
-run_cmake_command(Dno-src ${CMAKE_COMMAND} -DVAR=VALUE)
-run_cmake_command(U-no-arg ${CMAKE_COMMAND} -U)
-run_cmake_command(U-no-src ${CMAKE_COMMAND} -U VAR)
-run_cmake_command(Uno-src ${CMAKE_COMMAND} -UVAR)
+run_cmake_command(D-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -D)
+run_cmake_command(D-no-src ${CMAKE_COMMAND} -B DummyBuildDir -D VAR=VALUE)
+run_cmake_command(Dno-src ${CMAKE_COMMAND} -B DummyBuildDir -DVAR=VALUE)
+run_cmake_command(U-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -U)
+run_cmake_command(U-no-src ${CMAKE_COMMAND} -B DummyBuildDir -U VAR)
+run_cmake_command(Uno-src ${CMAKE_COMMAND} -B DummyBuildDir -UVAR)
run_cmake_command(E-no-arg ${CMAKE_COMMAND} -E)
run_cmake_command(E_capabilities ${CMAKE_COMMAND} -E capabilities)
run_cmake_command(E_capabilities-arg ${CMAKE_COMMAND} -E capabilities --extra-arg)
@@ -34,8 +34,8 @@ run_cmake_command(E___run_co_compile-bad-iwyu ${CMAKE_COMMAND} -E __run_co_compi
run_cmake_command(E___run_co_compile-no--- ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist command-does-not-exist)
run_cmake_command(E___run_co_compile-no-cc ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist --)
-run_cmake_command(G_no-arg ${CMAKE_COMMAND} -G)
-run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -G NoSuchGenerator)
+run_cmake_command(G_no-arg ${CMAKE_COMMAND} -B DummyBuildDir -G)
+run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -B DummyBuildDir -G NoSuchGenerator)
run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
@@ -61,6 +61,7 @@ function(run_ExplicitDirs)
file(REMOVE_RECURSE "${binary_dir}")
file(MAKE_DIRECTORY "${binary_dir}")
+ run_cmake_command(no-S-B ${CMAKE_COMMAND} -DFOO=BAR)
run_cmake_command(S-arg ${CMAKE_COMMAND} -S ${source_dir} ${binary_dir})
run_cmake_command(S-arg-reverse-order ${CMAKE_COMMAND} ${binary_dir} -S${source_dir} )
run_cmake_command(S-no-arg ${CMAKE_COMMAND} -S )
@@ -330,9 +331,9 @@ set(RunCMake_TEST_OPTIONS -Wdev -Wno-dev)
run_cmake(Wno-dev)
unset(RunCMake_TEST_OPTIONS)
-run_cmake_command(W_bad-arg1 ${CMAKE_COMMAND} -W)
-run_cmake_command(W_bad-arg2 ${CMAKE_COMMAND} -Wno-)
-run_cmake_command(W_bad-arg3 ${CMAKE_COMMAND} -Werror=)
+run_cmake_command(W_bad-arg1 ${CMAKE_COMMAND} -B DummyBuildDir -W)
+run_cmake_command(W_bad-arg2 ${CMAKE_COMMAND} -B DummyBuildDir -Wno-)
+run_cmake_command(W_bad-arg3 ${CMAKE_COMMAND} -B DummyBuildDir -Werror=)
set(RunCMake_TEST_OPTIONS --debug-output)
run_cmake(debug-output)
diff --git a/Tests/RunCMake/CommandLine/no-S-B-result.txt b/Tests/RunCMake/CommandLine/no-S-B-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/no-S-B-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/no-S-B-stderr.txt b/Tests/RunCMake/CommandLine/no-S-B-stderr.txt
new file mode 100644
index 0000000..7a94307
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/no-S-B-stderr.txt
@@ -0,0 +1 @@
+CMake Error: No source or binary directory provided
diff --git a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
index 5d0577b..eef350c 100644
--- a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
@@ -1,4 +1,5 @@
include(RunCMake)
+unset(ENV{Boost_ROOT})
run_cmake(CMakePackage)
run_cmake(NoCXX)
diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt
index 40c265e..0d45db8 100644
--- a/Tests/SubDirSpaces/CMakeLists.txt
+++ b/Tests/SubDirSpaces/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6)
project(SUBDIR)
# Some systems do not seem to support rpath with spaces.
-if(CMAKE_SYSTEM_NAME MATCHES "IRIX|QNX")
+if(CMAKE_SYSTEM_NAME MATCHES "QNX")
set(CMAKE_SKIP_BUILD_RPATH 1)
endif()
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index c5231bb..aee8a69 100644
--- a/Utilities/IWYU/mapping.imp
+++ b/Utilities/IWYU/mapping.imp
@@ -55,6 +55,9 @@
# HACK: iwyu wrongly thinks that <system_error> is needed for std::hash
{ symbol: [ "std::hash", private, "<functional>", public ] },
+ # HACK: iwyu thinks we use a libstdc++ private type
+ { symbol: [ "__gnu_cxx::size_t", private, "<cstddef>", public ] },
+
# __decay_and_strip is used internally in the C++11 standard library.
# IWYU does not classify it as internal and suggests to add <type_traits>.
# To ignore it, we simply map it to a file that is included anyway.
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 9ae7aa3..1c96497 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -29,7 +29,7 @@ set(DISABLED_THREADSAFE OFF CACHE INTERNAL "Curl can use thread-safe functions")
set(ENABLE_ARES OFF CACHE INTERNAL "No curl c-ares support")
set(ENABLE_CURLDEBUG OFF CACHE INTERNAL "No curl TrackMemory features")
set(ENABLE_DEBUG OFF CACHE INTERNAL "No curl debug features")
-set(ENABLE_IPV6 OFF CACHE INTERNAL "No curl IPv6 support")
+set(ENABLE_IPV6 ON CACHE INTERNAL "Enable curl IPv6 support detection")
set(ENABLE_MANUAL OFF CACHE INTERNAL "No curl built-in manual")
set(ENABLE_THREADED_RESOLVER OFF CACHE INTERNAL "No curl POSIX threaded DNS lookup")
set(ENABLE_UNIX_SOCKETS OFF CACHE INTERNAL "No curl Unix domain sockets support")
diff --git a/Utilities/cmliblzma/liblzma/simple/x86.c b/Utilities/cmliblzma/liblzma/simple/x86.c
index 23d0c42..b38cebf 100644
--- a/Utilities/cmliblzma/liblzma/simple/x86.c
+++ b/Utilities/cmliblzma/liblzma/simple/x86.c
@@ -97,7 +97,7 @@ x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder,
if (!Test86MSByte(b))
break;
- src = dest ^ ((1u << (32 - i * 8)) - 1);
+ src = dest ^ ((1ull << (32 - i * 8)) - 1);
}
buffer[buffer_pos + 4]
diff --git a/Utilities/cmlibuv/src/unix/process.c b/Utilities/cmlibuv/src/unix/process.c
index 1bded8d..f2a5065 100644
--- a/Utilities/cmlibuv/src/unix/process.c
+++ b/Utilities/cmlibuv/src/unix/process.c
@@ -334,7 +334,7 @@ static void uv__process_child_init(const uv_process_options_t* options,
use_fd = open("/dev/null", fd == 0 ? O_RDONLY : O_RDWR);
close_fd = use_fd;
- if (use_fd == -1) {
+ if (use_fd < 0) {
uv__write_int(error_fd, UV__ERR(errno));
_exit(127);
}