summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/cmake_host_system_information.rst12
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst2
-rw-r--r--Help/manual/cmake-server.7.rst7
-rw-r--r--Help/release/dev/FindSubversion-wc-info-error.rst6
-rw-r--r--Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake1
-rw-r--r--Modules/CMakeFindBinUtils.cmake18
-rw-r--r--Modules/ExternalProject.cmake5
-rw-r--r--Modules/FindBoost.cmake6
-rw-r--r--Modules/FindMPI.cmake2
-rw-r--r--Modules/FindMatlab.cmake15
-rw-r--r--Modules/FindOpenThreads.cmake12
-rw-r--r--Modules/FindSubversion.cmake33
-rw-r--r--Modules/Findosg_functions.cmake22
-rw-r--r--Source/CMakeLists.txt1
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx2
-rw-r--r--Source/CTest/cmCTestGIT.cxx2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx59
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h5
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx8
-rw-r--r--Source/CTest/cmCTestVC.cxx2
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx2
-rw-r--r--Source/QtDialog/CMakeSetupDialog.ui3
-rw-r--r--Source/cmCTest.cxx15
-rw-r--r--Source/cmCacheManager.cxx24
-rw-r--r--Source/cmCacheManager.h2
-rw-r--r--Source/cmComputeLinkDepends.cxx33
-rw-r--r--Source/cmComputeLinkDepends.h9
-rw-r--r--Source/cmComputeTargetDepends.cxx46
-rw-r--r--Source/cmComputeTargetDepends.h4
-rw-r--r--Source/cmDefinitions.cxx6
-rw-r--r--Source/cmDefinitions.h4
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx2
-rw-r--r--Source/cmExportFileGenerator.cxx12
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx3
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx12
-rw-r--r--Source/cmFLTKWrapUICommand.cxx2
-rw-r--r--Source/cmFileCommand.cxx8
-rw-r--r--Source/cmFindLibraryCommand.cxx4
-rw-r--r--Source/cmGeneratorExpression.cxx14
-rw-r--r--Source/cmGeneratorExpression.h55
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx13
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h13
-rw-r--r--Source/cmGeneratorExpressionNode.cxx15
-rw-r--r--Source/cmGeneratorTarget.cxx89
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGlobalGenerator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx12
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx2
-rw-r--r--Source/cmInstalledFile.cxx2
-rw-r--r--Source/cmLinkItem.cxx72
-rw-r--r--Source/cmLinkItem.h38
-rw-r--r--Source/cmLocalCommonGenerator.cxx3
-rw-r--r--Source/cmLocalGenerator.cxx4
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx10
-rw-r--r--Source/cmMakefile.cxx25
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx3
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx4
-rw-r--r--Source/cmNinjaTargetGenerator.cxx11
-rw-r--r--Source/cmOptionCommand.cxx6
-rw-r--r--Source/cmQTWrapCPPCommand.cxx2
-rw-r--r--Source/cmQTWrapUICommand.cxx4
-rw-r--r--Source/cmQtAutoGenInitializer.cxx3
-rw-r--r--Source/cmQtAutoGenerator.cxx4
-rw-r--r--Source/cmServerDictionary.h1
-rw-r--r--Source/cmServerProtocol.cxx226
-rw-r--r--Source/cmSetPropertyCommand.cxx4
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.cxx2
-rw-r--r--Source/cmSiteNameCommand.cxx2
-rw-r--r--Source/cmState.cxx7
-rw-r--r--Source/cmStateSnapshot.cxx7
-rw-r--r--Source/cmStateSnapshot.h2
-rw-r--r--Source/cmSystemTools.cxx101
-rw-r--r--Source/cmSystemTools.h2
-rw-r--r--Source/cmUtilitySourceCommand.cxx4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx16
-rw-r--r--Source/cmcmd.cxx8
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/ImportedSameName/A/CMakeLists.txt8
-rw-r--r--Tests/ImportedSameName/A/a.c3
-rw-r--r--Tests/ImportedSameName/B/CMakeLists.txt8
-rw-r--r--Tests/ImportedSameName/B/b.c3
-rw-r--r--Tests/ImportedSameName/CMakeLists.txt8
-rw-r--r--Tests/ImportedSameName/main.c16
-rw-r--r--Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake14
-rw-r--r--Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake7
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-fail-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-fail-stdout.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-pass-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt8
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt7
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake12
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt7
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake13
-rw-r--r--Tests/RunCMake/ExternalProject/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt8
-rw-r--r--Tests/RunCMake/ctest_start/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/ctest_start/test.cmake.in2
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadFail-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadFail-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadFail-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadWait-stdout.txt8
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadFail-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadFail-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadFail-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadWait-stdout.txt8
-rwxr-xr-xbootstrap1
113 files changed, 890 insertions, 492 deletions
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index 9893151..2dee93a 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -20,10 +20,10 @@ Key Description
``NUMBER_OF_PHYSICAL_CORES`` Number of physical cores
``HOSTNAME`` Hostname
``FQDN`` Fully qualified domain name
-``TOTAL_VIRTUAL_MEMORY`` Total virtual memory in megabytes
-``AVAILABLE_VIRTUAL_MEMORY`` Available virtual memory in megabytes
-``TOTAL_PHYSICAL_MEMORY`` Total physical memory in megabytes
-``AVAILABLE_PHYSICAL_MEMORY`` Available physical memory in megabytes
+``TOTAL_VIRTUAL_MEMORY`` Total virtual memory in MiB [#mebibytes]_
+``AVAILABLE_VIRTUAL_MEMORY`` Available virtual memory in MiB [#mebibytes]_
+``TOTAL_PHYSICAL_MEMORY`` Total physical memory in MiB [#mebibytes]_
+``AVAILABLE_PHYSICAL_MEMORY`` Available physical memory in MiB [#mebibytes]_
``IS_64BIT`` One if processor is 64Bit
``HAS_FPU`` One if processor has floating point unit
``HAS_MMX`` One if processor supports MMX instructions
@@ -44,3 +44,7 @@ Key Description
``OS_VERSION`` The OS build ID
``OS_PLATFORM`` See :variable:`CMAKE_HOST_SYSTEM_PROCESSOR`
============================= ================================================
+
+.. rubric:: Footnotes
+
+.. [#mebibytes] One MiB (mebibyte) is equal to 1024x1024 bytes.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 8fd07d7..c3428d1 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -51,7 +51,7 @@ Available logical expressions are:
``0`` if all ``?`` are ``0``, else ``1``
``$<NOT:?>``
``0`` if ``?`` is ``1``, else ``1``
-``$<IF:?,true-value...,false-value...>```
+``$<IF:?,true-value...,false-value...>``
``true-value...`` if ``?`` is ``1``, ``false-value...`` if ``?`` is ``0``
``$<STREQUAL:a,b>``
``1`` if ``a`` is STREQUAL ``b``, else ``0``
diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst
index 25d364c..b4c1436 100644
--- a/Help/manual/cmake-server.7.rst
+++ b/Help/manual/cmake-server.7.rst
@@ -308,6 +308,9 @@ which will result in a response type "reply"::
indicating that the server is ready for action.
+Protocol version 1.3 introduces an optional flag on the target filegroup
+that indicates if the filegroup represents :prop_tgt:`INTERFACE_SOURCES`.
+
Type "globalSettings"
^^^^^^^^^^^^^^^^^^^^^
@@ -524,6 +527,8 @@ FileGroups are used to group sources using similar settings together.
Each fileGroup object may contain the following keys:
+"isInterfaceSources"
+ true if the fileGroup represents :prop_tgt:`INTERFACE_SOURCES`.
"language"
contains the programming language used by all files in the group.
"compileFlags"
@@ -538,6 +543,8 @@ Each fileGroup object may contain the following keys:
"defines"
with a list of defines in the form "SOMEVALUE" or "SOMEVALUE=42". This
value is encoded in the system's native shell format.
+"isGenerated"
+ true if the files were generated.
"sources"
with a list of source files.
diff --git a/Help/release/dev/FindSubversion-wc-info-error.rst b/Help/release/dev/FindSubversion-wc-info-error.rst
new file mode 100644
index 0000000..eaf6bfe
--- /dev/null
+++ b/Help/release/dev/FindSubversion-wc-info-error.rst
@@ -0,0 +1,6 @@
+FindSubversion-wc-info-error
+----------------------------
+
+* The :module:`FindSubversion` module ``Subversion_WC_INFO`` command
+ gained an ``IGNORE_SVN_FAILURE`` option to suppress failures,
+ e.g. when the source tree is not under Subversion control.
diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
index 55e0373..11f4a29 100644
--- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
+++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
@@ -27,6 +27,7 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
set(_compilerExecutable "${CMAKE_C_COMPILER}")
set(_arg1 "${CMAKE_C_COMPILER_ARG1}")
endif ()
+ separate_arguments(_arg1 NATIVE_COMMAND "${_arg1}")
execute_process(COMMAND ${_compilerExecutable} ${_arg1} ${_stdver} ${_stdlib} -v -E -x ${_lang} -dD dummy
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
ERROR_VARIABLE _gccOutput
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 1b6823c..830639d 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -38,6 +38,8 @@ if(CMAKE_LINKER)
endif()
endif()
+set(_CMAKE_TOOL_VARS "")
+
# if it's the MS C/CXX compiler, search for link
if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xMSVC"
@@ -47,7 +49,7 @@ if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC"
find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- mark_as_advanced(CMAKE_LINKER)
+ list(APPEND _CMAKE_TOOL_VARS CMAKE_LINKER)
# in all other cases search for ar, ranlib, etc.
else()
@@ -70,7 +72,7 @@ else()
find_program(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- mark_as_advanced(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
+ list(APPEND _CMAKE_TOOL_VARS CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
endif()
@@ -81,5 +83,15 @@ if(CMAKE_PLATFORM_HAS_INSTALLNAME)
message(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
endif()
- mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
+ list(APPEND _CMAKE_TOOL_VARS CMAKE_INSTALL_NAME_TOOL)
endif()
+
+# Mark any tool cache entries as advanced.
+foreach(var IN LISTS _CMAKE_TOOL_VARS)
+ get_property(_CMAKE_TOOL_CACHED CACHE ${var} PROPERTY TYPE)
+ if(_CMAKE_TOOL_CACHED)
+ mark_as_advanced(${var})
+ endif()
+endforeach()
+unset(_CMAKE_TOOL_VARS)
+unset(_CMAKE_TOOL_CACHED)
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 0c5b33f..f987d2d 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -934,6 +934,11 @@ function(_ep_parse_arguments f name ns args)
# We loop through ARGN and consider the namespace starting with an
# upper-case letter followed by at least two more upper-case letters,
# numbers or underscores to be keywords.
+
+ if(NOT DEFINED _ExternalProject_SELF)
+ message(FATAL_ERROR "error: ExternalProject module must be explicitly included before using ${f} function")
+ endif()
+
set(key)
foreach(arg IN LISTS args)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index c14e402..f65a493 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -881,7 +881,11 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
set(_Boost_CONTRACT_HEADERS "boost/contract.hpp")
- set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp")
+ if(Boost_VERSION VERSION_LESS 106100)
+ set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
+ else()
+ set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp")
+ endif()
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 75c4441..bfcd876 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1680,7 +1680,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}")
unset(MPI_${LANG}_COMPILE_FLAGS)
if(MPI_${LANG}_COMPILE_OPTIONS)
- set(MPI_${LANG}_COMPILE_FLAGS "${MPI_${LANG}_COMPILE_OPTIONS}")
+ list(JOIN MPI_${LANG}_COMPILE_FLAGS " " MPI_${LANG}_COMPILE_OPTIONS)
endif()
if(MPI_${LANG}_COMPILE_DEFINITIONS)
foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS)
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index f2ada3b..12a2f75 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -1224,21 +1224,6 @@ function(_Matlab_find_instances_win32 matlab_roots)
# filtering the results with the registry keys
matlab_get_all_valid_matlab_roots_from_registry("${_matlab_versions_from_registry}" _matlab_possible_roots)
- unset(_matlab_versions_from_registry)
-
- set(_matlab_versions_from_registry)
- matlab_extract_all_installed_versions_from_registry(CMAKE_CL_64 _matlab_versions_from_registry)
-
- # the returned list is empty, doing the search on all known versions
- if(NOT _matlab_versions_from_registry)
- if(MATLAB_FIND_DEBUG)
- message(STATUS "[MATLAB] Search for Matlab from the registry unsuccessful, testing all supported versions")
- endif()
- extract_matlab_versions_from_registry_brute_force(_matlab_versions_from_registry)
- endif()
-
- # filtering the results with the registry keys
- matlab_get_all_valid_matlab_roots_from_registry("${_matlab_versions_from_registry}" _matlab_possible_roots)
set(${matlab_roots} ${_matlab_possible_roots} PARENT_SCOPE)
endfunction()
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index a197e4d..91545e0 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -47,6 +47,8 @@
# standard install paths.
# Explicit -DVAR=value arguments should still be able to override everything.
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+
find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS
ENV OPENTHREADS_INCLUDE_DIR
@@ -62,7 +64,7 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
)
-find_library(OPENTHREADS_LIBRARY
+find_library(OPENTHREADS_LIBRARY_RELEASE
NAMES OpenThreads OpenThreadsWin32
HINTS
ENV OPENTHREADS_LIBRARY_DIR
@@ -93,13 +95,7 @@ find_library(OPENTHREADS_LIBRARY_DEBUG
PATH_SUFFIXES lib
)
-if(OPENTHREADS_LIBRARY_DEBUG)
- set(OPENTHREADS_LIBRARIES
- optimized ${OPENTHREADS_LIBRARY}
- debug ${OPENTHREADS_LIBRARY_DEBUG})
-else()
- set(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY})
-endif()
+select_library_configurations(OPENTHREADS)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenThreads DEFAULT_MSG
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 537d3b2..e18ae88 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -19,17 +19,21 @@
#
#
# The minimum required version of Subversion can be specified using the
-# standard syntax, e.g. find_package(Subversion 1.4)
+# standard syntax, e.g. ``find_package(Subversion 1.4)``.
#
# If the command line client executable is found two macros are defined:
#
# ::
#
-# Subversion_WC_INFO(<dir> <var-prefix>)
+# Subversion_WC_INFO(<dir> <var-prefix> [IGNORE_SVN_FAILURE])
# Subversion_WC_LOG(<dir> <var-prefix>)
#
-# Subversion_WC_INFO extracts information of a subversion working copy
-# at a given location. This macro defines the following variables:
+# ``Subversion_WC_INFO`` extracts information of a subversion working copy at a
+# given location. This macro defines the following variables if running
+# Subversion's ``info`` command on ``<dir>`` succeeds; otherwise a
+# ``SEND_ERROR`` message is generated. The error can be ignored by providing the
+# ``IGNORE_SVN_FAILURE`` option, which causes these variables to remain
+# undefined.
#
# ::
#
@@ -41,9 +45,8 @@
# <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
# <var-prefix>_WC_INFO - output of command `svn info <dir>'
#
-# Subversion_WC_LOG retrieves the log message of the base revision of a
-# subversion working copy at a given location. This macro defines the
-# variable:
+# ``Subversion_WC_LOG`` retrieves the log message of the base revision of a
+# subversion working copy at a given location. This macro defines the variable:
#
# ::
#
@@ -84,6 +87,14 @@ if(Subversion_SVN_EXECUTABLE)
"\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
macro(Subversion_WC_INFO dir prefix)
+
+ cmake_parse_arguments(
+ "Subversion_WC_INFO"
+ "IGNORE_SVN_FAILURE"
+ "" ""
+ ${ARGN}
+ )
+
# the subversion commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated, Alex
set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
@@ -95,10 +106,7 @@ if(Subversion_SVN_EXECUTABLE)
RESULT_VARIABLE Subversion_svn_info_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
- if(NOT ${Subversion_svn_info_result} EQUAL 0)
- message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
- else()
-
+ if(${Subversion_svn_info_result} EQUAL 0)
string(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
"\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
string(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
@@ -111,7 +119,8 @@ if(Subversion_SVN_EXECUTABLE)
"\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}")
string(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
-
+ elseif(NOT Subversion_WC_INFO_IGNORE_SVN_FAILURE)
+ message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
endif()
# restore the previous LC_ALL
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index 60de726..adaeb6b 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -13,6 +13,8 @@
# libraries and nodekits. Please see FindOpenSceneGraph.cmake for full
# documentation.
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+
#
# OSG_FIND_PATH
#
@@ -39,7 +41,7 @@ endfunction()
function(OSG_FIND_LIBRARY module library)
string(TOUPPER ${module} module_uc)
- find_library(${module_uc}_LIBRARY
+ find_library(${module_uc}_LIBRARY_RELEASE
NAMES ${library}
HINTS
ENV ${module_uc}_DIR
@@ -63,18 +65,12 @@ function(OSG_FIND_LIBRARY module library)
PATH_SUFFIXES lib
)
- if(NOT ${module_uc}_LIBRARY_DEBUG)
- # They don't have a debug library
- set(${module_uc}_LIBRARY_DEBUG ${${module_uc}_LIBRARY} PARENT_SCOPE)
- set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
- else()
- # They really have a FOO_LIBRARY_DEBUG
- set(${module_uc}_LIBRARIES
- optimized ${${module_uc}_LIBRARY}
- debug ${${module_uc}_LIBRARY_DEBUG}
- PARENT_SCOPE
- )
- endif()
+ select_library_configurations(${module_uc})
+
+ # the variables set by select_library_configurations go out of scope
+ # here, so we need to set them again
+ set(${module_uc}_LIBRARY ${${module_uc}_LIBRARY} PARENT_SCOPE)
+ set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARIES} PARENT_SCOPE)
endfunction()
#
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 0457984..628cc6f 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -265,6 +265,7 @@ set(SRCS
cmInstallDirectoryGenerator.h
cmInstallDirectoryGenerator.cxx
cmLinkedTree.h
+ cmLinkItem.cxx
cmLinkItem.h
cmLinkLineComputer.cxx
cmLinkLineComputer.h
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 5110008..1e9f499 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 12)
-set(CMake_VERSION_PATCH 20180902)
+set(CMake_VERSION_PATCH 20180911)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index c5941ce..a8309d9 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -327,7 +327,7 @@ int cmCTestBuildHandler::ProcessHandler()
std::string const& useLaunchers =
this->CTest->GetCTestConfiguration("UseLaunchers");
- this->UseCTestLaunch = cmSystemTools::IsOn(useLaunchers.c_str());
+ this->UseCTestLaunch = cmSystemTools::IsOn(useLaunchers);
// Create a last build log
cmGeneratedFileStream ofs;
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index b919c79..71fcafb 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -272,7 +272,7 @@ bool cmCTestGIT::UpdateImpl()
std::string init_submodules =
this->CTest->GetCTestConfiguration("GITInitSubmodules");
- if (cmSystemTools::IsOn(init_submodules.c_str())) {
+ if (cmSystemTools::IsOn(init_submodules)) {
char const* git_submodule_init[] = { git, "submodule", "init", nullptr };
ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err,
top_dir.c_str());
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 52db9d4..54b4be2 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -5,7 +5,6 @@
#include "cmAffinity.h"
#include "cmCTest.h"
#include "cmCTestRunTest.h"
-#include "cmCTestScriptHandler.h"
#include "cmCTestTestHandler.h"
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
@@ -52,6 +51,7 @@ cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
{
this->ParallelLevel = 1;
this->TestLoad = 0;
+ this->FakeLoadForTesting = 0;
this->Completed = 0;
this->RunningCount = 0;
this->ProcessorsAvailable = cmAffinity::GetProcessorsAvailable();
@@ -96,6 +96,16 @@ void cmCTestMultiProcessHandler::SetParallelLevel(size_t level)
void cmCTestMultiProcessHandler::SetTestLoad(unsigned long load)
{
this->TestLoad = load;
+
+ std::string fake_load_value;
+ if (cmSystemTools::GetEnv("__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING",
+ fake_load_value)) {
+ if (!cmSystemTools::StringToULong(fake_load_value.c_str(),
+ &this->FakeLoadForTesting)) {
+ cmSystemTools::Error("Failed to parse fake load value: ",
+ fake_load_value.c_str());
+ }
+ }
}
void cmCTestMultiProcessHandler::RunTests()
@@ -258,12 +268,19 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
void cmCTestMultiProcessHandler::StartNextTests()
{
- size_t numToStart = 0;
+ if (this->TestLoadRetryTimer.get() != nullptr) {
+ // This timer may be waiting to call StartNextTests again.
+ // Since we have been called it is no longer needed.
+ uv_timer_stop(this->TestLoadRetryTimer);
+ }
if (this->Tests.empty()) {
+ this->TestLoadRetryTimer.reset();
return;
}
+ size_t numToStart = 0;
+
if (this->RunningCount < this->ParallelLevel) {
numToStart = this->ParallelLevel - this->RunningCount;
}
@@ -279,7 +296,6 @@ void cmCTestMultiProcessHandler::StartNextTests()
}
bool allTestsFailedTestLoadCheck = false;
- bool usedFakeLoadForTesting = false;
size_t minProcessorsRequired = this->ParallelLevel;
std::string testWithMinProcessors;
@@ -292,15 +308,11 @@ void cmCTestMultiProcessHandler::StartNextTests()
allTestsFailedTestLoadCheck = true;
// Check for a fake load average value used in testing.
- std::string fake_load_value;
- if (cmSystemTools::GetEnv("__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING",
- fake_load_value)) {
- usedFakeLoadForTesting = true;
- if (!cmSystemTools::StringToULong(fake_load_value.c_str(),
- &systemLoad)) {
- cmSystemTools::Error("Failed to parse fake load value: ",
- fake_load_value.c_str());
- }
+ if (this->FakeLoadForTesting > 0) {
+ systemLoad = this->FakeLoadForTesting;
+ // Drop the fake load for the next iteration to a value low enough
+ // that the next iteration will start tests.
+ this->FakeLoadForTesting = 1;
}
// If it's not set, look up the true load average.
else {
@@ -384,18 +396,25 @@ void cmCTestMultiProcessHandler::StartNextTests()
}
cmCTestLog(this->CTest, HANDLER_OUTPUT, "*****" << std::endl);
- if (usedFakeLoadForTesting) {
- // Break out of the infinite loop of waiting for our fake load
- // to come down.
- this->StopTimePassed = true;
- } else {
- // Wait between 1 and 5 seconds before trying again.
- cmCTestScriptHandler::SleepInSeconds(cmSystemTools::RandomSeed() % 5 +
- 1);
+ // Wait between 1 and 5 seconds before trying again.
+ unsigned int milliseconds = (cmSystemTools::RandomSeed() % 5 + 1) * 1000;
+ if (this->FakeLoadForTesting) {
+ milliseconds = 10;
+ }
+ if (this->TestLoadRetryTimer.get() == nullptr) {
+ this->TestLoadRetryTimer.init(this->Loop, this);
}
+ this->TestLoadRetryTimer.start(
+ &cmCTestMultiProcessHandler::OnTestLoadRetryCB, milliseconds, 0);
}
}
+void cmCTestMultiProcessHandler::OnTestLoadRetryCB(uv_timer_t* timer)
+{
+ auto self = static_cast<cmCTestMultiProcessHandler*>(timer->data);
+ self->StartNextTests();
+}
+
void cmCTestMultiProcessHandler::FinishTestProcess(cmCTestRunTest* runner,
bool started)
{
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 203170e..07a5fe7 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -12,6 +12,7 @@
#include <string>
#include <vector>
+#include "cmUVHandlePtr.h"
#include "cm_uv.h"
class cmCTest;
@@ -101,6 +102,8 @@ protected:
void EraseTest(int index);
void FinishTestProcess(cmCTestRunTest* runner, bool started);
+ static void OnTestLoadRetryCB(uv_timer_t* timer);
+
void RemoveTest(int index);
// Check if we need to resume an interrupted test set
void CheckResume();
@@ -135,7 +138,9 @@ protected:
std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults;
size_t ParallelLevel; // max number of process that can be run at once
unsigned long TestLoad;
+ unsigned long FakeLoadForTesting;
uv_loop_t Loop;
+ cm::uv_timer_ptr TestLoadRetryTimer;
cmCTestTestHandler* TestHandler;
cmCTest* CTest;
bool HasCycles;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index d1d8d08..7fb5e80 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -2126,10 +2126,10 @@ bool cmCTestTestHandler::SetTestsProperties(
for (cmCTestTestProperties& rt : this->TestList) {
if (t == rt.Name) {
if (key == "WILL_FAIL") {
- rt.WillFail = cmSystemTools::IsOn(val.c_str());
+ rt.WillFail = cmSystemTools::IsOn(val);
}
if (key == "DISABLED") {
- rt.Disabled = cmSystemTools::IsOn(val.c_str());
+ rt.Disabled = cmSystemTools::IsOn(val);
}
if (key == "ATTACHED_FILES") {
cmSystemTools::ExpandListArgument(val, rt.AttachedFiles);
@@ -2172,7 +2172,7 @@ bool cmCTestTestHandler::SetTestsProperties(
cmSystemTools::ExpandListArgument(val, rt.RequiredFiles);
}
if (key == "RUN_SERIAL") {
- rt.RunSerial = cmSystemTools::IsOn(val.c_str());
+ rt.RunSerial = cmSystemTools::IsOn(val);
}
if (key == "FAIL_REGULAR_EXPRESSION") {
std::vector<std::string> lval;
@@ -2188,7 +2188,7 @@ bool cmCTestTestHandler::SetTestsProperties(
}
}
if (key == "PROCESSOR_AFFINITY") {
- rt.WantAffinity = cmSystemTools::IsOn(val.c_str());
+ rt.WantAffinity = cmSystemTools::IsOn(val);
}
if (key == "SKIP_RETURN_CODE") {
rt.SkipReturnCode = atoi(val.c_str());
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index a59d671..21c8889 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -146,7 +146,7 @@ bool cmCTestVC::Update()
// if update version only is on then do not actually update,
// just note the current version and finish
if (!cmSystemTools::IsOn(
- this->CTest->GetCTestConfiguration("UpdateVersionOnly").c_str())) {
+ this->CTest->GetCTestConfiguration("UpdateVersionOnly"))) {
result = this->NoteOldRevision() && result;
this->Log << "--- Begin Update ---\n";
result = this->UpdateImpl() && result;
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 4a379c3..931797a 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -709,7 +709,7 @@ void cmCursesMainForm::FixValue(cmStateEnums::CacheEntryType type,
cmSystemTools::ConvertToUnixSlashes(out);
}
if (type == cmStateEnums::BOOL) {
- if (cmSystemTools::IsOff(out.c_str())) {
+ if (cmSystemTools::IsOff(out)) {
out = "OFF";
} else {
out = "ON";
diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui
index 8d8e0cd..dc22a29 100644
--- a/Source/QtDialog/CMakeSetupDialog.ui
+++ b/Source/QtDialog/CMakeSetupDialog.ui
@@ -57,6 +57,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="styleSheet">
+ <string notr="true">padding-left: 0</string>
+ </property>
<property name="editable">
<bool>true</bool>
</property>
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 3d3d526..6639787 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -292,8 +292,7 @@ cmCTest::cmCTest()
this->RepeatUntilFail = false;
std::string outOnFail;
if (cmSystemTools::GetEnv("CTEST_OUTPUT_ON_FAILURE", outOnFail)) {
- this->OutputTestOutputOnTestFailure =
- !cmSystemTools::IsOff(outOnFail.c_str());
+ this->OutputTestOutputOnTestFailure = !cmSystemTools::IsOff(outOnFail);
}
this->InitStreams();
@@ -477,11 +476,13 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
tag.clear();
}
std::string track;
- if (cmSystemTools::GetLineFromStream(tfin, track)) {
+ if (cmSystemTools::GetLineFromStream(tfin, track) &&
+ !this->Parts[PartStart] && !command) {
this->SpecificTrack = track;
}
std::string model;
- if (cmSystemTools::GetLineFromStream(tfin, model)) {
+ if (cmSystemTools::GetLineFromStream(tfin, model) &&
+ !this->Parts[PartStart] && !command) {
this->TestModel = GetTestModelFromString(model.c_str());
}
tfin.close();
@@ -747,8 +748,8 @@ bool cmCTest::UpdateCTestConfiguration()
}
}
if (this->ProduceXML) {
- this->CompressXMLFiles = cmSystemTools::IsOn(
- this->GetCTestConfiguration("CompressSubmission").c_str());
+ this->CompressXMLFiles =
+ cmSystemTools::IsOn(this->GetCTestConfiguration("CompressSubmission"));
}
return true;
}
@@ -1936,7 +1937,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "--interactive-debug-mode") &&
i < args.size() - 1) {
i++;
- this->InteractiveDebugMode = cmSystemTools::IsOn(args[i].c_str());
+ this->InteractiveDebugMode = cmSystemTools::IsOn(args[i]);
}
if (this->CheckArgument(arg, "--submit-index") && i < args.size() - 1) {
i++;
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 5091c97..b391dc4 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -127,15 +127,15 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
}
this->CacheMajorVersion = 0;
this->CacheMinorVersion = 0;
- if (const char* cmajor =
+ if (const std::string* cmajor =
this->GetInitializedCacheValue("CMAKE_CACHE_MAJOR_VERSION")) {
unsigned int v = 0;
- if (sscanf(cmajor, "%u", &v) == 1) {
+ if (sscanf(cmajor->c_str(), "%u", &v) == 1) {
this->CacheMajorVersion = v;
}
- if (const char* cminor =
+ if (const std::string* cminor =
this->GetInitializedCacheValue("CMAKE_CACHE_MINOR_VERSION")) {
- if (sscanf(cminor, "%u", &v) == 1) {
+ if (sscanf(cminor->c_str(), "%u", &v) == 1) {
this->CacheMinorVersion = v;
}
}
@@ -153,18 +153,20 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
}
// check to make sure the cache directory has not
// been moved
- const char* oldDir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR");
+ const std::string* oldDir =
+ this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR");
if (internal && oldDir) {
std::string currentcwd = path;
- std::string oldcwd = oldDir;
+ std::string oldcwd = *oldDir;
cmSystemTools::ConvertToUnixSlashes(currentcwd);
currentcwd += "/CMakeCache.txt";
oldcwd += "/CMakeCache.txt";
if (!cmSystemTools::SameFile(oldcwd, currentcwd)) {
+ const std::string* dir =
+ this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR");
std::ostringstream message;
message << "The current CMakeCache.txt directory " << currentcwd
- << " is different than the directory "
- << this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")
+ << " is different than the directory " << (dir ? *dir : "")
<< " where CMakeCache.txt was created. This may result "
"in binaries being created in the wrong place. If you "
"are not sure, reedit the CMakeCache.txt";
@@ -512,12 +514,12 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(const char* key)
return CacheIterator(*this, key);
}
-const char* cmCacheManager::GetInitializedCacheValue(
+const std::string* cmCacheManager::GetInitializedCacheValue(
const std::string& key) const
{
CacheEntryMap::const_iterator i = this->Cache.find(key);
if (i != this->Cache.end() && i->second.Initialized) {
- return i->second.Value.c_str();
+ return &i->second.Value;
}
return nullptr;
}
@@ -616,7 +618,7 @@ void cmCacheManager::CacheIterator::SetValue(const char* value)
bool cmCacheManager::CacheIterator::GetValueAsBool() const
{
- return cmSystemTools::IsOn(this->GetEntry().Value.c_str());
+ return cmSystemTools::IsOn(this->GetEntry().Value);
}
std::vector<std::string> cmCacheManager::CacheEntry::GetPropertyList() const
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 73923d1..a269271 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -126,7 +126,7 @@ public:
int GetSize() { return static_cast<int>(this->Cache.size()); }
///! Get a value from the cache given a key
- const char* GetInitializedCacheValue(const std::string& key) const;
+ const std::string* GetInitializedCacheValue(const std::string& key) const;
const char* GetCacheEntryValue(const std::string& key)
{
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index b1f3860..aa17de6 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -279,12 +279,12 @@ cmComputeLinkDepends::Compute()
return this->FinalLinkEntries;
}
-std::map<std::string, int>::iterator cmComputeLinkDepends::AllocateLinkEntry(
- std::string const& item)
+std::map<cmLinkItem, int>::iterator cmComputeLinkDepends::AllocateLinkEntry(
+ cmLinkItem const& item)
{
- std::map<std::string, int>::value_type index_entry(
+ std::map<cmLinkItem, int>::value_type index_entry(
item, static_cast<int>(this->EntryList.size()));
- std::map<std::string, int>::iterator lei =
+ std::map<cmLinkItem, int>::iterator lei =
this->LinkEntryIndex.insert(index_entry).first;
this->EntryList.emplace_back();
this->InferredDependSets.push_back(nullptr);
@@ -295,7 +295,7 @@ std::map<std::string, int>::iterator cmComputeLinkDepends::AllocateLinkEntry(
int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item)
{
// Check if the item entry has already been added.
- std::map<std::string, int>::iterator lei = this->LinkEntryIndex.find(item);
+ std::map<cmLinkItem, int>::iterator lei = this->LinkEntryIndex.find(item);
if (lei != this->LinkEntryIndex.end()) {
// Yes. We do not need to follow the item's dependencies again.
return lei->second;
@@ -307,10 +307,11 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item)
// Initialize the item entry.
int index = lei->second;
LinkEntry& entry = this->EntryList[index];
- entry.Item = item;
+ entry.Item = item.AsStr();
entry.Target = item.Target;
- entry.IsFlag = (!entry.Target && item[0] == '-' && item[1] != 'l' &&
- item.substr(0, 10) != "-framework");
+ entry.IsFlag =
+ (!entry.Target && entry.Item[0] == '-' && entry.Item[1] != 'l' &&
+ entry.Item.substr(0, 10) != "-framework");
// If the item has dependencies queue it to follow them.
if (entry.Target) {
@@ -395,7 +396,7 @@ void cmComputeLinkDepends::QueueSharedDependencies(
void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
{
// Check if the target already has an entry.
- std::map<std::string, int>::iterator lei =
+ std::map<cmLinkItem, int>::iterator lei =
this->LinkEntryIndex.find(dep.Item);
if (lei == this->LinkEntryIndex.end()) {
// Allocate a spot for the item entry.
@@ -403,7 +404,7 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
// Initialize the item entry.
LinkEntry& entry = this->EntryList[lei->second];
- entry.Item = dep.Item;
+ entry.Item = dep.Item.AsStr();
entry.Target = dep.Item.Target;
// This item was added specifically because it is a dependent
@@ -473,9 +474,9 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
// If the library is meant for this link type then use it.
if (llt == GENERAL_LibraryType || llt == this->LinkType) {
- actual_libs.emplace_back(d, this->FindTargetToLink(depender_index, d));
+ actual_libs.emplace_back(this->ResolveLinkItem(depender_index, d));
} else if (this->OldLinkDirMode) {
- cmLinkItem item(d, this->FindTargetToLink(depender_index, d));
+ cmLinkItem item = this->ResolveLinkItem(depender_index, d);
this->CheckWrongConfigItem(item);
}
@@ -512,7 +513,7 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index,
// Skip entries that will resolve to the target getting linked or
// are empty.
cmLinkItem const& item = l;
- if (item == this->Target->GetName() || item.empty()) {
+ if (item.AsStr() == this->Target->GetName() || item.AsStr().empty()) {
continue;
}
@@ -553,8 +554,8 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index,
}
}
-cmGeneratorTarget const* cmComputeLinkDepends::FindTargetToLink(
- int depender_index, const std::string& name)
+cmLinkItem cmComputeLinkDepends::ResolveLinkItem(int depender_index,
+ const std::string& name)
{
// Look for a target in the scope of the depender.
cmGeneratorTarget const* from = this->Target;
@@ -564,7 +565,7 @@ cmGeneratorTarget const* cmComputeLinkDepends::FindTargetToLink(
from = depender;
}
}
- return from->FindTargetToLink(name);
+ return from->ResolveLinkItem(name);
}
void cmComputeLinkDepends::InferDependencies()
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index dd0e029..66fb1e6 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -72,19 +72,18 @@ private:
std::string Config;
EntryVector FinalLinkEntries;
- std::map<std::string, int>::iterator AllocateLinkEntry(
- std::string const& item);
+ std::map<cmLinkItem, int>::iterator AllocateLinkEntry(
+ cmLinkItem const& item);
int AddLinkEntry(cmLinkItem const& item);
void AddVarLinkEntries(int depender_index, const char* value);
void AddDirectLinkEntries();
template <typename T>
void AddLinkEntries(int depender_index, std::vector<T> const& libs);
- cmGeneratorTarget const* FindTargetToLink(int depender_index,
- const std::string& name);
+ cmLinkItem ResolveLinkItem(int depender_index, const std::string& name);
// One entry for each unique item.
std::vector<LinkEntry> EntryList;
- std::map<std::string, int> LinkEntryIndex;
+ std::map<cmLinkItem, int> LinkEntryIndex;
// BFS of initial dependencies.
struct BFSEntry
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index efdd3a5..268e749 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -195,7 +195,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
// dependencies in all targets, because the generated build-systems can't
// deal with config-specific dependencies.
{
- std::set<std::string> emitted;
+ std::set<cmLinkItem> emitted;
std::vector<std::string> configs;
depender->Makefile->GetConfigurations(configs);
@@ -206,27 +206,31 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
std::vector<cmSourceFile const*> objectFiles;
depender->GetExternalObjects(objectFiles, it);
for (cmSourceFile const* o : objectFiles) {
- std::string objLib = o->GetObjectLibrary();
- if (!objLib.empty() && emitted.insert(objLib).second) {
- if (depender->GetType() != cmStateEnums::EXECUTABLE &&
- depender->GetType() != cmStateEnums::STATIC_LIBRARY &&
- depender->GetType() != cmStateEnums::SHARED_LIBRARY &&
- depender->GetType() != cmStateEnums::MODULE_LIBRARY &&
- depender->GetType() != cmStateEnums::OBJECT_LIBRARY) {
- this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR,
- "Only executables and libraries may reference target objects.",
- depender->GetBacktrace());
- return;
+ std::string const& objLib = o->GetObjectLibrary();
+ if (!objLib.empty()) {
+ cmLinkItem const& objItem = depender->ResolveLinkItem(objLib);
+ if (emitted.insert(objItem).second) {
+ if (depender->GetType() != cmStateEnums::EXECUTABLE &&
+ depender->GetType() != cmStateEnums::STATIC_LIBRARY &&
+ depender->GetType() != cmStateEnums::SHARED_LIBRARY &&
+ depender->GetType() != cmStateEnums::MODULE_LIBRARY &&
+ depender->GetType() != cmStateEnums::OBJECT_LIBRARY) {
+ this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
+ cmake::FATAL_ERROR,
+ "Only executables and libraries may reference target objects.",
+ depender->GetBacktrace());
+ return;
+ }
+ const_cast<cmGeneratorTarget*>(depender)->Target->AddUtility(
+ objLib);
}
- const_cast<cmGeneratorTarget*>(depender)->Target->AddUtility(objLib);
}
}
cmLinkImplementation const* impl = depender->GetLinkImplementation(it);
// A target should not depend on itself.
- emitted.insert(depender->GetName());
+ emitted.insert(cmLinkItem(depender));
for (cmLinkImplItem const& lib : impl->Libraries) {
// Don't emit the same library twice for this target.
if (emitted.insert(lib).second) {
@@ -240,9 +244,9 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
// Loop over all utility dependencies.
{
std::set<cmLinkItem> const& tutils = depender->GetUtilityItems();
- std::set<std::string> emitted;
+ std::set<cmLinkItem> emitted;
// A target should not depend on itself.
- emitted.insert(depender->GetName());
+ emitted.insert(cmLinkItem(depender));
for (cmLinkItem const& litem : tutils) {
// Don't emit the same utility twice for this target.
if (emitted.insert(litem).second) {
@@ -254,7 +258,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
void cmComputeTargetDepends::AddInterfaceDepends(
int depender_index, const cmGeneratorTarget* dependee,
- const std::string& config, std::set<std::string>& emitted)
+ const std::string& config, std::set<cmLinkItem>& emitted)
{
cmGeneratorTarget const* depender = this->Targets[depender_index];
if (cmLinkInterface const* iface =
@@ -271,7 +275,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(
void cmComputeTargetDepends::AddInterfaceDepends(
int depender_index, cmLinkItem const& dependee_name,
- const std::string& config, std::set<std::string>& emitted)
+ const std::string& config, std::set<cmLinkItem>& emitted)
{
cmGeneratorTarget const* depender = this->Targets[depender_index];
cmGeneratorTarget const* dependee = dependee_name.Target;
@@ -285,7 +289,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(
if (dependee) {
// A target should not depend on itself.
- emitted.insert(depender->GetName());
+ emitted.insert(cmLinkItem(depender));
this->AddInterfaceDepends(depender_index, dependee, config, emitted);
}
}
@@ -324,7 +328,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
<< depender->GetName() << "\" does not exist.";
cmListFileBacktrace const* backtrace =
- depender->GetUtilityBacktrace(dependee_name);
+ depender->GetUtilityBacktrace(dependee_name.AsStr());
if (backtrace) {
cm->IssueMessage(messageType, e.str(), *backtrace);
} else {
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index e93e376..3046e8a 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -51,11 +51,11 @@ private:
bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
void AddInterfaceDepends(int depender_index, cmLinkItem const& dependee_name,
const std::string& config,
- std::set<std::string>& emitted);
+ std::set<cmLinkItem>& emitted);
void AddInterfaceDepends(int depender_index,
cmGeneratorTarget const* dependee,
const std::string& config,
- std::set<std::string>& emitted);
+ std::set<cmLinkItem>& emitted);
cmGlobalGenerator* GlobalGenerator;
bool DebugMode;
bool NoCycles;
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index e766854..5fafaf9 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -30,11 +30,11 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(const std::string& key,
return begin->Map.insert(MapType::value_type(key, def)).first->second;
}
-const char* cmDefinitions::Get(const std::string& key, StackIter begin,
- StackIter end)
+const std::string* cmDefinitions::Get(const std::string& key, StackIter begin,
+ StackIter end)
{
Def const& def = cmDefinitions::GetInternal(key, begin, end, false);
- return def.Exists ? def.c_str() : nullptr;
+ return def.Exists ? &def : nullptr;
}
void cmDefinitions::Raise(const std::string& key, StackIter begin,
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 528b157..4ab5be6 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -23,8 +23,8 @@ class cmDefinitions
typedef cmLinkedTree<cmDefinitions>::iterator StackIter;
public:
- static const char* Get(const std::string& key, StackIter begin,
- StackIter end);
+ static const std::string* Get(const std::string& key, StackIter begin,
+ StackIter end);
static void Raise(const std::string& key, StackIter begin, StackIter end);
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index bb370c4..3d32b84 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -108,7 +108,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
// build type of the makefile
cmGeneratorExpression ge;
cmGeneratorExpressionDAGChecker dagChecker(
- target->GetName(), "INTERFACE_LINK_LIBRARIES", nullptr, nullptr);
+ target, "INTERFACE_LINK_LIBRARIES", nullptr, nullptr);
std::unique_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(property.second);
std::string evaluated = cge->Evaluate(
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 75d3374..1c5040a 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -831,6 +831,16 @@ void cmExportFileGenerator::SetImportDetailProperties(
}
}
+static std::string const& asString(std::string const& l)
+{
+ return l;
+}
+
+static std::string const& asString(cmLinkItem const& l)
+{
+ return l.AsStr();
+}
+
template <typename T>
void cmExportFileGenerator::SetImportLinkProperty(
std::string const& suffix, cmGeneratorTarget* target,
@@ -850,7 +860,7 @@ void cmExportFileGenerator::SetImportLinkProperty(
link_entries += sep;
sep = ";";
- std::string temp = l;
+ std::string temp = asString(l);
this->AddTargetNamespace(temp, target, missingTargets);
link_entries += temp;
}
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 87648cb..c169032 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -65,8 +65,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName, nullptr,
- nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(tgt, propName, nullptr, nullptr);
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 14e7927..c4cca07 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -354,8 +354,8 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(
lg->GetTargetCompileFlags(gtgt, config, language, flags);
// Add source file specific flags.
- cmGeneratorExpressionInterpreter genexInterpreter(lg, gtgt, config,
- gtgt->GetName(), language);
+ cmGeneratorExpressionInterpreter genexInterpreter(lg, config, gtgt,
+ language);
const std::string COMPILE_FLAGS("COMPILE_FLAGS");
if (const char* cflags = source->GetProperty(COMPILE_FLAGS)) {
@@ -381,8 +381,8 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines(
cmMakefile* makefile = lg->GetMakefile();
const std::string& language = source->GetLanguage();
const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
- cmGeneratorExpressionInterpreter genexInterpreter(
- lg, target, config, target->GetName(), language);
+ cmGeneratorExpressionInterpreter genexInterpreter(lg, config, target,
+ language);
// Add the export symbol definition for shared library objects.
if (const char* exportMacro = target->GetExportMacro()) {
@@ -419,8 +419,8 @@ std::string cmExtraSublimeTextGenerator::ComputeIncludes(
cmMakefile* makefile = lg->GetMakefile();
const std::string& language = source->GetLanguage();
const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
- cmGeneratorExpressionInterpreter genexInterpreter(
- lg, target, config, target->GetName(), language);
+ cmGeneratorExpressionInterpreter genexInterpreter(lg, config, target,
+ language);
// Add include directories for this source file
const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES");
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 03d1ad1..effb446 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -23,7 +23,7 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args,
// what is the current source dir
std::string cdir = this->Makefile->GetCurrentSourceDirectory();
- const char* fluid_exe =
+ std::string const& fluid_exe =
this->Makefile->GetRequiredDefinition("FLTK_FLUID_EXECUTABLE");
// get parameter for the command
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 1c29017..54af2f4 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -784,10 +784,10 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
if (*i == "LIST_DIRECTORIES") {
++i; // skip LIST_DIRECTORIES
if (i != args.end()) {
- if (cmSystemTools::IsOn(i->c_str())) {
+ if (cmSystemTools::IsOn(*i)) {
g.SetListDirs(true);
g.SetRecurseListDirs(true);
- } else if (cmSystemTools::IsOff(i->c_str())) {
+ } else if (cmSystemTools::IsOff(*i)) {
g.SetListDirs(false);
g.SetRecurseListDirs(false);
} else {
@@ -1756,7 +1756,7 @@ struct cmFileInstaller : public cmFileCopier
// Check whether to copy files always or only if they have changed.
std::string install_always;
if (cmSystemTools::GetEnv("CMAKE_INSTALL_ALWAYS", install_always)) {
- this->Always = cmSystemTools::IsOn(install_always.c_str());
+ this->Always = cmSystemTools::IsOn(install_always);
}
// Get the current manifest.
this->Manifest =
@@ -2747,7 +2747,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
} else if (*i == "TLS_VERIFY") {
++i;
if (i != args.end()) {
- tls_verify = cmSystemTools::IsOn(i->c_str());
+ tls_verify = cmSystemTools::IsOn(*i);
} else {
this->SetError("TLS_VERIFY missing bool value.");
return false;
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 02bae82..1e1ab14 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -236,9 +236,9 @@ cmFindLibraryHelper::cmFindLibraryHelper(cmMakefile* mf)
this->GG = this->Makefile->GetGlobalGenerator();
// Collect the list of library name prefixes/suffixes to try.
- const char* prefixes_list =
+ std::string const& prefixes_list =
this->Makefile->GetRequiredDefinition("CMAKE_FIND_LIBRARY_PREFIXES");
- const char* suffixes_list =
+ std::string const& suffixes_list =
this->Makefile->GetRequiredDefinition("CMAKE_FIND_LIBRARY_SUFFIXES");
cmSystemTools::ExpandListArgument(prefixes_list, this->Prefixes, true);
cmSystemTools::ExpandListArgument(suffixes_list, this->Suffixes, true);
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 6823cd5..658e9a7 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -389,14 +389,16 @@ void cmCompiledGeneratorExpression::GetMaxLanguageStandard(
const std::string& cmGeneratorExpressionInterpreter::Evaluate(
const char* expression, const std::string& property)
{
- if (this->Target.empty()) {
- return this->EvaluateExpression(expression);
- }
+ this->CompiledGeneratorExpression =
+ this->GeneratorExpression.Parse(expression);
// Specify COMPILE_OPTIONS to DAGchecker, same semantic as COMPILE_FLAGS
cmGeneratorExpressionDAGChecker dagChecker(
- this->Target, property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property,
- nullptr, nullptr);
+ this->HeadTarget,
+ property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property, nullptr,
+ nullptr);
- return this->EvaluateExpression(expression, &dagChecker);
+ return this->CompiledGeneratorExpression->Evaluate(
+ this->LocalGenerator, this->Config, false, this->HeadTarget, &dagChecker,
+ this->Language);
}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 2b7df91..8176d5c 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -160,24 +160,15 @@ class cmGeneratorExpressionInterpreter
public:
cmGeneratorExpressionInterpreter(cmLocalGenerator* localGenerator,
- cmGeneratorTarget* generatorTarget,
- const std::string& config,
- const std::string& target,
- const std::string& lang)
+ std::string const& config,
+ cmGeneratorTarget const* headTarget,
+ std::string const& lang = std::string())
: LocalGenerator(localGenerator)
- , GeneratorTarget(generatorTarget)
, Config(config)
- , Target(target)
+ , HeadTarget(headTarget)
, Language(lang)
{
}
- cmGeneratorExpressionInterpreter(cmLocalGenerator* localGenerator,
- cmGeneratorTarget* generatorTarget,
- const std::string& config)
- : cmGeneratorExpressionInterpreter(localGenerator, generatorTarget, config,
- std::string(), std::string())
- {
- }
const std::string& Evaluate(const char* expression,
const std::string& property);
@@ -188,47 +179,11 @@ public:
}
protected:
- cmGeneratorExpression& GetGeneratorExpression()
- {
- return this->GeneratorExpression;
- }
-
- cmCompiledGeneratorExpression& GetCompiledGeneratorExpression()
- {
- return *(this->CompiledGeneratorExpression);
- }
-
- cmLocalGenerator* GetLocalGenerator() { return this->LocalGenerator; }
-
- cmGeneratorTarget* GetGeneratorTarget() { return this->GeneratorTarget; }
-
- const std::string& GetTargetName() const { return this->Target; }
- const std::string& GetLanguage() const { return this->Language; }
-
- const std::string& EvaluateExpression(
- const char* expression,
- cmGeneratorExpressionDAGChecker* dagChecker = nullptr)
- {
- this->CompiledGeneratorExpression =
- this->GeneratorExpression.Parse(expression);
-
- if (dagChecker == nullptr) {
- return this->CompiledGeneratorExpression->Evaluate(
- this->LocalGenerator, this->Config, false, this->GeneratorTarget);
- }
-
- return this->CompiledGeneratorExpression->Evaluate(
- this->LocalGenerator, this->Config, false, this->GeneratorTarget,
- dagChecker, this->Language);
- }
-
-private:
cmGeneratorExpression GeneratorExpression;
std::unique_ptr<cmCompiledGeneratorExpression> CompiledGeneratorExpression;
cmLocalGenerator* LocalGenerator = nullptr;
- cmGeneratorTarget* GeneratorTarget = nullptr;
std::string Config;
- std::string Target;
+ cmGeneratorTarget const* HeadTarget = nullptr;
std::string Language;
};
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index face282..8d57441 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -14,7 +14,7 @@
#include <utility>
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
- const cmListFileBacktrace& backtrace, const std::string& target,
+ const cmListFileBacktrace& backtrace, cmGeneratorTarget const* target,
const std::string& property, const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* parent)
: Parent(parent)
@@ -28,7 +28,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
}
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
- const std::string& target, const std::string& property,
+ cmGeneratorTarget const* target, const std::string& property,
const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* parent)
: Parent(parent)
@@ -58,8 +58,8 @@ void cmGeneratorExpressionDAGChecker::Initialize()
TEST_TRANSITIVE_PROPERTY_METHOD) false)) // NOLINT(clang-tidy)
#undef TEST_TRANSITIVE_PROPERTY_METHOD
{
- std::map<std::string, std::set<std::string>>::const_iterator it =
- top->Seen.find(this->Target);
+ std::map<cmGeneratorTarget const*, std::set<std::string>>::const_iterator
+ it = top->Seen.find(this->Target);
if (it != top->Seen.end()) {
const std::set<std::string>& propSet = it->second;
if (propSet.find(this->Property) != propSet.end()) {
@@ -166,7 +166,8 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingGenexExpression()
return top->Property == "TARGET_GENEX_EVAL" || top->Property == "GENEX_EVAL";
}
-bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char* tgt)
+bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(
+ cmGeneratorTarget const* tgt)
{
const cmGeneratorExpressionDAGChecker* top = this;
const cmGeneratorExpressionDAGChecker* parent = this->Parent;
@@ -189,7 +190,7 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char* tgt)
strcmp(prop, "INTERFACE_LINK_LIBRARIES") == 0;
}
-std::string cmGeneratorExpressionDAGChecker::TopTarget() const
+cmGeneratorTarget const* cmGeneratorExpressionDAGChecker::TopTarget() const
{
const cmGeneratorExpressionDAGChecker* top = this;
const cmGeneratorExpressionDAGChecker* parent = this->Parent;
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index cd23904..8b1697b 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -13,6 +13,7 @@
struct GeneratorExpressionContent;
struct cmGeneratorExpressionContext;
+class cmGeneratorTarget;
#define CM_SELECT_BOTH(F, A1, A2) F(A1, A2)
#define CM_SELECT_FIRST(F, A1, A2) F(A1)
@@ -41,11 +42,11 @@ struct cmGeneratorExpressionContext;
struct cmGeneratorExpressionDAGChecker
{
cmGeneratorExpressionDAGChecker(const cmListFileBacktrace& backtrace,
- const std::string& target,
+ cmGeneratorTarget const* target,
const std::string& property,
const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* parent);
- cmGeneratorExpressionDAGChecker(const std::string& target,
+ cmGeneratorExpressionDAGChecker(cmGeneratorTarget const* target,
const std::string& property,
const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* parent);
@@ -64,7 +65,7 @@ struct cmGeneratorExpressionDAGChecker
const std::string& expr);
bool EvaluatingGenexExpression();
- bool EvaluatingLinkLibraries(const char* tgt = nullptr);
+ bool EvaluatingLinkLibraries(cmGeneratorTarget const* tgt = nullptr);
#define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) bool METHOD() const;
@@ -75,7 +76,7 @@ struct cmGeneratorExpressionDAGChecker
bool GetTransitivePropertiesOnly();
void SetTransitivePropertiesOnly() { this->TransitivePropertiesOnly = true; }
- std::string TopTarget() const;
+ cmGeneratorTarget const* TopTarget() const;
private:
Result CheckGraph() const;
@@ -83,9 +84,9 @@ private:
private:
const cmGeneratorExpressionDAGChecker* const Parent;
- const std::string Target;
+ cmGeneratorTarget const* Target;
const std::string Property;
- std::map<std::string, std::set<std::string>> Seen;
+ std::map<cmGeneratorTarget const*, std::set<std::string>> Seen;
const GeneratorExpressionContent* const Content;
const cmListFileBacktrace Backtrace;
Result CheckResult;
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 3381e6d..1e51f09 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -156,7 +156,7 @@ static const struct BoolNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent* /*content*/,
cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
{
- return !cmSystemTools::IsOff(parameters.begin()->c_str()) ? "1" : "0";
+ return !cmSystemTools::IsOff(*parameters.begin()) ? "1" : "0";
}
} boolNode;
@@ -378,8 +378,8 @@ protected:
{
if (context->HeadTarget) {
cmGeneratorExpressionDAGChecker dagChecker(
- context->Backtrace, context->HeadTarget->GetName(), genexOperator,
- content, dagCheckerParent);
+ context->Backtrace, context->HeadTarget, genexOperator, content,
+ dagCheckerParent);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: {
@@ -1196,9 +1196,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
return target->GetLinkerLanguage(context->Config);
}
- cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace,
- target->GetName(), propertyName,
- content, dagCheckerParent);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ context->Backtrace, target, propertyName, content, dagCheckerParent);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
@@ -1911,9 +1910,9 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
return std::string();
}
if (dagChecker &&
- (dagChecker->EvaluatingLinkLibraries(name.c_str()) ||
+ (dagChecker->EvaluatingLinkLibraries(target) ||
(dagChecker->EvaluatingSources() &&
- name == dagChecker->TopTarget()))) {
+ target == dagChecker->TopTarget()))) {
::reportError(context, content->GetOriginalExpression(),
"Expressions which require the linker language may not "
"be used while evaluating link libraries");
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index eb1852d..e8e7b90 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -671,9 +671,12 @@ std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
this->UtilityItemsDone = true;
std::set<std::string> const& utilities = this->GetUtilities();
for (std::string const& i : utilities) {
- cmGeneratorTarget* gt =
- this->LocalGenerator->FindGeneratorTargetToUse(i);
- this->UtilityItems.insert(cmLinkItem(i, gt));
+ if (cmGeneratorTarget* gt =
+ this->LocalGenerator->FindGeneratorTargetToUse(i)) {
+ this->UtilityItems.insert(cmLinkItem(gt));
+ } else {
+ this->UtilityItems.insert(cmLinkItem(i));
+ }
}
}
return this->UtilityItems;
@@ -770,7 +773,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
if (iter == this->SystemIncludesCache.end()) {
cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr);
+ this, "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr);
bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED");
@@ -816,7 +819,8 @@ static void AddInterfaceEntries(
thisTarget->GetLinkImplementationLibraries(config)) {
for (cmLinkImplItem const& lib : impl->Libraries) {
if (lib.Target) {
- std::string genex = "$<TARGET_PROPERTY:" + lib + "," + prop + ">";
+ std::string genex =
+ "$<TARGET_PROPERTY:" + lib.AsStr() + "," + prop + ">";
cmGeneratorExpression ge(lib.Backtrace);
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
cge->SetEvaluateForBuildsystem(true);
@@ -836,7 +840,7 @@ static void AddObjectEntries(
for (cmLinkImplItem const& lib : impl->Libraries) {
if (lib.Target &&
lib.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
- std::string genex = "$<TARGET_OBJECTS:" + lib + ">";
+ std::string genex = "$<TARGET_OBJECTS:" + lib.AsStr() + ">";
cmGeneratorExpression ge(lib.Backtrace);
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
cge->SetEvaluateForBuildsystem(true);
@@ -860,7 +864,7 @@ static bool processSources(
for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) {
cmLinkImplItem const& item = entry->LinkImplItem;
- std::string const& targetName = item;
+ std::string const& targetName = item.AsStr();
std::vector<std::string> entrySources;
cmSystemTools::ExpandListArgument(
entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt, tgt,
@@ -960,8 +964,8 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files,
this->DebugSourcesDone = true;
}
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "SOURCES",
- nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "SOURCES", nullptr,
+ nullptr);
std::unordered_set<std::string> uniqueSrcs;
bool contextDependentDirectSources =
@@ -1756,7 +1760,7 @@ public:
void Visit(cmLinkItem const& item)
{
if (!item.Target) {
- if (item.find("::") != std::string::npos) {
+ if (item.AsStr().find("::") != std::string::npos) {
bool noMessage = false;
cmake::MessageType messageType = cmake::FATAL_ERROR;
std::ostringstream e;
@@ -1777,7 +1781,7 @@ public:
if (!noMessage) {
e << "Target \"" << this->Target->GetName()
- << "\" links to target \"" << item
+ << "\" links to target \"" << item.AsStr()
<< "\" but the target was not found. Perhaps a find_package() "
"call is missing for an IMPORTED target, or an ALIAS target is "
"missing?";
@@ -2074,8 +2078,8 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result,
}
cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "AUTOUIC_OPTIONS", nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "AUTOUIC_OPTIONS", nullptr,
+ nullptr);
cmSystemTools::ExpandListArgument(
ge.Parse(prop)->Evaluate(this->LocalGenerator, config, false, this,
&dagChecker),
@@ -2477,7 +2481,7 @@ static void processIncludeDirectories(
{
for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) {
cmLinkImplItem const& item = entry->LinkImplItem;
- std::string const& targetName = item;
+ std::string const& targetName = item.AsStr();
bool const fromImported = item.Target && item.Target->IsImported();
bool const checkCMP0027 = item.FromGenex;
std::vector<std::string> entryIncludes;
@@ -2556,7 +2560,7 @@ static void processIncludeDirectories(
}
}
- if (!cmSystemTools::IsOff(entryInclude.c_str())) {
+ if (!cmSystemTools::IsOff(entryInclude)) {
cmSystemTools::ConvertToUnixSlashes(entryInclude);
}
std::string inc = entryInclude;
@@ -2584,8 +2588,8 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
std::vector<std::string> includes;
std::unordered_set<std::string> uniqueIncludes;
- cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "INCLUDE_DIRECTORIES", nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "INCLUDE_DIRECTORIES",
+ nullptr, nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2615,7 +2619,7 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
cmLinkImplementationLibraries const* impl =
this->GetLinkImplementationLibraries(config);
for (cmLinkImplItem const& lib : impl->Libraries) {
- std::string libDir = cmSystemTools::CollapseFullPath(lib);
+ std::string libDir = cmSystemTools::CollapseFullPath(lib.AsStr());
static cmsys::RegularExpression frameworkCheck(
"(.*\\.framework)(/Versions/[^/]+)?/[^/]+$");
@@ -2706,8 +2710,8 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string>& result,
{
std::unordered_set<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "COMPILE_OPTIONS", nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_OPTIONS", nullptr,
+ nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2759,8 +2763,8 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string>& result,
{
std::unordered_set<std::string> uniqueFeatures;
- cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "COMPILE_FEATURES", nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_FEATURES", nullptr,
+ nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2810,8 +2814,8 @@ void cmGeneratorTarget::GetCompileDefinitions(
{
std::unordered_set<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "COMPILE_DEFINITIONS", nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_DEFINITIONS",
+ nullptr, nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -2891,8 +2895,8 @@ void cmGeneratorTarget::GetLinkOptions(std::vector<std::string>& result,
{
std::unordered_set<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "LINK_OPTIONS",
- nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_OPTIONS", nullptr,
+ nullptr);
std::vector<std::string> debugProperties;
const char* debugProp =
@@ -3039,8 +3043,8 @@ void cmGeneratorTarget::GetStaticLibraryLinkOptions(
std::vector<cmGeneratorTarget::TargetPropertyEntry*> entries;
std::unordered_set<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "STATIC_LIBRARY_OPTIONS", nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "STATIC_LIBRARY_OPTIONS",
+ nullptr, nullptr);
if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) {
std::vector<std::string> options;
@@ -3079,8 +3083,8 @@ void cmGeneratorTarget::GetLinkDepends(std::vector<std::string>& result,
{
std::vector<cmGeneratorTarget::TargetPropertyEntry*> linkDependsEntries;
std::unordered_set<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "LINK_DEPENDS",
- nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_DEPENDS", nullptr,
+ nullptr);
if (const char* linkDepends = this->GetProperty("LINK_DEPENDS")) {
std::vector<std::string> depends;
@@ -4495,7 +4499,7 @@ void cmGeneratorTarget::LookupLinkItems(std::vector<std::string> const& names,
if (name == this->GetName() || name.empty()) {
continue;
}
- items.emplace_back(name, this->FindTargetToLink(name));
+ items.push_back(this->ResolveLinkItem(name));
}
}
@@ -4505,8 +4509,7 @@ void cmGeneratorTarget::ExpandLinkItems(
std::vector<cmLinkItem>& items, bool& hadHeadSensitiveCondition) const
{
cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, nullptr,
- nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, prop, nullptr, nullptr);
// The $<LINK_ONLY> expression may be in a link interface to specify private
// link dependencies that are otherwise excluded from usage requirements.
if (usage_requirements_only) {
@@ -4571,7 +4574,7 @@ void cmGeneratorTarget::ComputeLinkInterface(
this->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
// Shared libraries may have runtime implementation dependencies
// on other shared libraries that are not in the interface.
- std::unordered_set<std::string> emitted;
+ std::set<cmLinkItem> emitted;
for (cmLinkItem const& lib : iface.Libraries) {
emitted.insert(lib);
}
@@ -5557,8 +5560,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
end = entryRange.end();
le != end; ++le, ++btIt) {
std::vector<std::string> llibs;
- cmGeneratorExpressionDAGChecker dagChecker(
- this->GetName(), "LINK_LIBRARIES", nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_LIBRARIES", nullptr,
+ nullptr);
cmGeneratorExpression ge(*btIt);
std::unique_ptr<cmCompiledGeneratorExpression> const cge = ge.Parse(*le);
std::string const& evaluated =
@@ -5603,7 +5606,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
}
// The entry is meant for this configuration.
- impl.Libraries.emplace_back(name, this->FindTargetToLink(name), *btIt,
+ impl.Libraries.emplace_back(this->ResolveLinkItem(name), *btIt,
evaluated != *le);
}
@@ -5631,14 +5634,12 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
continue;
}
// Support OLD behavior for CMP0003.
- impl.WrongConfigLibraries.emplace_back(name,
- this->FindTargetToLink(name));
+ impl.WrongConfigLibraries.push_back(this->ResolveLinkItem(name));
}
}
}
-cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink(
- std::string const& name) const
+cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name) const
{
cmGeneratorTarget* tgt =
this->LocalGenerator->FindGeneratorTargetToUse(name);
@@ -5651,7 +5652,11 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink(
tgt = nullptr;
}
- return tgt;
+ if (tgt) {
+ return cmLinkItem(tgt);
+ }
+
+ return cmLinkItem(name);
}
std::string cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 1030d91..a847e21 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -357,7 +357,7 @@ public:
cmOptionalLinkImplementation& impl,
const cmGeneratorTarget* head) const;
- cmGeneratorTarget* FindTargetToLink(std::string const& name) const;
+ cmLinkItem ResolveLinkItem(std::string const& name) const;
// Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 92ede7f..b5212fc 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -176,7 +176,7 @@ std::string cmGlobalGenerator::SelectMakeProgram(
const std::string& inMakeProgram, const std::string& makeDefault) const
{
std::string makeProgram = inMakeProgram;
- if (cmSystemTools::IsOff(makeProgram.c_str())) {
+ if (cmSystemTools::IsOff(makeProgram)) {
const char* makeProgramCSTR =
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
if (cmSystemTools::IsOff(makeProgramCSTR)) {
@@ -184,7 +184,7 @@ std::string cmGlobalGenerator::SelectMakeProgram(
} else {
makeProgram = makeProgramCSTR;
}
- if (cmSystemTools::IsOff(makeProgram.c_str()) && !makeProgram.empty()) {
+ if (cmSystemTools::IsOff(makeProgram) && !makeProgram.empty()) {
makeProgram = "CMAKE_MAKE_PROGRAM-NOTFOUND";
}
}
@@ -205,7 +205,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang,
}
return;
}
- const char* name = mf->GetRequiredDefinition(langComp);
+ std::string const& name = mf->GetRequiredDefinition(langComp);
std::string path;
if (!cmSystemTools::FileIsFullPath(name)) {
path = cmSystemTools::FindProgram(name);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 28cbdc7..21121f2 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -679,7 +679,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
std::unique_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(propertyValue);
if (cmSystemTools::IsOn(
- cge->Evaluate(target->GetLocalGenerator(), i).c_str())) {
+ cge->Evaluate(target->GetLocalGenerator(), i))) {
activeConfigs.insert(i);
}
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 7456d3c..e353a37 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -751,11 +751,10 @@ class XCodeGeneratorExpressionInterpreter
public:
XCodeGeneratorExpressionInterpreter(cmSourceFile* sourceFile,
cmLocalGenerator* localGenerator,
- cmGeneratorTarget* generatorTarget,
+ cmGeneratorTarget* headTarget,
const std::string& lang)
- : cmGeneratorExpressionInterpreter(localGenerator, generatorTarget,
- "NO-PER-CONFIG-SUPPORT-IN-XCODE",
- generatorTarget->GetName(), lang)
+ : cmGeneratorExpressionInterpreter(
+ localGenerator, "NO-PER-CONFIG-SUPPORT-IN-XCODE", headTarget, lang)
, SourceFile(sourceFile)
{
}
@@ -767,8 +766,7 @@ public:
{
const std::string& processed =
this->cmGeneratorExpressionInterpreter::Evaluate(expression, property);
- if (this->GetCompiledGeneratorExpression()
- .GetHadContextSensitiveCondition()) {
+ if (this->CompiledGeneratorExpression->GetHadContextSensitiveCondition()) {
std::ostringstream e;
/* clang-format off */
e <<
@@ -777,7 +775,7 @@ public:
"specified for source:\n"
" " << this->SourceFile->GetFullPath() << "\n";
/* clang-format on */
- this->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->LocalGenerator->IssueMessage(cmake::FATAL_ERROR, e.str());
}
return processed;
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 4f80fb8..eaaf64d 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -120,7 +120,7 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string& inc)
return;
}
- if (!cmSystemTools::IsOff(inc.c_str())) {
+ if (!cmSystemTools::IsOff(inc)) {
cmSystemTools::ConvertToUnixSlashes(inc);
if (!cmSystemTools::FileIsFullPath(inc)) {
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index 3ffeabd..0e06029 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -102,7 +102,7 @@ bool cmInstalledFile::GetPropertyAsBool(const std::string& prop) const
{
std::string value;
bool isSet = this->GetProperty(prop, value);
- return isSet && cmSystemTools::IsOn(value.c_str());
+ return isSet && cmSystemTools::IsOn(value);
}
void cmInstalledFile::GetPropertyAsList(const std::string& prop,
diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx
new file mode 100644
index 0000000..69b6821
--- /dev/null
+++ b/Source/cmLinkItem.cxx
@@ -0,0 +1,72 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmLinkItem.h"
+
+#include "cmGeneratorTarget.h"
+
+#include <utility> // IWYU pragma: keep
+
+cmLinkItem::cmLinkItem()
+ : String()
+ , Target(nullptr)
+{
+}
+
+cmLinkItem::cmLinkItem(std::string const& n)
+ : String(n)
+ , Target(nullptr)
+{
+}
+
+cmLinkItem::cmLinkItem(cmGeneratorTarget const* t)
+ : String()
+ , Target(t)
+{
+}
+
+std::string const& cmLinkItem::AsStr() const
+{
+ return this->Target ? this->Target->GetName() : this->String;
+}
+
+bool operator<(cmLinkItem const& l, cmLinkItem const& r)
+{
+ // Order among targets.
+ if (l.Target && r.Target) {
+ return l.Target < r.Target;
+ }
+ // Order targets before strings.
+ if (l.Target) {
+ return true;
+ }
+ if (r.Target) {
+ return false;
+ }
+ // Order among strings.
+ return l.String < r.String;
+}
+
+bool operator==(cmLinkItem const& l, cmLinkItem const& r)
+{
+ return l.Target == r.Target && l.String == r.String;
+}
+
+std::ostream& operator<<(std::ostream& os, cmLinkItem const& item)
+{
+ return os << item.AsStr();
+}
+
+cmLinkImplItem::cmLinkImplItem()
+ : cmLinkItem()
+ , Backtrace()
+ , FromGenex(false)
+{
+}
+
+cmLinkImplItem::cmLinkImplItem(cmLinkItem item, cmListFileBacktrace const& bt,
+ bool fromGenex)
+ : cmLinkItem(std::move(item))
+ , Backtrace(bt)
+ , FromGenex(fromGenex)
+{
+}
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index e8c9487..74fd298 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -7,6 +7,7 @@
#include <algorithm>
#include <map>
+#include <ostream>
#include <string>
#include <vector>
@@ -17,40 +18,27 @@
class cmGeneratorTarget;
// Basic information about each link item.
-class cmLinkItem : public std::string
+class cmLinkItem
{
- typedef std::string std_string;
+ std::string String;
public:
- cmLinkItem()
- : std_string()
- , Target(nullptr)
- {
- }
- cmLinkItem(const std_string& n, cmGeneratorTarget const* t)
- : std_string(n)
- , Target(t)
- {
- }
+ cmLinkItem();
+ explicit cmLinkItem(std::string const& s);
+ explicit cmLinkItem(cmGeneratorTarget const* t);
+ std::string const& AsStr() const;
cmGeneratorTarget const* Target;
+ friend bool operator<(cmLinkItem const& l, cmLinkItem const& r);
+ friend bool operator==(cmLinkItem const& l, cmLinkItem const& r);
+ friend std::ostream& operator<<(std::ostream& os, cmLinkItem const& item);
};
class cmLinkImplItem : public cmLinkItem
{
public:
- cmLinkImplItem()
- : cmLinkItem()
- , Backtrace()
- , FromGenex(false)
- {
- }
- cmLinkImplItem(std::string const& n, cmGeneratorTarget const* t,
- cmListFileBacktrace const& bt, bool fromGenex)
- : cmLinkItem(n, t)
- , Backtrace(bt)
- , FromGenex(fromGenex)
- {
- }
+ cmLinkImplItem();
+ cmLinkImplItem(cmLinkItem item, cmListFileBacktrace const& bt,
+ bool fromGenex);
cmListFileBacktrace Backtrace;
bool FromGenex;
};
diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx
index 5a43f2e..7ce2c82 100644
--- a/Source/cmLocalCommonGenerator.cxx
+++ b/Source/cmLocalCommonGenerator.cxx
@@ -54,9 +54,8 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags(
this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_DEFAULT");
}
if (!mod_dir.empty()) {
- const char* moddir_flag =
+ std::string modflag =
this->Makefile->GetRequiredDefinition("CMAKE_Fortran_MODDIR_FLAG");
- std::string modflag = moddir_flag;
modflag += mod_dir;
this->AppendFlags(flags, modflag);
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 532f9a9..c955af6 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1655,7 +1655,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
std::string option_flag =
"CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION";
- const char* opt =
+ std::string const& opt =
target->Target->GetMakefile()->GetRequiredDefinition(option_flag);
std::vector<std::string> optVec;
cmSystemTools::ExpandListArgument(opt, optVec);
@@ -2024,7 +2024,7 @@ void cmLocalGenerator::AppendIncludeDirectories(
std::string inc = include;
- if (!cmSystemTools::IsOff(inc.c_str())) {
+ if (!cmSystemTools::IsOff(inc)) {
cmSystemTools::ConvertToUnixSlashes(inc);
}
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 80f2803..c05b085 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -665,11 +665,11 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
std::string baseFlagVar = "CMAKE_";
baseFlagVar += langForClCompile;
baseFlagVar += "_FLAGS";
- flags = this->Makefile->GetRequiredDefinition(baseFlagVar.c_str());
+ flags = this->Makefile->GetRequiredDefinition(baseFlagVar);
std::string flagVar =
baseFlagVar + std::string("_") + cmSystemTools::UpperCase(configName);
flags += " ";
- flags += this->Makefile->GetRequiredDefinition(flagVar.c_str());
+ flags += this->Makefile->GetRequiredDefinition(flagVar);
}
// set the correct language
if (linkLanguage == "C") {
@@ -931,8 +931,7 @@ std::string cmLocalVisualStudio7Generator::GetBuildTypeLinkerFlags(
rootLinkerFlags + "_" + configTypeUpper;
std::string extraLinkOptionsBuildType =
- this->Makefile->GetRequiredDefinition(
- extraLinkOptionsBuildTypeDef.c_str());
+ this->Makefile->GetRequiredDefinition(extraLinkOptionsBuildTypeDef);
return extraLinkOptionsBuildType;
}
@@ -1498,8 +1497,7 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
lang = sourceLang;
}
- cmGeneratorExpressionInterpreter genexInterpreter(lg, gt, *i,
- gt->GetName(), lang);
+ cmGeneratorExpressionInterpreter genexInterpreter(lg, *i, gt, lang);
bool needfc = false;
if (!objectName.empty()) {
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6127b57..5498ad2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1738,7 +1738,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
cmSystemTools::ExpandListArgument(nvalue, files);
nvalue.clear();
for (cc = 0; cc < files.size(); cc++) {
- if (!cmSystemTools::IsOff(files[cc].c_str())) {
+ if (!cmSystemTools::IsOff(files[cc])) {
files[cc] = cmSystemTools::CollapseFullPath(files[cc]);
}
if (cc > 0) {
@@ -2354,22 +2354,24 @@ bool cmMakefile::CanIWriteThisFile(std::string const& fileName) const
cmSystemTools::SameFile(fileName, this->GetHomeOutputDirectory());
}
-const char* cmMakefile::GetRequiredDefinition(const std::string& name) const
+std::string cmMakefile::GetRequiredDefinition(const std::string& name) const
{
const char* ret = this->GetDefinition(name);
if (!ret) {
cmSystemTools::Error("Error required internal CMake variable not "
"set, cmake may not be built correctly.\n",
"Missing variable is:\n", name.c_str());
- return "";
+ return std::string();
}
- return ret;
+ return std::string(ret);
}
bool cmMakefile::IsDefinitionSet(const std::string& name) const
{
- const char* def = this->StateSnapshot.GetDefinition(name);
- if (!def) {
+ const char* def;
+ if (const std::string* d = this->StateSnapshot.GetDefinition(name)) {
+ def = d->c_str();
+ } else {
def = this->GetState()->GetInitializedCacheValue(name);
}
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -2385,8 +2387,10 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const
const char* cmMakefile::GetDefinition(const std::string& name) const
{
- const char* def = this->StateSnapshot.GetDefinition(name);
- if (!def) {
+ const char* def;
+ if (const std::string* d = this->StateSnapshot.GetDefinition(name)) {
+ def = d->c_str();
+ } else {
def = this->GetState()->GetInitializedCacheValue(name);
}
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -2402,8 +2406,9 @@ const char* cmMakefile::GetDefinition(const std::string& name) const
// A callback was executed and may have caused re-allocation of the
// variable storage. Look it up again for now.
// FIXME: Refactor variable storage to avoid this problem.
- def = this->StateSnapshot.GetDefinition(name);
- if (!def) {
+ if (const std::string* d = this->StateSnapshot.GetDefinition(name)) {
+ def = d->c_str();
+ } else {
def = this->GetState()->GetInitializedCacheValue(name);
}
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 4085e99..0ab4371 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -423,7 +423,7 @@ public:
*/
const char* GetDefinition(const std::string&) const;
const char* GetSafeDefinition(const std::string&) const;
- const char* GetRequiredDefinition(const std::string& name) const;
+ std::string GetRequiredDefinition(const std::string& name) const;
bool IsDefinitionSet(const std::string&) const;
/**
* Get the list of all variables in the current space. If argument
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index e8cf255..c8dc392 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -434,8 +434,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
std::string config = this->LocalGenerator->GetConfigName();
std::string configUpper = cmSystemTools::UpperCase(config);
cmGeneratorExpressionInterpreter genexInterpreter(
- this->LocalGenerator, this->GeneratorTarget, config,
- this->GeneratorTarget->GetName(), lang);
+ this->LocalGenerator, config, this->GeneratorTarget, lang);
// Add Fortran format flags.
if (lang == "Fortran") {
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index b634b0a..6436969 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -530,7 +530,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
linkCmdVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
linkCmdVar, this->TargetLinkLanguage, this->GetConfigName());
- const char* linkCmd = mf->GetRequiredDefinition(linkCmdVar);
+ std::string const& linkCmd = mf->GetRequiredDefinition(linkCmdVar);
cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
}
{
@@ -541,7 +541,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
linkCmdVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
linkCmdVar, this->TargetLinkLanguage, this->GetConfigName());
- const char* linkCmd = mf->GetRequiredDefinition(linkCmdVar);
+ std::string const& linkCmd = mf->GetRequiredDefinition(linkCmdVar);
cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
}
return linkCmds;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 1cfaac5..ebcc501 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -136,9 +136,8 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject(
// Add source file specific flags.
cmGeneratorExpressionInterpreter genexInterpreter(
- this->LocalGenerator, this->GeneratorTarget,
- this->LocalGenerator->GetConfigName(), this->GeneratorTarget->GetName(),
- language);
+ this->LocalGenerator, this->LocalGenerator->GetConfigName(),
+ this->GeneratorTarget, language);
const std::string COMPILE_FLAGS("COMPILE_FLAGS");
if (const char* cflags = source->GetProperty(COMPILE_FLAGS)) {
@@ -188,8 +187,7 @@ std::string cmNinjaTargetGenerator::ComputeDefines(cmSourceFile const* source,
std::set<std::string> defines;
const std::string config = this->LocalGenerator->GetConfigName();
cmGeneratorExpressionInterpreter genexInterpreter(
- this->LocalGenerator, this->GeneratorTarget, config,
- this->GeneratorTarget->GetName(), language);
+ this->LocalGenerator, config, this->GeneratorTarget, language);
const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS");
if (const char* compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) {
@@ -217,8 +215,7 @@ std::string cmNinjaTargetGenerator::ComputeIncludes(
std::vector<std::string> includes;
const std::string config = this->LocalGenerator->GetConfigName();
cmGeneratorExpressionInterpreter genexInterpreter(
- this->LocalGenerator, this->GeneratorTarget, config,
- this->GeneratorTarget->GetName(), language);
+ this->LocalGenerator, config, this->GeneratorTarget, language);
const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES");
if (const char* cincludes = source->GetProperty(INCLUDE_DIRECTORIES)) {
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index 239cd00..006211d 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -31,7 +31,7 @@ bool cmOptionCommand::InitialPass(std::vector<std::string> const& args,
bool checkAndWarn = false;
{
auto status = this->Makefile->GetPolicyStatus(cmPolicies::CMP0077);
- const char* existsBeforeSet =
+ const auto* existsBeforeSet =
this->Makefile->GetStateSnapshot().GetDefinition(args[0]);
switch (status) {
case cmPolicies::WARN:
@@ -67,12 +67,12 @@ bool cmOptionCommand::InitialPass(std::vector<std::string> const& args,
if (args.size() == 3) {
initialValue = args[2];
}
- bool init = cmSystemTools::IsOn(initialValue.c_str());
+ bool init = cmSystemTools::IsOn(initialValue);
this->Makefile->AddCacheDefinition(args[0], init ? "ON" : "OFF",
args[1].c_str(), cmStateEnums::BOOL);
if (checkAndWarn) {
- const char* existsAfterSet =
+ const auto* existsAfterSet =
this->Makefile->GetStateSnapshot().GetDefinition(args[0]);
if (!existsAfterSet) {
std::ostringstream w;
diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx
index 09cc63a..d2133ed 100644
--- a/Source/cmQTWrapCPPCommand.cxx
+++ b/Source/cmQTWrapCPPCommand.cxx
@@ -21,7 +21,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args,
}
// Get the moc executable to run in the custom command.
- const char* moc_exe =
+ std::string const& moc_exe =
this->Makefile->GetRequiredDefinition("QT_MOC_EXECUTABLE");
// Get the variable holding the list of sources.
diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx
index da36cdf..25dcd1a 100644
--- a/Source/cmQTWrapUICommand.cxx
+++ b/Source/cmQTWrapUICommand.cxx
@@ -21,9 +21,9 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
}
// Get the uic and moc executables to run in the custom commands.
- const char* uic_exe =
+ std::string const& uic_exe =
this->Makefile->GetRequiredDefinition("QT_UIC_EXECUTABLE");
- const char* moc_exe =
+ std::string const& moc_exe =
this->Makefile->GetRequiredDefinition("QT_MOC_EXECUTABLE");
// Get the variable holding the list of sources.
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 5dd3c8b..8bd985a 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -205,8 +205,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
unsigned long iVerb = 0;
if (!cmSystemTools::StringToULong(this->Verbosity.c_str(), &iVerb)) {
// Non numeric verbosity
- this->Verbosity =
- cmSystemTools::IsOn(this->Verbosity.c_str()) ? "1" : "0";
+ this->Verbosity = cmSystemTools::IsOn(this->Verbosity) ? "1" : "0";
}
}
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 64ce0e3..734b2d7 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -645,7 +645,7 @@ cmQtAutoGenerator::cmQtAutoGenerator()
Logger_.SetVerbosity(static_cast<unsigned int>(iVerbose));
} else {
// Non numeric verbosity
- Logger_.SetVerbose(cmSystemTools::IsOn(verbose.c_str()));
+ Logger_.SetVerbose(cmSystemTools::IsOn(verbose));
}
}
}
@@ -653,7 +653,7 @@ cmQtAutoGenerator::cmQtAutoGenerator()
std::string colorEnv;
cmSystemTools::GetEnv("COLOR", colorEnv);
if (!colorEnv.empty()) {
- Logger_.SetColorOutput(cmSystemTools::IsOn(colorEnv.c_str()));
+ Logger_.SetColorOutput(cmSystemTools::IsOn(colorEnv));
} else {
Logger_.SetColorOutput(true);
}
diff --git a/Source/cmServerDictionary.h b/Source/cmServerDictionary.h
index 685542c..ebf16eb 100644
--- a/Source/cmServerDictionary.h
+++ b/Source/cmServerDictionary.h
@@ -96,6 +96,7 @@ static const std::string kCTEST_COMMAND = "ctestCommand";
static const std::string kCTEST_INFO = "ctestInfo";
static const std::string kMINIMUM_CMAKE_VERSION = "minimumCMakeVersion";
static const std::string kIS_GENERATOR_PROVIDED_KEY = "isGeneratorProvided";
+static const std::string kIS_INTERFACE_SOURCES_KEY = "isInterfaceSources";
static const std::string kSTART_MAGIC = "[== \"CMake Server\" ==[";
static const std::string kEND_MAGIC = "]== \"CMake Server\" ==]";
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 31101e4..231cacb 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -256,7 +256,12 @@ bool cmServerProtocol::DoActivate(const cmServerRequest& /*request*/,
std::pair<int, int> cmServerProtocol1::ProtocolVersion() const
{
- return std::make_pair(1, 2);
+ // Revision history
+ // 1, 1 - Report backtraces in codemodel response
+ // 1, 2 - Add target install destinations to codemodel
+ // 1, 3 - Add a flag to target filegroups indicating whether or not the
+ // filegroup is for INTERFACE_SOURCES
+ return std::make_pair(1, 3);
}
static void setErrorMessage(std::string* errorMessage, const std::string& text)
@@ -593,6 +598,8 @@ cmServerResponse cmServerProtocol1::ProcessCMakeInputs(
return request.Reply(result);
}
+const std::string kInterfaceSourcesLanguageDataKey =
+ "INTERFACE_SOURCES_LD_KEY";
class LanguageData
{
public:
@@ -625,6 +632,12 @@ void LanguageData::SetDefines(const std::set<std::string>& defines)
Defines = std::move(result);
}
+struct FileGroupSources
+{
+ bool IsInterfaceSources;
+ std::vector<std::string> Files;
+};
+
namespace std {
template <>
@@ -652,31 +665,35 @@ struct hash<LanguageData>
} // namespace std
static Json::Value DumpSourceFileGroup(const LanguageData& data,
+ bool isInterfaceSource,
const std::vector<std::string>& files,
const std::string& baseDir)
{
Json::Value result = Json::objectValue;
+ if (isInterfaceSource) {
+ result[kIS_INTERFACE_SOURCES_KEY] = true;
+ }
if (!data.Language.empty()) {
result[kLANGUAGE_KEY] = data.Language;
- if (!data.Flags.empty()) {
- result[kCOMPILE_FLAGS_KEY] = data.Flags;
- }
- if (!data.IncludePathList.empty()) {
- Json::Value includes = Json::arrayValue;
- for (auto const& i : data.IncludePathList) {
- Json::Value tmp = Json::objectValue;
- tmp[kPATH_KEY] = i.first;
- if (i.second) {
- tmp[kIS_SYSTEM_KEY] = i.second;
- }
- includes.append(tmp);
+ }
+ if (!data.Flags.empty()) {
+ result[kCOMPILE_FLAGS_KEY] = data.Flags;
+ }
+ if (!data.IncludePathList.empty()) {
+ Json::Value includes = Json::arrayValue;
+ for (auto const& i : data.IncludePathList) {
+ Json::Value tmp = Json::objectValue;
+ tmp[kPATH_KEY] = i.first;
+ if (i.second) {
+ tmp[kIS_SYSTEM_KEY] = i.second;
}
- result[kINCLUDE_PATH_KEY] = includes;
- }
- if (!data.Defines.empty()) {
- result[kDEFINES_KEY] = fromStringList(data.Defines);
+ includes.append(tmp);
}
+ result[kINCLUDE_PATH_KEY] = includes;
+ }
+ if (!data.Defines.empty()) {
+ result[kDEFINES_KEY] = fromStringList(data.Defines);
}
result[kIS_GENERATED_KEY] = data.IsGenerated;
@@ -691,24 +708,22 @@ static Json::Value DumpSourceFileGroup(const LanguageData& data,
return result;
}
-static Json::Value DumpSourceFilesList(
- cmGeneratorTarget* target, const std::string& config,
- const std::map<std::string, LanguageData>& languageDataMap)
+static void PopulateFileGroupData(
+ cmGeneratorTarget* target, bool isInterfaceSources,
+ const std::vector<cmSourceFile*>& files, const std::string& config,
+ const std::map<std::string, LanguageData>& languageDataMap,
+ std::unordered_map<LanguageData, FileGroupSources>& fileGroups)
{
- // Collect sourcefile groups:
-
- std::vector<cmSourceFile*> files;
- target->GetSourceFiles(files, config);
-
- std::unordered_map<LanguageData, std::vector<std::string>> fileGroups;
for (cmSourceFile* file : files) {
LanguageData fileData;
fileData.Language = file->GetLanguage();
- if (!fileData.Language.empty()) {
- const LanguageData& ld = languageDataMap.at(fileData.Language);
+ if (!fileData.Language.empty() || isInterfaceSources) {
+ const LanguageData& ld = isInterfaceSources
+ ? languageDataMap.at(kInterfaceSourcesLanguageDataKey)
+ : languageDataMap.at(fileData.Language);
cmLocalGenerator* lg = target->GetLocalGenerator();
- cmGeneratorExpressionInterpreter genexInterpreter(
- lg, target, config, target->GetName(), fileData.Language);
+ cmGeneratorExpressionInterpreter genexInterpreter(lg, config, target,
+ fileData.Language);
std::string compileFlags = ld.Flags;
const std::string COMPILE_FLAGS("COMPILE_FLAGS");
@@ -733,10 +748,14 @@ static Json::Value DumpSourceFilesList(
lg->AppendIncludeDirectories(includes, evaluatedIncludes, *file);
for (const auto& include : includes) {
+ // INTERFACE_LIBRARY targets do not support the
+ // IsSystemIncludeDirectory call so just set it to false.
+ const bool isSystemInclude = isInterfaceSources
+ ? false
+ : target->IsSystemIncludeDirectory(include, config,
+ fileData.Language);
fileData.IncludePathList.push_back(
- std::make_pair(include,
- target->IsSystemIncludeDirectory(
- include, config, fileData.Language)));
+ std::make_pair(include, isSystemInclude));
}
}
@@ -765,14 +784,71 @@ static Json::Value DumpSourceFilesList(
}
fileData.IsGenerated = file->GetPropertyAsBool("GENERATED");
- std::vector<std::string>& groupFileList = fileGroups[fileData];
- groupFileList.push_back(file->GetFullPath());
+ FileGroupSources& groupFileList = fileGroups[fileData];
+ groupFileList.IsInterfaceSources = isInterfaceSources;
+ groupFileList.Files.push_back(file->GetFullPath());
+ }
+}
+
+static Json::Value DumpSourceFilesList(
+ cmGeneratorTarget* target, const std::string& config,
+ const std::map<std::string, LanguageData>& languageDataMap)
+{
+ const cmStateEnums::TargetType type = target->GetType();
+ std::unordered_map<LanguageData, FileGroupSources> fileGroups;
+
+ // Collect sourcefile groups:
+
+ std::vector<cmSourceFile*> files;
+ if (type == cmStateEnums::INTERFACE_LIBRARY) {
+ // INTERFACE_LIBRARY targets do not create all the data structures
+ // associated with regular targets. If properties are explicitly specified
+ // for files in INTERFACE_SOURCES then we can get them through the Makefile
+ // rather than the target.
+ files = target->Makefile->GetSourceFiles();
+ } else {
+ target->GetSourceFiles(files, config);
+ PopulateFileGroupData(target, false /* isInterfaceSources */, files,
+ config, languageDataMap, fileGroups);
+ }
+
+ // Collect interface sourcefile groups:
+
+ auto targetProp = target->Target->GetProperty("INTERFACE_SOURCES");
+ if (targetProp != nullptr) {
+ cmGeneratorExpressionInterpreter genexInterpreter(
+ target->GetLocalGenerator(), config, target);
+
+ auto evaluatedSources = cmsys::SystemTools::SplitString(
+ genexInterpreter.Evaluate(targetProp, "INTERFACE_SOURCES"), ';');
+
+ std::map<std::string, cmSourceFile*> filesMap;
+ for (auto file : files) {
+ filesMap[file->GetFullPath()] = file;
+ }
+
+ std::vector<cmSourceFile*> interfaceSourceFiles;
+ for (const std::string& interfaceSourceFilePath : evaluatedSources) {
+ auto entry = filesMap.find(interfaceSourceFilePath);
+ if (entry != filesMap.end()) {
+ // use what we have since it has all the associated properties
+ interfaceSourceFiles.push_back(entry->second);
+ } else {
+ interfaceSourceFiles.push_back(
+ new cmSourceFile(target->Makefile, interfaceSourceFilePath));
+ }
+ }
+
+ PopulateFileGroupData(target, true /* isInterfaceSources */,
+ interfaceSourceFiles, config, languageDataMap,
+ fileGroups);
}
const std::string& baseDir = target->Makefile->GetCurrentSourceDirectory();
Json::Value result = Json::arrayValue;
for (auto const& it : fileGroups) {
- Json::Value group = DumpSourceFileGroup(it.first, it.second, baseDir);
+ Json::Value group = DumpSourceFileGroup(
+ it.first, it.second.IsInterfaceSources, it.second.Files, baseDir);
if (!group.isNull()) {
result.append(group);
}
@@ -882,6 +958,58 @@ static Json::Value DumpCTestConfigurationsList(const cmake* cm)
return result;
}
+static void GetTargetProperty(
+ cmGeneratorExpressionInterpreter& genexInterpreter,
+ cmGeneratorTarget* target, const char* propertyName,
+ std::vector<std::string>& propertyValue)
+{
+ auto targetProp = target->Target->GetProperty(propertyName);
+ if (targetProp != nullptr) {
+ propertyValue = cmsys::SystemTools::SplitString(
+ genexInterpreter.Evaluate(targetProp, propertyName), ';');
+ }
+}
+
+static void CreateInterfaceSourcesEntry(
+ cmLocalGenerator* lg, cmGeneratorTarget* target, const std::string& config,
+ std::map<std::string, LanguageData>& languageDataMap)
+{
+ LanguageData& ld = languageDataMap[kInterfaceSourcesLanguageDataKey];
+ ld.Language = "";
+
+ cmGeneratorExpressionInterpreter genexInterpreter(lg, config, target);
+ std::vector<std::string> propertyValue;
+ GetTargetProperty(genexInterpreter, target, "INTERFACE_INCLUDE_DIRECTORIES",
+ propertyValue);
+ for (std::string const& i : propertyValue) {
+ ld.IncludePathList.push_back(
+ std::make_pair(i, false /* isSystemInclude */));
+ }
+
+ propertyValue.clear();
+ GetTargetProperty(genexInterpreter, target,
+ "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES", propertyValue);
+ for (std::string const& i : propertyValue) {
+ ld.IncludePathList.push_back(
+ std::make_pair(i, true /* isSystemInclude */));
+ }
+
+ propertyValue.clear();
+ GetTargetProperty(genexInterpreter, target, "INTERFACE_COMPILE_OPTIONS",
+ propertyValue);
+ for (const auto& s : propertyValue) {
+ ld.Flags += " " + s;
+ }
+
+ propertyValue.clear();
+ GetTargetProperty(genexInterpreter, target, "INTERFACE_COMPILE_DEFINITIONS",
+ propertyValue);
+ if (!propertyValue.empty()) {
+ std::set<std::string> defines(propertyValue.begin(), propertyValue.end());
+ ld.SetDefines(defines);
+ }
+}
+
static Json::Value DumpTarget(cmGeneratorTarget* target,
const std::string& config)
{
@@ -911,11 +1039,6 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
result[kTYPE_KEY] = typeName;
result[kSOURCE_DIRECTORY_KEY] = lg->GetCurrentSourceDirectory();
result[kBUILD_DIRECTORY_KEY] = lg->GetCurrentBinaryDirectory();
-
- if (type == cmStateEnums::INTERFACE_LIBRARY) {
- return result;
- }
-
result[kFULL_NAME_KEY] = target->GetFullName(config);
if (target->Target->GetHaveInstallRule()) {
@@ -1002,8 +1125,22 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
}
std::set<std::string> languages;
- target->GetLanguages(languages, config);
std::map<std::string, LanguageData> languageDataMap;
+ if (type == cmStateEnums::INTERFACE_LIBRARY) {
+ // INTERFACE_LIBRARY targets do not create all the data structures
+ // associated with regular targets. If properties are explicitly specified
+ // for files in INTERFACE_SOURCES then we can get them through the Makefile
+ // rather than the target.
+ for (auto file : target->Makefile->GetSourceFiles()) {
+ const std::string& language = file->GetLanguage();
+ if (!language.empty()) {
+ languages.insert(language);
+ }
+ }
+ } else {
+ target->GetLanguages(languages, config);
+ }
+
for (std::string const& lang : languages) {
LanguageData& ld = languageDataMap[lang];
ld.Language = lang;
@@ -1019,6 +1156,11 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
}
}
+ if (target->Target->GetProperty("INTERFACE_SOURCES") != nullptr) {
+ // Create an entry in the languageDataMap for interface sources.
+ CreateInterfaceSourcesEntry(lg, target, config, languageDataMap);
+ }
+
Json::Value sourceGroupsValue =
DumpSourceFilesList(target, config, languageDataMap);
if (!sourceGroupsValue.empty()) {
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index 171b62e..3c4111b 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -330,8 +330,8 @@ bool cmSetPropertyCommand::HandleTest(cmTest* test)
bool cmSetPropertyCommand::HandleCacheMode()
{
if (this->PropertyName == "ADVANCED") {
- if (!this->Remove && !cmSystemTools::IsOn(this->PropertyValue.c_str()) &&
- !cmSystemTools::IsOff(this->PropertyValue.c_str())) {
+ if (!this->Remove && !cmSystemTools::IsOn(this->PropertyValue) &&
+ !cmSystemTools::IsOff(this->PropertyValue)) {
std::ostringstream e;
e << "given non-boolean value \"" << this->PropertyValue
<< "\" for CACHE property \"ADVANCED\". ";
diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx
index 33e1b2e..8445b02 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.cxx
+++ b/Source/cmSetSourceFilesPropertiesCommand.cxx
@@ -87,7 +87,7 @@ bool cmSetSourceFilesPropertiesCommand::RunCommand(
propertyPairs.push_back(*j);
if (*j == "GENERATED") {
++j;
- if (j != propend && cmSystemTools::IsOn(j->c_str())) {
+ if (j != propend && cmSystemTools::IsOn(*j)) {
generated = true;
}
} else {
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index d2e83a6..7f33b7a 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -50,7 +50,7 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args,
}
#else
// try to find the hostname for this computer
- if (!cmSystemTools::IsOff(hostname_cmd.c_str())) {
+ if (!cmSystemTools::IsOff(hostname_cmd)) {
std::string host;
cmSystemTools::RunSingleCommand(hostname_cmd.c_str(), &host, nullptr,
nullptr, nullptr,
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 5651594..e01bf71 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -142,7 +142,8 @@ const char* cmState::GetCacheEntryValue(std::string const& key) const
const char* cmState::GetInitializedCacheValue(std::string const& key) const
{
- return this->CacheManager->GetInitializedCacheValue(key);
+ const std::string* p = this->CacheManager->GetInitializedCacheValue(key);
+ return p ? p->c_str() : nullptr;
}
cmStateEnums::CacheEntryType cmState::GetCacheEntryType(
@@ -298,9 +299,9 @@ cmStateSnapshot cmState::Reset()
{
std::string srcDir =
- cmDefinitions::Get("CMAKE_SOURCE_DIR", pos->Vars, pos->Root);
+ *cmDefinitions::Get("CMAKE_SOURCE_DIR", pos->Vars, pos->Root);
std::string binDir =
- cmDefinitions::Get("CMAKE_BINARY_DIR", pos->Vars, pos->Root);
+ *cmDefinitions::Get("CMAKE_BINARY_DIR", pos->Vars, pos->Root);
this->VarTree.Clear();
pos->Vars = this->VarTree.Push(this->VarTree.Root());
pos->Parent = this->VarTree.Root();
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index ec428a6..0379e7e 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -204,7 +204,8 @@ bool cmStateSnapshot::HasDefinedPolicyCMP0011()
return !this->Position->Policies->IsEmpty();
}
-const char* cmStateSnapshot::GetDefinition(std::string const& name) const
+std::string const* cmStateSnapshot::GetDefinition(
+ std::string const& name) const
{
assert(this->Position->Vars.IsValid());
return cmDefinitions::Get(name, this->Position->Vars, this->Position->Root);
@@ -426,8 +427,8 @@ std::string cmStateSnapshot::GetProjectName() const
void cmStateSnapshot::InitializeFromParent_ForSubdirsCommand()
{
- std::string currentSrcDir = this->GetDefinition("CMAKE_CURRENT_SOURCE_DIR");
- std::string currentBinDir = this->GetDefinition("CMAKE_CURRENT_BINARY_DIR");
+ std::string currentSrcDir = *this->GetDefinition("CMAKE_CURRENT_SOURCE_DIR");
+ std::string currentBinDir = *this->GetDefinition("CMAKE_CURRENT_BINARY_DIR");
this->InitializeFromParent();
this->SetDefinition("CMAKE_SOURCE_DIR", this->State->GetSourceDirectory());
this->SetDefinition("CMAKE_BINARY_DIR", this->State->GetBinaryDirectory());
diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h
index af5653b..014c62e 100644
--- a/Source/cmStateSnapshot.h
+++ b/Source/cmStateSnapshot.h
@@ -22,7 +22,7 @@ public:
cmStateSnapshot(cmState* state = nullptr);
cmStateSnapshot(cmState* state, cmStateDetail::PositionType position);
- const char* GetDefinition(std::string const& name) const;
+ std::string const* GetDefinition(std::string const& name) const;
bool IsInitialized(std::string const& name) const;
void SetDefinition(std::string const& name, std::string const& value);
void RemoveDefinition(std::string const& name);
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 72fd2bb..79e5ccf 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -42,7 +42,6 @@
#include <ctype.h>
#include <errno.h>
#include <iostream>
-#include <set>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
@@ -372,24 +371,36 @@ bool cmSystemTools::IsOn(const char* val)
if (!val) {
return false;
}
- size_t len = strlen(val);
- if (len > 4) {
- return false;
+ /* clang-format off */
+ // "1"
+ if (val[0] == '1' && val[1] == '\0') {
+ return true;
}
- std::string v(val, len);
-
- static std::set<std::string> onValues;
- if (onValues.empty()) {
- onValues.insert("ON");
- onValues.insert("1");
- onValues.insert("YES");
- onValues.insert("TRUE");
- onValues.insert("Y");
+ // "ON"
+ if ((val[0] == 'O' || val[0] == 'o') &&
+ (val[1] == 'N' || val[1] == 'n') && val[2] == '\0') {
+ return true;
}
- for (char& c : v) {
- c = static_cast<char>(toupper(c));
+ // "Y", "YES"
+ if ((val[0] == 'Y' || val[0] == 'y') && (val[1] == '\0' || (
+ (val[1] == 'E' || val[1] == 'e') &&
+ (val[2] == 'S' || val[2] == 's') && val[3] == '\0'))) {
+ return true;
}
- return (onValues.count(v) > 0);
+ // "TRUE"
+ if ((val[0] == 'T' || val[0] == 't') &&
+ (val[1] == 'R' || val[1] == 'r') &&
+ (val[2] == 'U' || val[2] == 'u') &&
+ (val[3] == 'E' || val[3] == 'e') && val[4] == '\0') {
+ return true;
+ }
+ /* clang-format on */
+ return false;
+}
+
+bool cmSystemTools::IsOn(const std::string& val)
+{
+ return cmSystemTools::IsOn(val.c_str());
}
bool cmSystemTools::IsNOTFOUND(const char* val)
@@ -402,30 +413,50 @@ bool cmSystemTools::IsNOTFOUND(const char* val)
bool cmSystemTools::IsOff(const char* val)
{
- if (!val || !*val) {
+ // ""
+ if (!val || val[0] == '\0') {
return true;
}
- size_t len = strlen(val);
- // Try and avoid toupper() for large strings.
- if (len > 6) {
- return cmSystemTools::IsNOTFOUND(val);
+ /* clang-format off */
+ // "0"
+ if (val[0] == '0' && val[1] == '\0') {
+ return true;
}
-
- static std::set<std::string> offValues;
- if (offValues.empty()) {
- offValues.insert("OFF");
- offValues.insert("0");
- offValues.insert("NO");
- offValues.insert("FALSE");
- offValues.insert("N");
- offValues.insert("IGNORE");
+ // "OFF"
+ if ((val[0] == 'O' || val[0] == 'o') &&
+ (val[1] == 'F' || val[1] == 'f') &&
+ (val[2] == 'F' || val[2] == 'f') && val[3] == '\0') {
+ return true;
}
- // Try and avoid toupper().
- std::string v(val, len);
- for (char& c : v) {
- c = static_cast<char>(toupper(c));
+ // "N", "NO"
+ if ((val[0] == 'N' || val[0] == 'n') && (val[1] == '\0' || (
+ (val[1] == 'O' || val[1] == 'o') && val[2] == '\0'))) {
+ return true;
}
- return (offValues.count(v) > 0);
+ // "FALSE"
+ if ((val[0] == 'F' || val[0] == 'f') &&
+ (val[1] == 'A' || val[1] == 'a') &&
+ (val[2] == 'L' || val[2] == 'l') &&
+ (val[3] == 'S' || val[3] == 's') &&
+ (val[4] == 'E' || val[4] == 'e') && val[5] == '\0') {
+ return true;
+ }
+ // "IGNORE"
+ if ((val[0] == 'I' || val[0] == 'i') &&
+ (val[1] == 'G' || val[1] == 'g') &&
+ (val[2] == 'N' || val[2] == 'n') &&
+ (val[3] == 'O' || val[3] == 'o') &&
+ (val[4] == 'R' || val[4] == 'r') &&
+ (val[5] == 'E' || val[5] == 'e') && val[6] == '\0') {
+ return true;
+ }
+ /* clang-format on */
+ return cmSystemTools::IsNOTFOUND(val);
+}
+
+bool cmSystemTools::IsOff(const std::string& val)
+{
+ return cmSystemTools::IsOff(val.c_str());
}
void cmSystemTools::ParseWindowsCommandLine(const char* command,
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index c0a1b6b..5c383ee 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -129,6 +129,7 @@ public:
* as ifdef.
*/
static bool IsOn(const char* val);
+ static bool IsOn(const std::string& val);
/**
* does a string indicate a false or off value ? Note that this is
@@ -138,6 +139,7 @@ public:
* NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true.
*/
static bool IsOff(const char* val);
+ static bool IsOff(const std::string& val);
///! Return true if value is NOTFOUND or ends in -NOTFOUND.
static bool IsNOTFOUND(const char* value);
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index a601637..f374626 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -28,7 +28,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args,
// If it exists already and appears up to date then we are done. If
// the string contains "(IntDir)" but that is not the
// CMAKE_CFG_INTDIR setting then the value is out of date.
- const char* intDir =
+ std::string const& intDir =
this->Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR");
bool haveCacheValue = false;
@@ -46,7 +46,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args,
cmState* state = this->Makefile->GetState();
haveCacheValue = (cacheValue &&
(strstr(cacheValue, "(IntDir)") == nullptr ||
- (intDir && strcmp(intDir, "$(IntDir)") == 0)) &&
+ (intDir == "$(IntDir)")) &&
(state->GetCacheMajorVersion() != 0 &&
state->GetCacheMinorVersion() != 0));
}
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ea65e21..53a2a59 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1207,7 +1207,11 @@ void cmVisualStudio10TargetGenerator::WriteCustomCommands(Elem& e0)
this->GeneratorTarget->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
if (cmSourceFile const* sf =
this->LocalGenerator->CreateVCProjBuildRule()) {
- this->WriteCustomCommand(e0, sf);
+ // Write directly rather than through WriteCustomCommand because
+ // we do not want the de-duplication and it has no dependencies.
+ if (cmCustomCommand const* command = sf->GetCustomCommand()) {
+ this->WriteCustomRule(e0, sf, *command);
+ }
}
}
}
@@ -1798,7 +1802,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
"EnableDebuggingInformation",
"'$(Configuration)|$(Platform)'=='" + this->Configurations[i] +
"|" + this->Platform + "'",
- cmSystemTools::IsOn(enableDebug.c_str()) ? "true" : "false");
+ cmSystemTools::IsOn(enableDebug) ? "true" : "false");
}
}
}
@@ -1815,8 +1819,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
"DisableOptimizations",
"'$(Configuration)|$(Platform)'=='" + this->Configurations[i] +
"|" + this->Platform + "'",
- (cmSystemTools::IsOn(disableOptimizations.c_str()) ? "true"
- : "false"));
+ (cmSystemTools::IsOn(disableOptimizations) ? "true" : "false"));
}
}
}
@@ -2114,8 +2117,7 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
flagtable = gg->GetCSharpFlagTable();
}
cmGeneratorExpressionInterpreter genexInterpreter(
- this->LocalGenerator, this->GeneratorTarget, config,
- this->GeneratorTarget->GetName(), lang);
+ this->LocalGenerator, config, this->GeneratorTarget, lang);
cmVS10GeneratorOptions clOptions(
this->LocalGenerator, cmVisualStudioGeneratorOptions::Compiler,
flagtable, this);
@@ -2468,7 +2470,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
baseFlagVar += "_FLAGS";
flags = this->Makefile->GetRequiredDefinition(baseFlagVar);
std::string flagVar =
- baseFlagVar + std::string("_") + cmSystemTools::UpperCase(configName);
+ baseFlagVar + "_" + cmSystemTools::UpperCase(configName);
flags += " ";
flags += this->Makefile->GetRequiredDefinition(flagVar);
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 2027722..87da108 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -917,8 +917,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if (args.size() >= 9 && args[8].length() >= 8 &&
args[8].substr(0, 8) == "--color=") {
// Enable or disable color based on the switch value.
- color = (args[8].size() == 8 ||
- cmSystemTools::IsOn(args[8].substr(8).c_str()));
+ color =
+ (args[8].size() == 8 || cmSystemTools::IsOn(args[8].substr(8)));
}
} else {
// Support older signature for existing makefiles:
@@ -1354,7 +1354,7 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string>& args)
// Enable or disable color based on the switch value.
std::string value = args[i].substr(9);
if (!value.empty()) {
- enabled = cmSystemTools::IsOn(value.c_str());
+ enabled = cmSystemTools::IsOn(value);
}
} else if (cmHasLiteralPrefix(args[i], "--progress-dir=")) {
progressDir = args[i].substr(15);
@@ -1407,7 +1407,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string>& args)
bool verbose = false;
if (args.size() >= 4) {
if (args[3].find("--verbose=") == 0) {
- if (!cmSystemTools::IsOff(args[3].substr(10).c_str())) {
+ if (!cmSystemTools::IsOff(args[3].substr(10))) {
verbose = true;
}
}
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 971d7ff..a22521b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -396,6 +396,7 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(CompatibleInterface CompatibleInterface)
ADD_TEST_MACRO(AliasTarget AliasTarget)
ADD_TEST_MACRO(StagingPrefix StagingPrefix)
+ ADD_TEST_MACRO(ImportedSameName ImportedSameName)
ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary)
if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
diff --git a/Tests/ImportedSameName/A/CMakeLists.txt b/Tests/ImportedSameName/A/CMakeLists.txt
new file mode 100644
index 0000000..0a31b40
--- /dev/null
+++ b/Tests/ImportedSameName/A/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_library(a STATIC a.c)
+target_compile_definitions(a INTERFACE DEF_A)
+
+add_library(sameName INTERFACE IMPORTED)
+target_link_libraries(sameName INTERFACE a)
+
+add_library(ifaceA INTERFACE)
+target_link_libraries(ifaceA INTERFACE sameName)
diff --git a/Tests/ImportedSameName/A/a.c b/Tests/ImportedSameName/A/a.c
new file mode 100644
index 0000000..4ef3698
--- /dev/null
+++ b/Tests/ImportedSameName/A/a.c
@@ -0,0 +1,3 @@
+void a(void)
+{
+}
diff --git a/Tests/ImportedSameName/B/CMakeLists.txt b/Tests/ImportedSameName/B/CMakeLists.txt
new file mode 100644
index 0000000..d930326
--- /dev/null
+++ b/Tests/ImportedSameName/B/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_library(b STATIC b.c)
+target_compile_definitions(b INTERFACE DEF_B)
+
+add_library(sameName INTERFACE IMPORTED)
+target_link_libraries(sameName INTERFACE b)
+
+add_library(ifaceB INTERFACE)
+target_link_libraries(ifaceB INTERFACE sameName)
diff --git a/Tests/ImportedSameName/B/b.c b/Tests/ImportedSameName/B/b.c
new file mode 100644
index 0000000..c7c7df4
--- /dev/null
+++ b/Tests/ImportedSameName/B/b.c
@@ -0,0 +1,3 @@
+void b(void)
+{
+}
diff --git a/Tests/ImportedSameName/CMakeLists.txt b/Tests/ImportedSameName/CMakeLists.txt
new file mode 100644
index 0000000..4292c12
--- /dev/null
+++ b/Tests/ImportedSameName/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.12)
+project(ImportedSameName C)
+
+add_subdirectory(A)
+add_subdirectory(B)
+
+add_executable(ImportedSameName main.c)
+target_link_libraries(ImportedSameName PRIVATE ifaceA ifaceB)
diff --git a/Tests/ImportedSameName/main.c b/Tests/ImportedSameName/main.c
new file mode 100644
index 0000000..a0cb27f
--- /dev/null
+++ b/Tests/ImportedSameName/main.c
@@ -0,0 +1,16 @@
+#ifndef DEF_A
+# error "DEF_A not defined"
+#endif
+#ifndef DEF_B
+# error "DEF_B not defined"
+#endif
+
+extern void a(void);
+extern void b(void);
+
+int main(void)
+{
+ a();
+ b();
+ return 0;
+}
diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake
index 18ef63c..b4bdb61 100644
--- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake
@@ -1,7 +1,7 @@
function(checkPackageInfo_ TYPE FILE REGEX)
getPackageInfo("${FILE}" "FILE_INFO_")
if(NOT FILE_INFO_ MATCHES "${REGEX}")
- message(FATAL_ERROR "Unexpected ${TYPE} in '${FILE}'; file info: '${FILE_INFO_}'")
+ message(FATAL_ERROR "Unexpected ${TYPE} in '${FILE}'; file info: '${FILE_INFO_}'; does not match '${REGEX}'")
endif()
endfunction()
@@ -24,3 +24,15 @@ checkPackageInfo_("name" "${FOUND_FILE_3}" ".*${name_}${whitespaces_}:${whitespa
checkPackageInfo_("group" "${FOUND_FILE_1}" ".*${group_}${whitespaces_}:${whitespaces_}default")
checkPackageInfo_("group" "${FOUND_FILE_2}" ".*${group_}${whitespaces_}:${whitespaces_}second_group")
checkPackageInfo_("group" "${FOUND_FILE_3}" ".*${group_}${whitespaces_}:${whitespaces_}default")
+
+# check package summaries (not available in DEB)
+if(GENERATOR_TYPE STREQUAL "RPM")
+ checkPackageInfo_("summary" "${FOUND_FILE_1}" ".*Summary${whitespaces_}:${whitespaces_}Global summary")
+ checkPackageInfo_("summary" "${FOUND_FILE_2}" ".*Summary${whitespaces_}:${whitespaces_}Summary for pkg_2")
+ checkPackageInfo_("summary" "${FOUND_FILE_3}" ".*Summary${whitespaces_}:${whitespaces_}Global summary")
+endif()
+
+# check package description
+checkPackageInfo_("description" "${FOUND_FILE_1}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_1")
+checkPackageInfo_("description" "${FOUND_FILE_2}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_2")
+checkPackageInfo_("description" "${FOUND_FILE_3}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_3")
diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake
index 8719c0b..dc61d0a 100644
--- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake
+++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/test.cmake
@@ -11,6 +11,13 @@ if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM")
set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_${group_} "default")
set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_NAME "second")
set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_${group_} "second_group")
+
+ set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PACKAGE_SUMMARY "Global summary") # not used for DEB
+ set(CPACK_${GENERATOR_TYPE}${generator_type_suffix_}_PKG_2_PACKAGE_SUMMARY "Summary for pkg_2") # not used for DEB
+
+ set(CPACK_COMPONENT_PKG_1_DESCRIPTION "Description for pkg_1")
+ set(CPACK_COMPONENT_PKG_2_DESCRIPTION "Description for pkg_2")
+ set(CPACK_COMPONENT_PKG_3_DESCRIPTION "Description for pkg_3")
endif()
install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1)
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 3033c9c..9e8d050 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -111,8 +111,8 @@ endfunction()
set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5)
# Verify that new tests are not started when the load average exceeds
-# our threshold.
-run_TestLoad(test-load-fail 2)
+# our threshold and that they then run once the load average drops.
+run_TestLoad(test-load-wait 3)
# Verify that warning message is displayed but tests still start when
# an invalid argument is given.
diff --git a/Tests/RunCMake/CTestCommandLine/test-load-fail-stderr.txt b/Tests/RunCMake/CTestCommandLine/test-load-fail-stderr.txt
deleted file mode 100644
index eafba1c..0000000
--- a/Tests/RunCMake/CTestCommandLine/test-load-fail-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-No tests were found!!!
diff --git a/Tests/RunCMake/CTestCommandLine/test-load-fail-stdout.txt b/Tests/RunCMake/CTestCommandLine/test-load-fail-stdout.txt
deleted file mode 100644
index 153da09..0000000
--- a/Tests/RunCMake/CTestCommandLine/test-load-fail-stdout.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-^Test project .*/Tests/RunCMake/CTestCommandLine/TestLoad
-\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 2, Smallest test TestLoad[1-2] requires 1\*\*\*\*\*
diff --git a/Tests/RunCMake/CTestCommandLine/test-load-pass-stderr.txt b/Tests/RunCMake/CTestCommandLine/test-load-pass-stderr.txt
deleted file mode 100644
index 10f3293..0000000
--- a/Tests/RunCMake/CTestCommandLine/test-load-pass-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^$
diff --git a/Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt b/Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt
new file mode 100644
index 0000000..11a768a
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt
@@ -0,0 +1,8 @@
+^Test project .*/Tests/RunCMake/CTestCommandLine/TestLoad
+\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 3, Smallest test TestLoad[1-2] requires 1\*\*\*\*\*
+ Start 1: TestLoad1
+ Start 2: TestLoad2
+1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
+2/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 2
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt
new file mode 100644
index 0000000..ff3e5c1
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
+ error: ExternalProject module must be explicitly included before using
+ ExternalProject_Add function
+Call Stack \(most recent call first\):
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_parse_arguments\)
+ IncludeScope-Add.cmake:[0-9]+ \(ExternalProject_Add\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake b/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake
new file mode 100644
index 0000000..1061ffd
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake
@@ -0,0 +1,12 @@
+function(IncludeScope_IncludeOnly)
+ include(ExternalProject)
+endfunction()
+
+IncludeScope_IncludeOnly()
+
+ExternalProject_Add(MyProj
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+)
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt
new file mode 100644
index 0000000..cbad4be
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
+ error: ExternalProject module must be explicitly included before using
+ ExternalProject_Add_Step function
+Call Stack \(most recent call first\):
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_parse_arguments\)
+ IncludeScope-Add_Step.cmake:[0-9]+ \(ExternalProject_Add_Step\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake
new file mode 100644
index 0000000..2a820f8
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake
@@ -0,0 +1,13 @@
+function(IncludeScope_DefineProj)
+ include(ExternalProject)
+ ExternalProject_Add(MyProj
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ )
+endfunction()
+
+IncludeScope_DefineProj()
+
+ExternalProject_Add_Step(MyProj extraStep COMMENT "Foo")
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
index 09607f6..bf11381 100644
--- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
@@ -1,5 +1,7 @@
include(RunCMake)
+run_cmake(IncludeScope-Add)
+run_cmake(IncludeScope-Add_Step)
run_cmake(NoOptions)
run_cmake(SourceEmpty)
run_cmake(SourceMissing)
diff --git a/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt b/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt
new file mode 100644
index 0000000..4a6f1e9
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt
@@ -0,0 +1,8 @@
+Run dashboard with model Experimental
+ Source directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack
+ Build directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-build
+ Track: ExperimentalDifferent
+ Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack/CTestConfig.cmake
+ Site: test-site
+ Build name: test-build-name
+ Use ExperimentalDifferent tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
index 2e8aa75..9b57b1b 100644
--- a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
@@ -30,6 +30,7 @@ run_ctest_start(AppendSameModel Continuous APPEND)
run_ctest_start(AppendDifferentModel Experimental APPEND)
run_ctest_start(AppendNoModel APPEND)
run_ctest_start(AppendDifferentTrack TRACK ExperimentalDifferent APPEND)
+run_ctest_start(NoAppendDifferentTrack Experimental TRACK ExperimentalDifferent)
run_ctest_start(AppendNoMatchingTrack Continuous APPEND)
run_ctest_start(AppendOldContinuous Continuous APPEND)
run_ctest_start(AppendOldNoModel APPEND)
diff --git a/Tests/RunCMake/ctest_start/test.cmake.in b/Tests/RunCMake/ctest_start/test.cmake.in
index 172baf7..8cd3cff 100644
--- a/Tests/RunCMake/ctest_start/test.cmake.in
+++ b/Tests/RunCMake/ctest_start/test.cmake.in
@@ -14,7 +14,7 @@ function(setup_tests)
ctest_start(${ctest_start_args})
endfunction()
-if("@CASE_NAME@" MATCHES "^Append")
+if("@CASE_NAME@" MATCHES "^(No)?Append")
if("@CASE_NAME@" MATCHES "^AppendNoMatchingTrack$")
file(WRITE "${CTEST_BINARY_DIRECTORY}/Testing/TAG" "19551112-2204\nSomeWeirdTrackName\n")
else()
diff --git a/Tests/RunCMake/ctest_test/CTestTestLoadFail-result.txt b/Tests/RunCMake/ctest_test/CTestTestLoadFail-result.txt
deleted file mode 100644
index b57e2de..0000000
--- a/Tests/RunCMake/ctest_test/CTestTestLoadFail-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-(-1|255)
diff --git a/Tests/RunCMake/ctest_test/CTestTestLoadFail-stderr.txt b/Tests/RunCMake/ctest_test/CTestTestLoadFail-stderr.txt
deleted file mode 100644
index eafba1c..0000000
--- a/Tests/RunCMake/ctest_test/CTestTestLoadFail-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-No tests were found!!!
diff --git a/Tests/RunCMake/ctest_test/CTestTestLoadFail-stdout.txt b/Tests/RunCMake/ctest_test/CTestTestLoadFail-stdout.txt
deleted file mode 100644
index e203c10..0000000
--- a/Tests/RunCMake/ctest_test/CTestTestLoadFail-stdout.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Test project .*/Tests/RunCMake/ctest_test/CTestTestLoadFail-build
-\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 4, Smallest test RunCMakeVersion requires 1\*\*\*\*\*$
diff --git a/Tests/RunCMake/ctest_test/CTestTestLoadWait-stdout.txt b/Tests/RunCMake/ctest_test/CTestTestLoadWait-stdout.txt
new file mode 100644
index 0000000..2af3838
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/CTestTestLoadWait-stdout.txt
@@ -0,0 +1,8 @@
+Test project .*/Tests/RunCMake/ctest_test/CTestTestLoadWait-build
+\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 4, Smallest test RunCMakeVersion requires 1\*\*\*\*\*
+ Start 1: RunCMakeVersion
+1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index 1b31726..6877e6a 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -21,8 +21,8 @@ set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5)
run_ctest_test(TestLoadPass TEST_LOAD 6)
# Verify that new tests are not started when the load average exceeds
-# our threshold.
-run_ctest_test(TestLoadFail TEST_LOAD 2)
+# our threshold and that they then run once the load average drops.
+run_ctest_test(TestLoadWait TEST_LOAD 2)
# Verify that when an invalid "TEST_LOAD" value is given, a warning
# message is displayed and the value is ignored.
@@ -34,9 +34,9 @@ set(CASE_CTEST_TEST_LOAD 7)
run_ctest_test(CTestTestLoadPass)
# Verify that new tests are not started when the load average exceeds
-# our threshold.
+# our threshold and that they then run once the load average drops.
set(CASE_CTEST_TEST_LOAD 4)
-run_ctest_test(CTestTestLoadFail)
+run_ctest_test(CTestTestLoadWait)
# Verify that when an invalid "CTEST_TEST_LOAD" value is given,
# a warning message is displayed and the value is ignored.
diff --git a/Tests/RunCMake/ctest_test/TestLoadFail-result.txt b/Tests/RunCMake/ctest_test/TestLoadFail-result.txt
deleted file mode 100644
index b57e2de..0000000
--- a/Tests/RunCMake/ctest_test/TestLoadFail-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-(-1|255)
diff --git a/Tests/RunCMake/ctest_test/TestLoadFail-stderr.txt b/Tests/RunCMake/ctest_test/TestLoadFail-stderr.txt
deleted file mode 100644
index eafba1c..0000000
--- a/Tests/RunCMake/ctest_test/TestLoadFail-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-No tests were found!!!
diff --git a/Tests/RunCMake/ctest_test/TestLoadFail-stdout.txt b/Tests/RunCMake/ctest_test/TestLoadFail-stdout.txt
deleted file mode 100644
index 4d7ce48..0000000
--- a/Tests/RunCMake/ctest_test/TestLoadFail-stdout.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Test project .*/Tests/RunCMake/ctest_test/TestLoadFail-build
-\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 2, Smallest test RunCMakeVersion requires 1\*\*\*\*\*$
diff --git a/Tests/RunCMake/ctest_test/TestLoadWait-stdout.txt b/Tests/RunCMake/ctest_test/TestLoadWait-stdout.txt
new file mode 100644
index 0000000..07f4ed3
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestLoadWait-stdout.txt
@@ -0,0 +1,8 @@
+Test project .*/Tests/RunCMake/ctest_test/TestLoadWait-build
+\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 2, Smallest test RunCMakeVersion requires 1\*\*\*\*\*
+ Start 1: RunCMakeVersion
+1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/bootstrap b/bootstrap
index 0b49b74..188193d 100755
--- a/bootstrap
+++ b/bootstrap
@@ -352,6 +352,7 @@ CMAKE_CXX_SOURCES="\
cmInstallTargetsCommand \
cmInstalledFile \
cmLinkDirectoriesCommand \
+ cmLinkItem \
cmLinkLineComputer \
cmListCommand \
cmListFileCache \