summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-variables.7.rst2
-rw-r--r--Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst16
-rw-r--r--Help/release/dev/cuda-CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst6
-rw-r--r--Help/release/dev/per-lang-link-library-flag.rst7
-rw-r--r--Help/release/dev/solaris_clang.rst4
-rw-r--r--Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst6
-rw-r--r--Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst7
-rw-r--r--Modules/CMakeCUDAInformation.cmake3
-rw-r--r--Modules/CMakeSwiftInformation.cmake9
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake1
-rw-r--r--Modules/Platform/SunOS-Clang-C.cmake1
-rw-r--r--Modules/Platform/SunOS-Clang-CXX.cmake1
-rw-r--r--Modules/Platform/Windows-Clang.cmake15
-rw-r--r--Modules/Platform/Windows-Flang-Fortran.cmake5
-rw-r--r--Source/CMakeLists.txt3
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/IFW/cmCPackIFWCommon.cxx5
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx15
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx3
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx19
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx22
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx5
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx10
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.cxx10
-rw-r--r--Source/CPack/cmCPackGenerator.cxx42
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx17
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx4
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx3
-rw-r--r--Source/CPack/cpack.cxx7
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx8
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx3
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx3
-rw-r--r--Source/CTest/cmCTestGIT.cxx4
-rw-r--r--Source/CTest/cmCTestLaunch.cxx3
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx4
-rw-r--r--Source/CTest/cmCTestP4.cxx3
-rw-r--r--Source/CTest/cmCTestRunTest.cxx2
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx8
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx5
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx13
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx7
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx51
-rw-r--r--Source/CTest/cmCTestVC.cxx4
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx5
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx3
-rw-r--r--Source/QtDialog/QCMake.cxx3
-rw-r--r--Source/cmAddCompileDefinitionsCommand.cxx14
-rw-r--r--Source/cmAddCompileDefinitionsCommand.h24
-rw-r--r--Source/cmAddCompileOptionsCommand.cxx14
-rw-r--r--Source/cmAddCompileOptionsCommand.h24
-rw-r--r--Source/cmAddCustomCommandCommand.cxx84
-rw-r--r--Source/cmAddCustomCommandCommand.h33
-rw-r--r--Source/cmAddCustomTargetCommand.cxx42
-rw-r--r--Source/cmAddCustomTargetCommand.h31
-rw-r--r--Source/cmAddDefinitionsCommand.cxx16
-rw-r--r--Source/cmAddDefinitionsCommand.h30
-rw-r--r--Source/cmAddDependenciesCommand.cxx21
-rw-r--r--Source/cmAddDependenciesCommand.h29
-rw-r--r--Source/cmAddExecutableCommand.cxx59
-rw-r--r--Source/cmAddExecutableCommand.h30
-rw-r--r--Source/cmAddLibraryCommand.cxx102
-rw-r--r--Source/cmAddLibraryCommand.h30
-rw-r--r--Source/cmAddLinkOptionsCommand.cxx14
-rw-r--r--Source/cmAddLinkOptionsCommand.h24
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx33
-rw-r--r--Source/cmAddSubDirectoryCommand.h31
-rw-r--r--Source/cmAddTestCommand.cxx49
-rw-r--r--Source/cmAddTestCommand.h32
-rw-r--r--Source/cmArchiveWrite.h2
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx21
-rw-r--r--Source/cmAuxSourceDirectoryCommand.h33
-rw-r--r--Source/cmCPluginAPI.cxx2
-rw-r--r--Source/cmCTest.cxx27
-rw-r--r--Source/cmCacheManager.cxx10
-rw-r--r--Source/cmCommands.cxx39
-rw-r--r--Source/cmComputeLinkDepends.cxx3
-rw-r--r--Source/cmComputeLinkInformation.cxx35
-rw-r--r--Source/cmConditionEvaluator.cxx12
-rw-r--r--Source/cmCoreTryCompile.cxx7
-rw-r--r--Source/cmCryptoHash.cxx37
-rw-r--r--Source/cmCryptoHash.h10
-rw-r--r--Source/cmCustomCommandGenerator.cxx10
-rw-r--r--Source/cmDepends.cxx7
-rw-r--r--Source/cmDependsC.cxx3
-rw-r--r--Source/cmDependsFortran.cxx4
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx4
-rw-r--r--Source/cmExportFileGenerator.cxx4
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx4
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx10
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx11
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx4
-rw-r--r--Source/cmFileCommand.cxx30
-rw-r--r--Source/cmFileCopier.cxx2
-rw-r--r--Source/cmFileInstaller.cxx3
-rw-r--r--Source/cmFindBase.cxx2
-rw-r--r--Source/cmFindCommon.cxx7
-rw-r--r--Source/cmFindLibraryCommand.cxx5
-rw-r--r--Source/cmFindPackageCommand.cxx15
-rw-r--r--Source/cmForEachCommand.cxx3
-rw-r--r--Source/cmGeneratedFileStream.cxx8
-rw-r--r--Source/cmGeneratorExpression.cxx5
-rw-r--r--Source/cmGeneratorExpressionNode.cxx24
-rw-r--r--Source/cmGeneratorTarget.cxx118
-rw-r--r--Source/cmGetFilenameComponentCommand.cxx2
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx11
-rw-r--r--Source/cmGlobalGenerator.cxx75
-rw-r--r--Source/cmGlobalGenerator.h8
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx19
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx19
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx3
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx10
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx32
-rw-r--r--Source/cmGraphVizWriter.cxx4
-rw-r--r--Source/cmIDEOptions.cxx6
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx3
-rw-r--r--Source/cmIncludeGuardCommand.cxx2
-rw-r--r--Source/cmInstallCommand.cxx8
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx3
-rw-r--r--Source/cmInstallExportGenerator.cxx7
-rw-r--r--Source/cmInstallFilesGenerator.cxx5
-rw-r--r--Source/cmInstallTargetGenerator.cxx3
-rw-r--r--Source/cmInstalledFile.cxx6
-rw-r--r--Source/cmLDConfigLDConfigTool.cxx3
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx10
-rw-r--r--Source/cmListCommand.cxx6
-rw-r--r--Source/cmListFileCache.cxx3
-rw-r--r--Source/cmLocalGenerator.cxx183
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmLocalNinjaGenerator.cxx5
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx38
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx8
-rw-r--r--Source/cmMakefile.cxx85
-rw-r--r--Source/cmMakefile.h8
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx19
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx25
-rw-r--r--Source/cmMakefileTargetGenerator.cxx29
-rw-r--r--Source/cmMessageCommand.cxx7
-rw-r--r--Source/cmMessenger.cxx4
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
-rw-r--r--Source/cmNinjaTargetGenerator.cxx27
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx3
-rw-r--r--Source/cmOptionCommand.cxx3
-rw-r--r--Source/cmOutputConverter.cxx3
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx2
-rw-r--r--Source/cmParseArgumentsCommand.cxx12
-rw-r--r--Source/cmPolicies.cxx2
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx6
-rw-r--r--Source/cmQtAutoGenInitializer.cxx27
-rw-r--r--Source/cmQtAutoGenerator.cxx8
-rw-r--r--Source/cmQtAutoMocUic.cxx12
-rw-r--r--Source/cmQtAutoRcc.cxx4
-rw-r--r--Source/cmRemoveCommand.cxx7
-rw-r--r--Source/cmRuntimeDependencyArchive.cxx7
-rw-r--r--Source/cmSearchPath.cxx4
-rw-r--r--Source/cmSetPropertyCommand.cxx5
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.cxx4
-rw-r--r--Source/cmSiteNameCommand.cxx3
-rw-r--r--Source/cmSourceFile.cxx5
-rw-r--r--Source/cmState.cxx2
-rw-r--r--Source/cmStateDirectory.cxx2
-rw-r--r--Source/cmStateSnapshot.cxx2
-rw-r--r--Source/cmStringAlgorithms.cxx198
-rw-r--r--Source/cmStringAlgorithms.h99
-rw-r--r--Source/cmStringCommand.cxx8
-rw-r--r--Source/cmSystemTools.cxx212
-rw-r--r--Source/cmSystemTools.h93
-rw-r--r--Source/cmTarget.cxx15
-rw-r--r--Source/cmTest.cxx4
-rw-r--r--Source/cmTestGenerator.cxx5
-rw-r--r--Source/cmTimestamp.cxx2
-rw-r--r--Source/cmTryRunCommand.cxx6
-rw-r--r--Source/cmUVHandlePtr.cxx6
-rw-r--r--Source/cmUnsetCommand.cxx2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx30
-rw-r--r--Source/cmXCodeScheme.cxx4
-rw-r--r--Source/cm_codecvt.hxx2
-rw-r--r--Source/cmake.cxx82
-rw-r--r--Source/cmake.h8
-rw-r--r--Source/cmakemain.cxx22
-rw-r--r--Source/cmcmd.cxx42
-rw-r--r--Source/ctest.cxx4
-rw-r--r--Tests/CMakeLib/testStringAlgorithms.cxx58
-rw-r--r--Tests/CMakeLib/testSystemTools.cxx16
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt2
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt16
-rwxr-xr-xbootstrap4
193 files changed, 1569 insertions, 1879 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 432d7fc..9ad1195 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -353,6 +353,7 @@ Variables that Control the Build
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_CONFIG_POSTFIX
/variable/CMAKE_CUDA_SEPARABLE_COMPILATION
+ /variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
/variable/CMAKE_DEBUG_POSTFIX
/variable/CMAKE_ENABLE_EXPORTS
/variable/CMAKE_EXE_LINKER_FLAGS
@@ -383,6 +384,7 @@ Variables that Control the Build
/variable/CMAKE_LANG_CPPCHECK
/variable/CMAKE_LANG_CPPLINT
/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE
+ /variable/CMAKE_LANG_LINK_LIBRARY_FLAG
/variable/CMAKE_LANG_VISIBILITY_PRESET
/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY
/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG
diff --git a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
index ef74ae2..dae960f 100644
--- a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
+++ b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
@@ -1,12 +1,16 @@
CUDA_RESOLVE_DEVICE_SYMBOLS
---------------------------
-CUDA only: Enables device linking for the specific library target
-
-If set this will enable device linking on the library target. Normally
-device linking is deferred until a shared library or executable is generated,
-allowing for multiple static libraries to resolve device symbols at the same
-time when they are used by a shared library or executable.
+CUDA only: Enables device linking for the specific library target where
+required.
+
+If set, this will tell the required compilers to enable device linking
+on the library target. Device linking is an additional link step
+required by some CUDA compilers when :prop_tgt:`CUDA_SEPARABLE_COMPILATION` is
+enabled. Normally device linking is deferred until a shared library or
+executable is generated, allowing for multiple static libraries to resolve
+device symbols at the same time when they are used by a shared library or
+executable.
By default static library targets have this property is disabled,
while shared, module, and executable targets have this property enabled.
diff --git a/Help/release/dev/cuda-CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/release/dev/cuda-CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst
new file mode 100644
index 0000000..f21fddf
--- /dev/null
+++ b/Help/release/dev/cuda-CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst
@@ -0,0 +1,6 @@
+cuda-CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
+--------------------------------------
+
+* Variable :variable:`CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS` has been
+ introduced to optionally initialize the
+ :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target property.
diff --git a/Help/release/dev/per-lang-link-library-flag.rst b/Help/release/dev/per-lang-link-library-flag.rst
new file mode 100644
index 0000000..ca1181d
--- /dev/null
+++ b/Help/release/dev/per-lang-link-library-flag.rst
@@ -0,0 +1,7 @@
+per-lang-link-library-flag
+--------------------------
+
+* The new :variable:`CMAKE_<LANG>_LINK_LIBRARY_FLAG` flag allows you to now
+ control the flag used to specify linking to a library on a per-language basis.
+ This is useful for mixed-language projects where the different drivers may use
+ different flags.
diff --git a/Help/release/dev/solaris_clang.rst b/Help/release/dev/solaris_clang.rst
new file mode 100644
index 0000000..0b023ee
--- /dev/null
+++ b/Help/release/dev/solaris_clang.rst
@@ -0,0 +1,4 @@
+solaris_clang
+-------------
+
+* The ``Clang`` compiler is now supported on ``Solaris``.
diff --git a/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst
new file mode 100644
index 0000000..fc835cd
--- /dev/null
+++ b/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst
@@ -0,0 +1,6 @@
+CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
+---------------------------------
+
+Default value for :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target
+property. This variable is used to initialize the property on each target as
+it is created.
diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst
new file mode 100644
index 0000000..d7bb0d8
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst
@@ -0,0 +1,7 @@
+CMAKE_<LANG>_LINK_LIBRARY_FLAG
+------------------------------
+
+Flag to be used to link a library into a shared library or executable.
+
+This flag will be used to specify a library to link to a shared library or an
+executable for the specific language. On most compilers this is ``-l``.
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index 43ae989..b0d80d1 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -171,7 +171,8 @@ if(NOT CMAKE_CUDA_LINK_EXECUTABLE)
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
endif()
-if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")
+if( CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND
+ CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")
set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets")
else()
set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "")
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 6dd614b..4f1d4f0 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -36,6 +36,7 @@ set(CMAKE_Swift_DEFINE_FLAG -D)
set(CMAKE_Swift_FRAMEWORK_SEARCH_FLAG "-F ")
set(CMAKE_Swift_LIBRARY_PATH_FLAG "-L ")
set(CMAKE_Swift_LIBRARY_PATH_TERMINATOR "")
+set(CMAKE_Swift_LINK_LIBRARY_FLAG "-l")
set(CMAKE_Swift_LINKER_WRAPPER_FLAG "-Xlinker" " ")
set(CMAKE_Swift_RESPONSE_FILE_LINK_FLAG @)
@@ -66,8 +67,12 @@ if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$")
cmake_host_system_information(RESULT CMAKE_Swift_NUM_THREADS QUERY NUMBER_OF_LOGICAL_CORES)
endif()
+if(CMAKE_SYSTEM_NAME STREQUAL Windows)
+ set(CMAKE_Swift_IMPLIB_LINKER_FLAGS "-Xlinker -implib:<TARGET_IMPLIB>")
+endif()
+
if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY)
- set(CMAKE_Swift_CREATE_SHARED_LIBRARY "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <SONAME_FLAG> <TARGET_SONAME> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_CREATE_SHARED_LIBRARY "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <SONAME_FLAG> <TARGET_SONAME> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <LINK_LIBRARIES>")
endif()
if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
@@ -75,7 +80,7 @@ if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
endif()
if(NOT CMAKE_Swift_LINK_EXECUTABLE)
- set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <LINK_LIBRARIES>")
endif()
if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY)
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index c0ccb71..b59deda 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -1,3 +1,4 @@
+set(CMAKE_CUDA_COMPILER_HAS_DEVICE_LINK_PHASE True)
set(CMAKE_CUDA_VERBOSE_FLAG "-v")
set(CMAKE_CUDA_VERBOSE_COMPILE_FLAG "-Xcompiler=-v")
diff --git a/Modules/Platform/SunOS-Clang-C.cmake b/Modules/Platform/SunOS-Clang-C.cmake
new file mode 100644
index 0000000..f06eb8f
--- /dev/null
+++ b/Modules/Platform/SunOS-Clang-C.cmake
@@ -0,0 +1 @@
+include(Platform/SunOS-GNU-C)
diff --git a/Modules/Platform/SunOS-Clang-CXX.cmake b/Modules/Platform/SunOS-Clang-CXX.cmake
new file mode 100644
index 0000000..869182c
--- /dev/null
+++ b/Modules/Platform/SunOS-Clang-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/SunOS-GNU-CXX)
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index b317da6..728e0b9 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -99,6 +99,21 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
"or clang-cl as both C and C++ compilers.")
endif()
+ if(NOT CMAKE_RC_COMPILER_INIT)
+ # Check if rc is already in the path
+ # This may happen in cases where the user is already in a visual studio environment when CMake is invoked
+ find_program(__RC_COMPILER_PATH NAMES rc)
+
+ # Default to rc if it's available, otherwise fall back to llvm-rc
+ if(__RC_COMPILER_PATH)
+ set(CMAKE_RC_COMPILER_INIT rc)
+ else()
+ set(CMAKE_RC_COMPILER_INIT llvm-rc)
+ endif()
+
+ unset(__RC_COMPILER_PATH CACHE)
+ endif()
+
if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" )
include(Platform/Windows-MSVC)
diff --git a/Modules/Platform/Windows-Flang-Fortran.cmake b/Modules/Platform/Windows-Flang-Fortran.cmake
index a4b1cf1..c4420f7 100644
--- a/Modules/Platform/Windows-Flang-Fortran.cmake
+++ b/Modules/Platform/Windows-Flang-Fortran.cmake
@@ -1,3 +1,8 @@
include(Platform/Windows-MSVC)
__windows_compiler_msvc(Fortran)
set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> ${_COMPILE_Fortran} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -Xclang --dependent-lib=libcmt)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -Xclang --dependent-lib=msvcrt)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -Xclang --dependent-lib=libcmtd)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -Xclang --dependent-lib=msvcrtd)
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index ee82ff5..7cd07a8 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -95,9 +95,6 @@ include_directories(
${CMake_HAIKU_INCLUDE_DIRS}
)
-# let cmake know it is supposed to use it
-add_definitions(-DCMAKE_BUILD_WITH_CMAKE)
-
# Check if we can build the ELF parser.
if(CMAKE_USE_ELF_PARSER)
set(ELF_SRCS cmELF.h cmELF.cxx)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 93f3e63..9a76073 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 15)
-set(CMake_VERSION_PATCH 20190811)
+set(CMake_VERSION_PATCH 20190819)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx
index 1e72641..5b1ccbd 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.cxx
+++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx
@@ -5,6 +5,7 @@
#include "cmCPackGenerator.h"
#include "cmCPackIFWGenerator.h"
#include "cmCPackLog.h" // IWYU pragma: keep
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
#include "cmVersionConfig.h"
@@ -78,7 +79,7 @@ void cmCPackIFWCommon::ExpandListArgument(
const std::string& arg, std::map<std::string, std::string>& argsOut)
{
std::vector<std::string> args;
- cmSystemTools::ExpandListArgument(arg, args, false);
+ cmExpandList(arg, args, false);
if (args.empty()) {
return;
}
@@ -100,7 +101,7 @@ void cmCPackIFWCommon::ExpandListArgument(
const std::string& arg, std::multimap<std::string, std::string>& argsOut)
{
std::vector<std::string> args;
- cmSystemTools::ExpandListArgument(arg, args, false);
+ cmExpandList(arg, args, false);
if (args.empty()) {
return;
}
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index c1b6eea..f0fb37a 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -11,6 +11,7 @@
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include <sstream>
@@ -253,7 +254,7 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'binarycreator' executable (needs)
const char* BinCreatorStr = this->GetOption(BinCreatorOpt);
- if (!BinCreatorStr || cmSystemTools::IsNOTFOUND(BinCreatorStr)) {
+ if (!BinCreatorStr || cmIsNOTFOUND(BinCreatorStr)) {
this->BinCreator.clear();
} else {
this->BinCreator = BinCreatorStr;
@@ -270,7 +271,7 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'repogen' executable (optional)
const char* RepoGenStr = this->GetOption(RepoGenOpt);
- if (!RepoGenStr || cmSystemTools::IsNOTFOUND(RepoGenStr)) {
+ if (!RepoGenStr || cmIsNOTFOUND(RepoGenStr)) {
this->RepoGen.clear();
} else {
this->RepoGen = RepoGenStr;
@@ -292,14 +293,14 @@ int cmCPackIFWGenerator::InitializeInternal()
// Additional packages dirs
this->PkgsDirsVector.clear();
if (const char* dirs = this->GetOption("CPACK_IFW_PACKAGES_DIRECTORIES")) {
- cmSystemTools::ExpandListArgument(dirs, this->PkgsDirsVector);
+ cmExpandList(dirs, this->PkgsDirsVector);
}
// Additional repositories dirs
this->RepoDirsVector.clear();
if (const char* dirs =
this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
- cmSystemTools::ExpandListArgument(dirs, this->RepoDirsVector);
+ cmExpandList(dirs, this->RepoDirsVector);
}
// Installer
@@ -317,17 +318,17 @@ int cmCPackIFWGenerator::InitializeInternal()
// Repositories
if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) {
std::vector<std::string> RepoAllVector;
- cmSystemTools::ExpandListArgument(RepoAllStr, RepoAllVector);
+ cmExpandList(RepoAllStr, RepoAllVector);
for (std::string const& r : RepoAllVector) {
this->GetRepository(r);
}
}
if (const char* ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) {
- this->OnlineOnly = cmSystemTools::IsOn(ifwDownloadAll);
+ this->OnlineOnly = cmIsOn(ifwDownloadAll);
} else if (const char* cpackDownloadAll =
this->GetOption("CPACK_DOWNLOAD_ALL")) {
- this->OnlineOnly = cmSystemTools::IsOn(cpackDownloadAll);
+ this->OnlineOnly = cmIsOn(cpackDownloadAll);
} else {
this->OnlineOnly = false;
}
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index f130e05..5313dd0 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -245,8 +245,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
if (const char* optIFW_PACKAGE_RESOURCES =
this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) {
this->Resources.clear();
- cmSystemTools::ExpandListArgument(optIFW_PACKAGE_RESOURCES,
- this->Resources);
+ cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
}
}
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index a1a52b1..7407c49 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -8,6 +8,7 @@
#include "cmCPackIFWInstaller.h"
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
#include "cmXMLWriter.h"
@@ -196,7 +197,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
// User interfaces
if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) {
this->UserInterfaces.clear();
- cmSystemTools::ExpandListArgument(option, this->UserInterfaces);
+ cmExpandList(option, this->UserInterfaces);
}
// CMake dependencies
@@ -209,7 +210,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
// Licenses
if (const char* option = this->GetOption(prefix + "LICENSES")) {
this->Licenses.clear();
- cmSystemTools::ExpandListArgument(option, this->Licenses);
+ cmExpandList(option, this->Licenses);
if (this->Licenses.size() % 2 != 0) {
cmCPackIFWLogger(
WARNING,
@@ -281,13 +282,13 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
// User interfaces
if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) {
this->UserInterfaces.clear();
- cmSystemTools::ExpandListArgument(option, this->UserInterfaces);
+ cmExpandList(option, this->UserInterfaces);
}
// Licenses
if (const char* option = this->GetOption(prefix + "LICENSES")) {
this->Licenses.clear();
- cmSystemTools::ExpandListArgument(option, this->Licenses);
+ cmExpandList(option, this->Licenses);
if (this->Licenses.size() % 2 != 0) {
cmCPackIFWLogger(
WARNING,
@@ -398,18 +399,18 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
this->Translations.clear();
} else if (const char* value = this->GetOption(option)) {
this->Translations.clear();
- cmSystemTools::ExpandListArgument(value, this->Translations);
+ cmExpandList(value, this->Translations);
}
// QtIFW dependencies
std::vector<std::string> deps;
option = prefix + "DEPENDS";
if (const char* value = this->GetOption(option)) {
- cmSystemTools::ExpandListArgument(value, deps);
+ cmExpandList(value, deps);
}
option = prefix + "DEPENDENCIES";
if (const char* value = this->GetOption(option)) {
- cmSystemTools::ExpandListArgument(value, deps);
+ cmExpandList(value, deps);
}
for (std::string const& d : deps) {
DependenceStruct dep(d);
@@ -431,7 +432,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
this->AlienAutoDependOn.clear();
} else if (const char* value = this->GetOption(option)) {
std::vector<std::string> depsOn;
- cmSystemTools::ExpandListArgument(value, depsOn);
+ cmExpandList(value, depsOn);
for (std::string const& d : depsOn) {
DependenceStruct dep(d);
if (this->Generator->Packages.count(dep.Name)) {
@@ -488,7 +489,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
this->Replaces.clear();
} else if (const char* value = this->GetOption(option)) {
this->Replaces.clear();
- cmSystemTools::ExpandListArgument(value, this->Replaces);
+ cmExpandList(value, this->Replaces);
}
// Requires admin rights
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index fa64d79..51d284f 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -7,6 +7,7 @@
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
#include "cmInstalledFile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmUuid.h"
#include <algorithm>
@@ -226,7 +227,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
if (patchFilePath) {
std::vector<std::string> patchFilePaths;
- cmSystemTools::ExpandListArgument(patchFilePath, patchFilePaths);
+ cmExpandList(patchFilePath, patchFilePaths);
for (std::string const& p : patchFilePaths) {
if (!this->Patch->LoadFragments(p)) {
@@ -237,7 +238,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
// if install folder is supposed to be set absolutely, the default
// component guid "*" cannot be used
- if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
+ if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
this->ComponentGuidType = cmWIXSourceWriter::CMAKE_GENERATED_GUID;
}
@@ -300,7 +301,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
if (!cpackWixExtraSources)
return;
- cmSystemTools::ExpandListArgument(cpackWixExtraSources, this->WixSources);
+ cmExpandList(cpackWixExtraSources, this->WixSources);
}
void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
@@ -311,8 +312,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
std::vector<std::string> expandedExtraObjects;
- cmSystemTools::ExpandListArgument(cpackWixExtraObjects,
- expandedExtraObjects);
+ cmExpandList(cpackWixExtraObjects, expandedExtraObjects);
for (std::string const& obj : expandedExtraObjects) {
stream << " " << QuotePath(obj);
@@ -582,7 +582,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string cmCPackWIXGenerator::GetRootFolderId() const
{
- if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
+ if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
return "";
}
@@ -664,8 +664,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
std::vector<std::string> cpackPackageExecutablesList;
const char* cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
if (cpackPackageExecutables) {
- cmSystemTools::ExpandListArgument(cpackPackageExecutables,
- cpackPackageExecutablesList);
+ cmExpandList(cpackPackageExecutables, cpackPackageExecutablesList);
if (cpackPackageExecutablesList.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
@@ -680,8 +679,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
const char* cpackPackageDesktopLinks =
GetOption("CPACK_CREATE_DESKTOP_LINKS");
if (cpackPackageDesktopLinks) {
- cmSystemTools::ExpandListArgument(cpackPackageDesktopLinks,
- cpackPackageDesktopLinksList);
+ cmExpandList(cpackPackageDesktopLinks, cpackPackageDesktopLinksList);
}
AddDirectoryAndFileDefinitions(
@@ -1137,7 +1135,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
return;
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(variableContent, list);
+ cmExpandList(variableContent, list);
extensions.insert(list.begin(), list.end());
}
@@ -1149,7 +1147,7 @@ void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName,
return;
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(variableContent, list);
+ cmExpandList(variableContent, list);
for (std::string const& i : list) {
stream << " " << QuotePath(i);
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index 3a476f4..213ce92 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -6,6 +6,7 @@
#include <vector>
#include "cmCPackLog.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
cmCPackBundleGenerator::cmCPackBundleGenerator() = default;
@@ -206,7 +207,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
: "";
std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(sign_files, relFiles);
+ cmExpandList(sign_files, relFiles);
// sign the files supplied by the user, ie. frameworks.
for (auto const& file : relFiles) {
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index cfb5efd..7c2f21a 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -8,6 +8,7 @@
#include "cmCPackLog.h"
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
@@ -378,7 +379,7 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
control_tar.ClearPermissions();
std::vector<std::string> controlExtraList;
- cmSystemTools::ExpandListArgument(ControlExtra, controlExtraList);
+ cmExpandList(ControlExtra, controlExtraList);
for (std::string const& i : controlExtraList) {
std::string filenamename = cmsys::SystemTools::GetFilenameName(i);
std::string localcopy = WorkDir + "/" + filenamename;
@@ -439,7 +440,7 @@ cmCPackDebGenerator::~cmCPackDebGenerator() = default;
int cmCPackDebGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
- if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
+ if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
this->SetOption("CPACK_SET_DESTDIR", "I_ON");
}
return this->Superclass::InitializeInternal();
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 7a3742b..85faa61 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -6,6 +6,7 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmsys/FStream.hxx"
@@ -128,8 +129,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
}
std::vector<std::string> languages;
- cmSystemTools::ExpandListArgument(
- this->GetOption("CPACK_DMG_SLA_LANGUAGES"), languages);
+ cmExpandList(this->GetOption("CPACK_DMG_SLA_LANGUAGES"), languages);
if (languages.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_DMG_SLA_LANGUAGES set but empty" << std::endl);
@@ -527,7 +527,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::vector<std::string> languages;
if (!oldStyle) {
- cmSystemTools::ExpandListArgument(cpack_dmg_languages, languages);
+ cmExpandList(cpack_dmg_languages, languages);
}
cmGeneratedFileStream ofs(sla_r);
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index b4c7a5a..5dc6ace 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -5,6 +5,7 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackLog.h"
#include "cmMakefile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cm_jsoncpp_value.h"
@@ -149,8 +150,7 @@ int cmCPackExternalGenerator::InstallCMakeProject(
bool cmCPackExternalGenerator::StagingEnabled() const
{
- return !cmSystemTools::IsOff(
- this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING"));
+ return !cmIsOff(this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING"));
}
cmCPackExternalGenerator::cmCPackExternalVersionGenerator::
@@ -208,8 +208,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
if (defaultDirectoryPermissions && *defaultDirectoryPermissions) {
root["defaultDirectoryPermissions"] = defaultDirectoryPermissions;
}
- if (cmSystemTools::IsInternallyOn(
- this->Parent->GetOption("CPACK_SET_DESTDIR"))) {
+ if (cmIsInternallyOn(this->Parent->GetOption("CPACK_SET_DESTDIR"))) {
root["setDestdir"] = true;
root["packagingInstallPrefix"] =
this->Parent->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
@@ -217,8 +216,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
root["setDestdir"] = false;
}
- root["stripFiles"] =
- !cmSystemTools::IsOff(this->Parent->GetOption("CPACK_STRIP_FILES"));
+ root["stripFiles"] = !cmIsOff(this->Parent->GetOption("CPACK_STRIP_FILES"));
root["warnOnAbsoluteInstallDestination"] =
this->Parent->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION");
root["errorOnAbsoluteInstallDestination"] =
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx
index 9fdafa4..b90a27c 100644
--- a/Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -6,6 +6,7 @@
#include "cmCPackArchiveGenerator.h"
#include "cmCPackLog.h"
#include "cmGeneratedFileStream.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
// Needed for ::open() and ::stat()
@@ -228,8 +229,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
"desc", var_lookup("CPACK_FREEBSD_PACKAGE_DESCRIPTION"));
manifest << ManifestKeyValue("www", var_lookup("CPACK_FREEBSD_PACKAGE_WWW"));
std::vector<std::string> licenses;
- cmSystemTools::ExpandListArgument(
- var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses);
+ cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses);
std::string licenselogic("single");
if (licenses.empty()) {
cmSystemTools::SetFatalErrorOccured();
@@ -239,13 +239,11 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
manifest << ManifestKeyValue("licenselogic", licenselogic);
manifest << (ManifestKeyListValue("licenses") << licenses);
std::vector<std::string> categories;
- cmSystemTools::ExpandListArgument(
- var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"), categories);
+ cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"), categories);
manifest << (ManifestKeyListValue("categories") << categories);
manifest << ManifestKeyValue("prefix", var_lookup("CMAKE_INSTALL_PREFIX"));
std::vector<std::string> deps;
- cmSystemTools::ExpandListArgument(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"),
- deps);
+ cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"), deps);
if (!deps.empty()) {
manifest << (ManifestKeyDepsValue("deps") << deps);
}
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 3fd124b..f3de53c 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -180,8 +180,8 @@ int cmCPackGenerator::InstallProject()
std::string bareTempInstallDirectory =
this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY");
std::string tempInstallDirectoryStr = bareTempInstallDirectory;
- bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR")) |
- cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
+ bool setDestDir = cmIsOn(this->GetOption("CPACK_SET_DESTDIR")) |
+ cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
if (!setDestDir) {
tempInstallDirectoryStr += this->GetPackagingInstallPrefix();
}
@@ -212,7 +212,7 @@ int cmCPackGenerator::InstallProject()
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (default_dir_install_permissions && *default_dir_install_permissions) {
std::vector<std::string> items;
- cmSystemTools::ExpandListArgument(default_dir_install_permissions, items);
+ cmExpandList(default_dir_install_permissions, items);
for (const auto& arg : items) {
if (!cmFSPermissions::stringToModeT(arg, default_dir_mode_v)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -275,7 +275,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
tempInstallDirectoryEnv += tempInstallDirectory;
cmSystemTools::PutEnv(tempInstallDirectoryEnv);
std::vector<std::string> installCommandsVector;
- cmSystemTools::ExpandListArgument(installCommands, installCommandsVector);
+ cmExpandList(installCommands, installCommandsVector);
for (std::string const& ic : installCommandsVector) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << ic << std::endl);
std::string output;
@@ -312,8 +312,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
const char* cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES");
if (cpackIgnoreFiles) {
std::vector<std::string> ignoreFilesRegexString;
- cmSystemTools::ExpandListArgument(cpackIgnoreFiles,
- ignoreFilesRegexString);
+ cmExpandList(cpackIgnoreFiles, ignoreFilesRegexString);
for (std::string const& ifr : ignoreFilesRegexString) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Create ignore files regex for: " << ifr << std::endl);
@@ -324,8 +323,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
this->GetOption("CPACK_INSTALLED_DIRECTORIES");
if (installDirectories && *installDirectories) {
std::vector<std::string> installDirectoriesVector;
- cmSystemTools::ExpandListArgument(installDirectories,
- installDirectoriesVector);
+ cmExpandList(installDirectories, installDirectoriesVector);
if (installDirectoriesVector.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
@@ -466,7 +464,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install scripts: " << cmakeScripts << std::endl);
std::vector<std::string> cmakeScriptsVector;
- cmSystemTools::ExpandListArgument(cmakeScripts, cmakeScriptsVector);
+ cmExpandList(cmakeScripts, cmakeScriptsVector);
for (std::string const& installScript : cmakeScriptsVector) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
@@ -531,7 +529,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
return 0;
}
std::vector<std::string> cmakeProjectsVector;
- cmSystemTools::ExpandListArgument(cmakeProjects, cmakeProjectsVector);
+ cmExpandList(cmakeProjects, cmakeProjectsVector);
std::vector<std::string>::iterator it;
for (it = cmakeProjectsVector.begin(); it != cmakeProjectsVector.end();
++it) {
@@ -576,7 +574,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
const char* installTypes = this->GetOption(installTypesVar);
if (installTypes && *installTypes) {
std::vector<std::string> installTypesVector;
- cmSystemTools::ExpandListArgument(installTypes, installTypesVector);
+ cmExpandList(installTypes, installTypesVector);
for (std::string const& installType : installTypesVector) {
project.InstallationTypes.push_back(
this->GetInstallationType(project.ProjectName, installType));
@@ -588,7 +586,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
"CPACK_COMPONENTS_" + cmSystemTools::UpperCase(project.Component);
const char* components = this->GetOption(componentsVar);
if (components && *components) {
- cmSystemTools::ExpandListArgument(components, componentsVector);
+ cmExpandList(components, componentsVector);
for (std::string const& comp : componentsVector) {
project.Components.push_back(
this->GetComponent(project.ProjectName, comp));
@@ -752,7 +750,7 @@ int cmCPackGenerator::InstallCMakeProject(
// CPACK_PACKAGING_INSTALL_PREFIX
// I know this is tricky and awkward but it's the price for
// CPACK_SET_DESTDIR backward compatibility.
- if (cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) {
+ if (cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) {
this->SetOption("CPACK_INSTALL_PREFIX",
this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"));
}
@@ -828,7 +826,7 @@ int cmCPackGenerator::InstallCMakeProject(
// strip on TRUE, ON, 1, one or several file names, but not on
// FALSE, OFF, 0 and an empty string
- if (!cmSystemTools::IsOff(this->GetOption("CPACK_STRIP_FILES"))) {
+ if (!cmIsOff(this->GetOption("CPACK_STRIP_FILES"))) {
mf.AddDefinition("CMAKE_INSTALL_DO_STRIP", "1");
}
// Remember the list of files before installation
@@ -979,8 +977,7 @@ int cmCPackGenerator::DoPackage()
return 0;
}
- if (cmSystemTools::IsOn(
- this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) {
+ if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) {
const char* toplevelDirectory =
this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if (cmSystemTools::FileExists(toplevelDirectory)) {
@@ -1030,8 +1027,7 @@ int cmCPackGenerator::DoPackage()
"Remove old package file" << std::endl);
cmSystemTools::RemoveFile(tempPackageFileName);
}
- if (cmSystemTools::IsOn(
- this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
+ if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
tempDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
}
@@ -1155,14 +1151,14 @@ bool cmCPackGenerator::IsSet(const std::string& name) const
bool cmCPackGenerator::IsOn(const std::string& name) const
{
- return cmSystemTools::IsOn(GetOption(name));
+ return cmIsOn(GetOption(name));
}
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
{
const char* ret = this->MakefileMap->GetDefinition(op);
if (ret && *ret) {
- return cmSystemTools::IsOff(ret);
+ return cmIsOff(ret);
}
return false;
}
@@ -1476,7 +1472,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->IsRequired = this->IsOn(macroPrefix + "_REQUIRED");
component->IsDisabledByDefault = this->IsOn(macroPrefix + "_DISABLED");
component->IsDownloaded = this->IsOn(macroPrefix + "_DOWNLOADED") ||
- cmSystemTools::IsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
+ cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
const char* archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
if (archiveFile && *archiveFile) {
@@ -1505,7 +1501,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
const char* installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES");
if (installTypes && *installTypes) {
std::vector<std::string> installTypesVector;
- cmSystemTools::ExpandListArgument(installTypes, installTypesVector);
+ cmExpandList(installTypes, installTypesVector);
for (std::string const& installType : installTypesVector) {
component->InstallationTypes.push_back(
this->GetInstallationType(projectName, installType));
@@ -1516,7 +1512,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
const char* depends = this->GetOption(macroPrefix + "_DEPENDS");
if (depends && *depends) {
std::vector<std::string> dependsVector;
- cmSystemTools::ExpandListArgument(depends, dependsVector);
+ cmExpandList(depends, dependsVector);
for (std::string const& depend : dependsVector) {
cmCPackComponent* child = GetComponent(projectName, depend);
component->Dependencies.push_back(child);
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 87c36fa..961a9d4 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -7,6 +7,7 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmsys/Directory.hxx"
@@ -274,7 +275,7 @@ int cmCPackNSISGenerator::PackageFiles()
if (anyDownloadedComponents) {
defines += "!define CPACK_USES_DOWNLOAD\n";
- if (cmSystemTools::IsOn(this->GetOption("CPACK_ADD_REMOVE"))) {
+ if (cmIsOn(this->GetOption("CPACK_ADD_REMOVE"))) {
defines += "!define CPACK_NSIS_ADD_REMOVE\n";
}
}
@@ -321,8 +322,7 @@ int cmCPackNSISGenerator::PackageFiles()
int cmCPackNSISGenerator::InitializeInternal()
{
- if (cmSystemTools::IsOn(
- this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
+ if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
cmCPackLogger(
cmCPackLog::LOG_WARNING,
"NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
@@ -459,8 +459,7 @@ int cmCPackNSISGenerator::InitializeInternal()
"CPACK_CREATE_DESKTOP_LINKS: " << cpackPackageDeskTopLinks
<< std::endl);
- cmSystemTools::ExpandListArgument(cpackPackageDeskTopLinks,
- cpackPackageDesktopLinksVector);
+ cmExpandList(cpackPackageDeskTopLinks, cpackPackageDesktopLinksVector);
for (std::string const& cpdl : cpackPackageDesktopLinksVector) {
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"CPACK_CREATE_DESKTOP_LINKS: " << cpdl << std::endl);
@@ -479,8 +478,7 @@ int cmCPackNSISGenerator::InitializeInternal()
"The cpackPackageExecutables: " << cpackPackageExecutables
<< "." << std::endl);
std::vector<std::string> cpackPackageExecutablesVector;
- cmSystemTools::ExpandListArgument(cpackPackageExecutables,
- cpackPackageExecutablesVector);
+ cmExpandList(cpackPackageExecutables, cpackPackageExecutablesVector);
if (cpackPackageExecutablesVector.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
@@ -536,7 +534,7 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"The cpackMenuLinks: " << cpackMenuLinks << "." << std::endl);
std::vector<std::string> cpackMenuLinksVector;
- cmSystemTools::ExpandListArgument(cpackMenuLinks, cpackMenuLinksVector);
+ cmExpandList(cpackMenuLinks, cpackMenuLinksVector);
if (cpackMenuLinksVector.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
@@ -722,8 +720,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
// size of the installed component.
std::string zipListFileName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
zipListFileName += "/winZip.filelist";
- bool needQuotesInFile =
- cmSystemTools::IsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES"));
+ bool needQuotesInFile = cmIsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES"));
unsigned long totalSize = 0;
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(zipListFileName);
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 41470c9..7cc48f4 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -8,6 +8,7 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
@@ -29,8 +30,7 @@ int cmCPackOSXX11Generator::PackageFiles()
std::ostringstream str;
std::ostringstream deleteStr;
std::vector<std::string> cpackPackageExecutablesVector;
- cmSystemTools::ExpandListArgument(cpackPackageExecutables,
- cpackPackageExecutablesVector);
+ cmExpandList(cpackPackageExecutables, cpackPackageExecutablesVector);
if (cpackPackageExecutablesVector.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 33ab62b..9ffebf5 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -12,6 +12,7 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
cmCPackRPMGenerator::cmCPackRPMGenerator() = default;
@@ -21,7 +22,7 @@ cmCPackRPMGenerator::~cmCPackRPMGenerator() = default;
int cmCPackRPMGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
- if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
+ if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
this->SetOption("CPACK_SET_DESTDIR", "I_ON");
}
/* Replace space in CPACK_PACKAGE_NAME in order to avoid
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 89c3b1c..3cf0c10 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -11,7 +11,7 @@
#include <utility>
#include <vector>
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
# include "cmsys/ConsoleBuf.hxx"
#endif
@@ -25,6 +25,7 @@
#include "cmMakefile.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -100,7 +101,7 @@ void cpackProgressCallback(const std::string& message, float /*unused*/)
int main(int argc, char const* const* argv)
{
cmSystemTools::EnsureStdPipes();
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
// Replace streambuf so we can output Unicode to console
cmsys::ConsoleBuf::Manager consoleOut(std::cout);
consoleOut.SetUTF8Pipes();
@@ -332,7 +333,7 @@ int main(int argc, char const* const* argv)
"CPack generator not specified" << std::endl);
} else {
std::vector<std::string> generatorsVector;
- cmSystemTools::ExpandListArgument(genList, generatorsVector);
+ cmExpandList(genList, generatorsVector);
for (std::string const& gen : generatorsVector) {
cmMakefile::ScopePushPop raii(&globalMF);
cmMakefile* mf = &globalMF;
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index b98a4e3..2365a66 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -247,13 +247,11 @@ void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile* mf)
// Record the user-specified custom warning rules.
if (const char* customWarningMatchers =
mf->GetDefinition("CTEST_CUSTOM_WARNING_MATCH")) {
- cmSystemTools::ExpandListArgument(customWarningMatchers,
- this->ReallyCustomWarningMatches);
+ cmExpandList(customWarningMatchers, this->ReallyCustomWarningMatches);
}
if (const char* customWarningExceptions =
mf->GetDefinition("CTEST_CUSTOM_WARNING_EXCEPTION")) {
- cmSystemTools::ExpandListArgument(customWarningExceptions,
- this->ReallyCustomWarningExceptions);
+ cmExpandList(customWarningExceptions, this->ReallyCustomWarningExceptions);
}
}
@@ -328,7 +326,7 @@ int cmCTestBuildHandler::ProcessHandler()
std::string const& useLaunchers =
this->CTest->GetCTestConfiguration("UseLaunchers");
- this->UseCTestLaunch = cmSystemTools::IsOn(useLaunchers);
+ this->UseCTestLaunch = cmIsOn(useLaunchers);
// Create a last build log
cmGeneratedFileStream ofs;
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index 74a932a..eb7ecb5 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -6,6 +6,7 @@
#include "cmCTestConfigureHandler.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -25,7 +26,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
std::vector<std::string> options;
if (this->Values[ctc_OPTIONS]) {
- cmSystemTools::ExpandListArgument(this->Values[ctc_OPTIONS], options);
+ cmExpandList(this->Values[ctc_OPTIONS], options);
}
if (this->CTest->GetCTestConfiguration("BuildDirectory").empty()) {
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 54fe612..2a68544 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -2223,8 +2223,7 @@ int cmCTestCoverageHandler::GetLabelId(std::string const& label)
void cmCTestCoverageHandler::LoadLabels()
{
std::string fileList = this->CTest->GetBinaryDir();
- fileList += "/CMakeFiles";
- fileList += "/TargetDirectories.txt";
+ fileList += "/CMakeFiles/TargetDirectories.txt";
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" target directory list [" << fileList << "]\n",
this->Quiet);
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 093017c..b832018 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -212,7 +212,7 @@ bool cmCTestGIT::UpdateByFetchAndReset()
bool cmCTestGIT::UpdateByCustom(std::string const& custom)
{
std::vector<std::string> git_custom_command;
- cmSystemTools::ExpandListArgument(custom, git_custom_command, true);
+ cmExpandList(custom, git_custom_command, true);
std::vector<char const*> git_custom;
git_custom.reserve(git_custom_command.size() + 1);
for (std::string const& i : git_custom_command) {
@@ -270,7 +270,7 @@ bool cmCTestGIT::UpdateImpl()
std::string init_submodules =
this->CTest->GetCTestConfiguration("GITInitSubmodules");
- if (cmSystemTools::IsOn(init_submodules)) {
+ if (cmIsOn(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/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 739cc58..4708a71 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -283,8 +283,7 @@ void cmCTestLaunch::LoadLabels()
// Labels are listed in per-target files.
std::string fname = this->OptionBuildDir;
- fname += "/CMakeFiles";
- fname += "/";
+ fname += "/CMakeFiles/";
fname += this->OptionTargetName;
fname += ".dir/Labels.txt";
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 42534f7..ae965ea 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -10,6 +10,7 @@
#include "cmDuration.h"
#include "cmListFileCache.h"
#include "cmRange.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
@@ -110,8 +111,7 @@ void cmCTestMultiProcessHandler::SetTestLoad(unsigned long 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)) {
+ if (!cmStrToULong(fake_load_value, &this->FakeLoadForTesting)) {
cmSystemTools::Error("Failed to parse fake load value: " +
fake_load_value);
}
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 2eb8dba..80eb8d9 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -7,6 +7,7 @@
#include "cmCTestVC.h"
#include "cmProcessTools.h"
#include "cmRange.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmsys/RegularExpression.hxx"
@@ -460,7 +461,7 @@ bool cmCTestP4::LoadModifications()
bool cmCTestP4::UpdateCustom(const std::string& custom)
{
std::vector<std::string> p4_custom_command;
- cmSystemTools::ExpandListArgument(custom, p4_custom_command, true);
+ cmExpandList(custom, p4_custom_command, true);
std::vector<char const*> p4_custom;
p4_custom.reserve(p4_custom_command.size() + 1);
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 65cf646..fb91322 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -689,7 +689,7 @@ bool cmCTestRunTest::ForkProcess(cmDuration testTimeOut, bool explicitTimeout,
this->TestProcess->SetTimeout(timeout);
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmSystemTools::SaveRestoreEnvironment sre;
#endif
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 4288b25..1c40a58 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -495,7 +495,7 @@ void cmCTestScriptHandler::SleepInSeconds(unsigned int secondsToWait)
int cmCTestScriptHandler::RunConfigurationScript(
const std::string& total_script_arg, bool pscope)
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmSystemTools::SaveRestoreEnvironment sre;
#endif
@@ -544,7 +544,7 @@ int cmCTestScriptHandler::RunCurrentScript()
// set any environment variables
if (!this->CTestEnv.empty()) {
std::vector<std::string> envArgs;
- cmSystemTools::ExpandListArgument(this->CTestEnv, envArgs);
+ cmExpandList(this->CTestEnv, envArgs);
cmSystemTools::AppendEnv(envArgs);
}
@@ -651,7 +651,7 @@ int cmCTestScriptHandler::PerformExtraUpdates()
command = this->UpdateCmd;
for (std::string const& eu : this->ExtraUpdates) {
std::vector<std::string> cvsArgs;
- cmSystemTools::ExpandListArgument(eu, cvsArgs);
+ cmExpandList(eu, cvsArgs);
if (cvsArgs.size() == 2) {
std::string fullCommand = command;
fullCommand += " update ";
@@ -795,7 +795,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
// run ctest, it may be more than one command in here
std::vector<std::string> ctestCommands;
- cmSystemTools::ExpandListArgument(this->CTestCmd, ctestCommands);
+ cmExpandList(this->CTestCmd, ctestCommands);
// for each variable/argument do a putenv
for (std::string const& ctestCommand : ctestCommands) {
command = ctestCommand;
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 58c0a1b..ec1e9bb 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -7,6 +7,7 @@
#include "cmCommand.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include <sstream>
@@ -68,7 +69,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->Makefile->GetDefinition("CTEST_NOTES_FILES");
if (notesFilesVariable) {
std::vector<std::string> notesFiles;
- cmSystemTools::ExpandListArgument(notesFilesVariable, notesFiles);
+ cmExpandList(notesFilesVariable, notesFiles);
this->CTest->GenerateNotesFile(notesFiles);
}
@@ -76,7 +77,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES");
if (extraFilesVariable) {
std::vector<std::string> extraFiles;
- cmSystemTools::ExpandListArgument(extraFilesVariable, extraFiles);
+ cmExpandList(extraFilesVariable, extraFiles);
if (!this->CTest->SubmitExtraFiles(extraFiles)) {
this->SetError("problem submitting extra files.");
return nullptr;
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 17ef350..a30999b 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -156,7 +156,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
::curl_global_init(CURL_GLOBAL_ALL);
std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
std::vector<std::string> args;
- cmSystemTools::ExpandListArgument(curlopt, args);
+ cmExpandList(curlopt, args);
bool verifyPeerOff = false;
bool verifyHostOff = false;
for (std::string const& arg : args) {
@@ -280,7 +280,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
upload_as += "&MD5=";
- if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) {
+ if (cmIsOn(this->GetOption("InternalTest"))) {
upload_as += "bad_md5sum";
} else {
upload_as +=
@@ -500,7 +500,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
curl.SetQuiet(this->Quiet);
std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
std::vector<std::string> args;
- cmSystemTools::ExpandListArgument(curlopt, args);
+ cmExpandList(curlopt, args);
curl.SetCurlOptions(args);
curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT);
curl.SetHttpHeaders(this->HttpHeaders);
@@ -517,7 +517,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
"Only http and https are supported for CDASH_UPLOAD\n");
return -1;
}
- bool internalTest = cmSystemTools::IsOn(this->GetOption("InternalTest"));
+ bool internalTest = cmIsOn(this->GetOption("InternalTest"));
// Get RETRY_COUNT and RETRY_DELAY values if they were set.
std::string retryDelayString = this->GetOption("RetryDelay") == nullptr
@@ -529,8 +529,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
auto retryDelay = std::chrono::seconds(0);
if (!retryDelayString.empty()) {
unsigned long retryDelayValue = 0;
- if (!cmSystemTools::StringToULong(retryDelayString.c_str(),
- &retryDelayValue)) {
+ if (!cmStrToULong(retryDelayString, &retryDelayValue)) {
cmCTestLog(this->CTest, WARNING,
"Invalid value for 'RETRY_DELAY' : " << retryDelayString
<< std::endl);
@@ -540,7 +539,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
}
unsigned long retryCount = 0;
if (!retryCountString.empty()) {
- if (!cmSystemTools::StringToULong(retryCountString.c_str(), &retryCount)) {
+ if (!cmStrToULong(retryCountString, &retryCount)) {
cmCTestLog(this->CTest, WARNING,
"Invalid value for 'RETRY_DELAY' : " << retryCountString
<< std::endl);
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index cfd5e3d..24de5b4 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -7,7 +7,7 @@
#include "cmCTestTestHandler.h"
#include "cmDuration.h"
#include "cmMakefile.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
#include <chrono>
#include <sstream>
@@ -110,15 +110,14 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
unsigned long testLoad;
const char* ctestTestLoad = this->Makefile->GetDefinition("CTEST_TEST_LOAD");
if (this->Values[ctt_TEST_LOAD] && *this->Values[ctt_TEST_LOAD]) {
- if (!cmSystemTools::StringToULong(this->Values[ctt_TEST_LOAD],
- &testLoad)) {
+ if (!cmStrToULong(this->Values[ctt_TEST_LOAD], &testLoad)) {
testLoad = 0;
cmCTestLog(this->CTest, WARNING,
"Invalid value for 'TEST_LOAD' : "
<< this->Values[ctt_TEST_LOAD] << std::endl);
}
} else if (ctestTestLoad && *ctestTestLoad) {
- if (!cmSystemTools::StringToULong(ctestTestLoad, &testLoad)) {
+ if (!cmStrToULong(ctestTestLoad, &testLoad)) {
testLoad = 0;
cmCTestLog(this->CTest, WARNING,
"Invalid value for 'CTEST_TEST_LOAD' : " << ctestTestLoad
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 67c24ca..797d47e 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -512,8 +512,8 @@ bool cmCTestTestHandler::ProcessOptions()
{
// Update internal data structure from generic one
this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation"));
- this->SetUseUnion(cmSystemTools::IsOn(this->GetOption("UseUnion")));
- if (cmSystemTools::IsOn(this->GetOption("ScheduleRandom"))) {
+ this->SetUseUnion(cmIsOn(this->GetOption("UseUnion")));
+ if (cmIsOn(this->GetOption("ScheduleRandom"))) {
this->CTest->SetScheduleType("Random");
}
if (this->GetOption("ParallelLevel")) {
@@ -553,7 +553,7 @@ bool cmCTestTestHandler::ProcessOptions()
if (val) {
this->ExcludeFixtureCleanupRegExp = val;
}
- this->SetRerunFailed(cmSystemTools::IsOn(this->GetOption("RerunFailed")));
+ this->SetRerunFailed(cmIsOn(this->GetOption("RerunFailed")));
return true;
}
@@ -2180,7 +2180,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if (key == "_BACKTRACE_TRIPLES") {
std::vector<std::string> triples;
// allow empty args in the triples
- cmSystemTools::ExpandListArgument(val, triples, true);
+ cmExpandList(val, triples, true);
// Ensure we have complete triples otherwise the data is corrupt.
if (triples.size() % 3 == 0) {
@@ -2193,8 +2193,7 @@ bool cmCTestTestHandler::SetTestsProperties(
cmListFileContext fc;
fc.FilePath = triples[i - 3];
long line = 0;
- if (!cmSystemTools::StringToLong(triples[i - 2].c_str(),
- &line)) {
+ if (!cmStrToLong(triples[i - 2], &line)) {
line = 0;
}
fc.Line = line;
@@ -2204,38 +2203,38 @@ bool cmCTestTestHandler::SetTestsProperties(
}
}
if (key == "WILL_FAIL") {
- rt.WillFail = cmSystemTools::IsOn(val);
+ rt.WillFail = cmIsOn(val);
}
if (key == "DISABLED") {
- rt.Disabled = cmSystemTools::IsOn(val);
+ rt.Disabled = cmIsOn(val);
}
if (key == "ATTACHED_FILES") {
- cmSystemTools::ExpandListArgument(val, rt.AttachedFiles);
+ cmExpandList(val, rt.AttachedFiles);
}
if (key == "ATTACHED_FILES_ON_FAIL") {
- cmSystemTools::ExpandListArgument(val, rt.AttachOnFail);
+ cmExpandList(val, rt.AttachOnFail);
}
if (key == "RESOURCE_LOCK") {
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val, lval);
+ cmExpandList(val, lval);
rt.LockedResources.insert(lval.begin(), lval.end());
}
if (key == "FIXTURES_SETUP") {
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val, lval);
+ cmExpandList(val, lval);
rt.FixturesSetup.insert(lval.begin(), lval.end());
}
if (key == "FIXTURES_CLEANUP") {
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val, lval);
+ cmExpandList(val, lval);
rt.FixturesCleanup.insert(lval.begin(), lval.end());
}
if (key == "FIXTURES_REQUIRED") {
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val, lval);
+ cmExpandList(val, lval);
rt.FixturesRequired.insert(lval.begin(), lval.end());
}
@@ -2247,21 +2246,21 @@ bool cmCTestTestHandler::SetTestsProperties(
rt.Cost = static_cast<float>(atof(val.c_str()));
}
if (key == "REQUIRED_FILES") {
- cmSystemTools::ExpandListArgument(val, rt.RequiredFiles);
+ cmExpandList(val, rt.RequiredFiles);
}
if (key == "RUN_SERIAL") {
- rt.RunSerial = cmSystemTools::IsOn(val);
+ rt.RunSerial = cmIsOn(val);
}
if (key == "FAIL_REGULAR_EXPRESSION") {
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val, lval);
+ cmExpandList(val, lval);
for (std::string const& cr : lval) {
rt.ErrorRegularExpressions.emplace_back(cr, cr);
}
}
if (key == "SKIP_REGULAR_EXPRESSION") {
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val, lval);
+ cmExpandList(val, lval);
for (std::string const& cr : lval) {
rt.SkipRegularExpressions.emplace_back(cr, cr);
}
@@ -2273,7 +2272,7 @@ bool cmCTestTestHandler::SetTestsProperties(
}
}
if (key == "PROCESSOR_AFFINITY") {
- rt.WantAffinity = cmSystemTools::IsOn(val);
+ rt.WantAffinity = cmIsOn(val);
}
if (key == "SKIP_RETURN_CODE") {
rt.SkipReturnCode = atoi(val.c_str());
@@ -2282,14 +2281,14 @@ bool cmCTestTestHandler::SetTestsProperties(
}
}
if (key == "DEPENDS") {
- cmSystemTools::ExpandListArgument(val, rt.Depends);
+ cmExpandList(val, rt.Depends);
}
if (key == "ENVIRONMENT") {
- cmSystemTools::ExpandListArgument(val, rt.Environment);
+ cmExpandList(val, rt.Environment);
}
if (key == "LABELS") {
std::vector<std::string> Labels;
- cmSystemTools::ExpandListArgument(val, Labels);
+ cmExpandList(val, Labels);
rt.Labels.insert(rt.Labels.end(), Labels.begin(), Labels.end());
// sort the array
std::sort(rt.Labels.begin(), rt.Labels.end());
@@ -2310,7 +2309,7 @@ bool cmCTestTestHandler::SetTestsProperties(
}
if (key == "PASS_REGULAR_EXPRESSION") {
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val, lval);
+ cmExpandList(val, lval);
for (std::string const& cr : lval) {
rt.RequiredRegularExpressions.emplace_back(cr, cr);
}
@@ -2320,7 +2319,7 @@ bool cmCTestTestHandler::SetTestsProperties(
}
if (key == "TIMEOUT_AFTER_MATCH") {
std::vector<std::string> propArgs;
- cmSystemTools::ExpandListArgument(val, propArgs);
+ cmExpandList(val, propArgs);
if (propArgs.size() != 2) {
cmCTestLog(this->CTest, WARNING,
"TIMEOUT_AFTER_MATCH expects two arguments, found "
@@ -2328,7 +2327,7 @@ bool cmCTestTestHandler::SetTestsProperties(
} else {
rt.AlternateTimeout = cmDuration(atof(propArgs[0].c_str()));
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(propArgs[1], lval);
+ cmExpandList(propArgs[1], lval);
for (std::string const& cr : lval) {
rt.TimeoutRegularExpressions.emplace_back(cr, cr);
}
@@ -2371,7 +2370,7 @@ bool cmCTestTestHandler::SetDirectoryProperties(
if (cwd == rt.Directory) {
if (key == "LABELS") {
std::vector<std::string> DirectoryLabels;
- cmSystemTools::ExpandListArgument(val, DirectoryLabels);
+ cmExpandList(val, DirectoryLabels);
rt.Labels.insert(rt.Labels.end(), DirectoryLabels.begin(),
DirectoryLabels.end());
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index eea41cf..773886d 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -3,6 +3,7 @@
#include "cmCTestVC.h"
#include "cmCTest.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmXMLWriter.h"
@@ -152,8 +153,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"))) {
+ if (!cmIsOn(this->CTest->GetCTestConfiguration("UpdateVersionOnly"))) {
result = this->NoteOldRevision() && result;
this->Log << "--- Begin Update ---\n";
result = this->UpdateImpl() && result;
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index c1dd591..f7e3920 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -11,6 +11,7 @@
#include "cmCursesWidget.h"
#include "cmState.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -49,7 +50,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
switch (cm->GetState()->GetCacheEntryType(key)) {
case cmStateEnums::BOOL:
this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1);
- if (cmSystemTools::IsOn(value)) {
+ if (cmIsOn(value)) {
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true);
} else {
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(false);
@@ -71,7 +72,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1);
this->Entry = ow;
std::vector<std::string> options;
- cmSystemTools::ExpandListArgument(stringsProp, options);
+ cmExpandList(stringsProp, options);
for (auto const& opt : options) {
ow->AddOption(opt);
}
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 028e852..9ac80b8 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -13,6 +13,7 @@
#include "cmCursesWidget.h"
#include "cmState.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
#include "cmake.h"
@@ -696,7 +697,7 @@ void cmCursesMainForm::FixValue(cmStateEnums::CacheEntryType type,
cmSystemTools::ConvertToUnixSlashes(out);
}
if (type == cmStateEnums::BOOL) {
- if (cmSystemTools::IsOff(out)) {
+ if (cmIsOff(out)) {
out = "OFF";
} else {
out = "ON";
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index f357f90..ece3307 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -7,6 +7,7 @@
#include "cmExternalMakefileProjectGenerator.h"
#include "cmState.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#ifdef Q_OS_WIN
@@ -312,7 +313,7 @@ QCMakePropertyList QCMake::properties() const
prop.Advanced = state->GetCacheEntryPropertyAsBool(key, "ADVANCED");
if (t == cmStateEnums::BOOL) {
prop.Type = QCMakeProperty::BOOL;
- prop.Value = cmSystemTools::IsOn(cachedValue);
+ prop.Value = cmIsOn(cachedValue);
} else if (t == cmStateEnums::PATH) {
prop.Type = QCMakeProperty::PATH;
} else if (t == cmStateEnums::FILEPATH) {
diff --git a/Source/cmAddCompileDefinitionsCommand.cxx b/Source/cmAddCompileDefinitionsCommand.cxx
index 0474819..b00a4a7 100644
--- a/Source/cmAddCompileDefinitionsCommand.cxx
+++ b/Source/cmAddCompileDefinitionsCommand.cxx
@@ -2,19 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddCompileDefinitionsCommand.h"
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
-class cmExecutionStatus;
-
-bool cmAddCompileDefinitionsCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmAddCompileDefinitionsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
- if (args.empty()) {
- return true;
- }
-
+ cmMakefile& mf = status.GetMakefile();
for (std::string const& i : args) {
- this->Makefile->AddCompileDefinition(i);
+ mf.AddCompileDefinition(i);
}
return true;
}
diff --git a/Source/cmAddCompileDefinitionsCommand.h b/Source/cmAddCompileDefinitionsCommand.h
index 5f90ed9..4bd621c 100644
--- a/Source/cmAddCompileDefinitionsCommand.h
+++ b/Source/cmAddCompileDefinitionsCommand.h
@@ -8,29 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-class cmAddCompileDefinitionsCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddCompileDefinitionsCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddCompileDefinitionsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddCompileOptionsCommand.cxx b/Source/cmAddCompileOptionsCommand.cxx
index 412fb38..8ccb512 100644
--- a/Source/cmAddCompileOptionsCommand.cxx
+++ b/Source/cmAddCompileOptionsCommand.cxx
@@ -2,19 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddCompileOptionsCommand.h"
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
-class cmExecutionStatus;
-
-bool cmAddCompileOptionsCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmAddCompileOptionsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
- if (args.empty()) {
- return true;
- }
-
+ cmMakefile& mf = status.GetMakefile();
for (std::string const& i : args) {
- this->Makefile->AddCompileOption(i);
+ mf.AddCompileOption(i);
}
return true;
}
diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h
index b34b7fc..b172412 100644
--- a/Source/cmAddCompileOptionsCommand.h
+++ b/Source/cmAddCompileOptionsCommand.h
@@ -8,29 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-class cmAddCompileOptionsCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddCompileOptionsCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddCompileOptionsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 6eb38bd..e502a64 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -8,6 +8,7 @@
#include "cmCustomCommand.h"
#include "cmCustomCommandLines.h"
+#include "cmExecutionStatus.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -16,21 +17,22 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
-class cmExecutionStatus;
+static bool cmAddCustomCommandCommandCheckOutputs(
+ const std::vector<std::string>& outputs, cmExecutionStatus& status);
-// cmAddCustomCommandCommand
-bool cmAddCustomCommandCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
/* Let's complain at the end of this function about the lack of a particular
arg. For the moment, let's say that COMMAND, and either TARGET or SOURCE
are required.
*/
if (args.size() < 4) {
- this->SetError("called with wrong number of arguments.");
+ status.SetError("called with wrong number of arguments.");
return false;
}
+ cmMakefile& mf = status.GetMakefile();
std::string source, target, main_dependency, working, depfile, job_pool;
std::string comment_buffer;
const char* comment = nullptr;
@@ -167,9 +169,9 @@ bool cmAddCustomCommandCommand::InitialPass(
doing = doing_comment;
} else if (copy == keyDEPFILE) {
doing = doing_depfile;
- if (this->Makefile->GetGlobalGenerator()->GetName() != "Ninja") {
- this->SetError("Option DEPFILE not supported by " +
- this->Makefile->GetGlobalGenerator()->GetName());
+ if (mf.GetGlobalGenerator()->GetName() != "Ninja") {
+ status.SetError("Option DEPFILE not supported by " +
+ mf.GetGlobalGenerator()->GetName());
return false;
}
} else if (copy == keyJOB_POOL) {
@@ -192,7 +194,7 @@ bool cmAddCustomCommandCommand::InitialPass(
// and later references "${CMAKE_CURRENT_SOURCE_DIR}/out.txt".
// This is fairly obscure so we can wait for someone to
// complain.
- filename = this->Makefile->GetCurrentBinaryDirectory();
+ filename = mf.GetCurrentBinaryDirectory();
filename += "/";
}
filename += copy;
@@ -269,7 +271,7 @@ bool cmAddCustomCommandCommand::InitialPass(
comment = comment_buffer.c_str();
break;
default:
- this->SetError("Wrong syntax. Unknown type of argument.");
+ status.SetError("Wrong syntax. Unknown type of argument.");
return false;
}
}
@@ -284,31 +286,31 @@ bool cmAddCustomCommandCommand::InitialPass(
// At this point we could complain about the lack of arguments. For
// the moment, let's say that COMMAND, TARGET are always required.
if (output.empty() && target.empty()) {
- this->SetError("Wrong syntax. A TARGET or OUTPUT must be specified.");
+ status.SetError("Wrong syntax. A TARGET or OUTPUT must be specified.");
return false;
}
if (source.empty() && !target.empty() && !output.empty()) {
- this->SetError(
+ status.SetError(
"Wrong syntax. A TARGET and OUTPUT can not both be specified.");
return false;
}
if (append && output.empty()) {
- this->SetError("given APPEND option with no OUTPUT.");
+ status.SetError("given APPEND option with no OUTPUT.");
return false;
}
// Make sure the output names and locations are safe.
- if (!this->CheckOutputs(output) || !this->CheckOutputs(outputs) ||
- !this->CheckOutputs(byproducts)) {
+ if (!cmAddCustomCommandCommandCheckOutputs(output, status) ||
+ !cmAddCustomCommandCommandCheckOutputs(outputs, status) ||
+ !cmAddCustomCommandCommandCheckOutputs(byproducts, status)) {
return false;
}
// Check for an append request.
if (append) {
// Lookup an existing command.
- if (cmSourceFile* sf =
- this->Makefile->GetSourceFileWithOutput(output[0])) {
+ if (cmSourceFile* sf = mf.GetSourceFileWithOutput(output[0])) {
if (cmCustomCommand* cc = sf->GetCustomCommand()) {
cc->AppendCommands(commandLines);
cc->AppendDepends(depends);
@@ -321,12 +323,12 @@ bool cmAddCustomCommandCommand::InitialPass(
std::ostringstream e;
e << "given APPEND option with output\n\"" << output[0]
<< "\"\nwhich is not already a custom command output.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
if (uses_terminal && !job_pool.empty()) {
- this->SetError("JOB_POOL is shadowed by USES_TERMINAL.");
+ status.SetError("JOB_POOL is shadowed by USES_TERMINAL.");
return false;
}
@@ -335,22 +337,21 @@ bool cmAddCustomCommandCommand::InitialPass(
if (source.empty() && output.empty()) {
// Source is empty, use the target.
std::vector<std::string> no_depends;
- this->Makefile->AddCustomCommandToTarget(
- target, byproducts, no_depends, commandLines, cctype, comment,
- working.c_str(), escapeOldStyle, uses_terminal, depfile, job_pool,
- command_expand_lists);
+ mf.AddCustomCommandToTarget(target, byproducts, no_depends, commandLines,
+ cctype, comment, working.c_str(),
+ escapeOldStyle, uses_terminal, depfile,
+ job_pool, command_expand_lists);
} else if (target.empty()) {
// Target is empty, use the output.
- this->Makefile->AddCustomCommandToOutput(
- output, byproducts, depends, main_dependency, commandLines, comment,
- working.c_str(), false, escapeOldStyle, uses_terminal,
- command_expand_lists, depfile, job_pool);
+ mf.AddCustomCommandToOutput(output, byproducts, depends, main_dependency,
+ commandLines, comment, working.c_str(), false,
+ escapeOldStyle, uses_terminal,
+ command_expand_lists, depfile, job_pool);
// Add implicit dependency scanning requests if any were given.
if (!implicit_depends.empty()) {
bool okay = false;
- if (cmSourceFile* sf =
- this->Makefile->GetSourceFileWithOutput(output[0])) {
+ if (cmSourceFile* sf = mf.GetSourceFileWithOutput(output[0])) {
if (cmCustomCommand* cc = sf->GetCustomCommand()) {
okay = true;
cc->SetImplicitDepends(implicit_depends);
@@ -360,21 +361,21 @@ bool cmAddCustomCommandCommand::InitialPass(
std::ostringstream e;
e << "could not locate source file with a custom command producing \""
<< output[0] << "\" even though this command tried to create it!";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
}
} else if (!byproducts.empty()) {
- this->SetError("BYPRODUCTS may not be specified with SOURCE signatures");
+ status.SetError("BYPRODUCTS may not be specified with SOURCE signatures");
return false;
} else if (uses_terminal) {
- this->SetError("USES_TERMINAL may not be used with SOURCE signatures");
+ status.SetError("USES_TERMINAL may not be used with SOURCE signatures");
return false;
} else {
bool issueMessage = true;
std::ostringstream e;
MessageType messageType = MessageType::AUTHOR_WARNING;
- switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) {
+ switch (mf.GetPolicyStatus(cmPolicies::CMP0050)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0050) << "\n";
break;
@@ -391,30 +392,31 @@ bool cmAddCustomCommandCommand::InitialPass(
if (issueMessage) {
e << "The SOURCE signatures of add_custom_command are no longer "
"supported.";
- this->Makefile->IssueMessage(messageType, e.str());
+ mf.IssueMessage(messageType, e.str());
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
// Use the old-style mode for backward compatibility.
- this->Makefile->AddCustomCommandOldStyle(target, outputs, depends, source,
- commandLines, comment);
+ mf.AddCustomCommandOldStyle(target, outputs, depends, source, commandLines,
+ comment);
}
return true;
}
-bool cmAddCustomCommandCommand::CheckOutputs(
- const std::vector<std::string>& outputs)
+bool cmAddCustomCommandCommandCheckOutputs(
+ const std::vector<std::string>& outputs, cmExecutionStatus& status)
{
+ cmMakefile& mf = status.GetMakefile();
for (std::string const& o : outputs) {
// Make sure the file will not be generated into the source
// directory during an out of source build.
- if (!this->Makefile->CanIWriteThisFile(o)) {
+ if (!mf.CanIWriteThisFile(o)) {
std::string e = "attempted to have a file \"" + o +
"\" in a source directory as an output of custom command.";
- this->SetError(e);
+ status.SetError(e);
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -425,7 +427,7 @@ bool cmAddCustomCommandCommand::CheckOutputs(
std::ostringstream msg;
msg << "called with OUTPUT containing a \"" << o[pos]
<< "\". This character is not allowed.";
- this->SetError(msg.str());
+ status.SetError(msg.str());
return false;
}
}
diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h
index 931aeab..4f8c58f 100644
--- a/Source/cmAddCustomCommandCommand.h
+++ b/Source/cmAddCustomCommandCommand.h
@@ -8,38 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmAddCustomCommandCommand
- * \brief cmAddCustomCommandCommand defines a new command (rule) that can
- * be executed within the build process
- *
- */
-
-class cmAddCustomCommandCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddCustomCommandCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-
-protected:
- bool CheckOutputs(const std::vector<std::string>& outputs);
-};
+bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 0ecd5f5..f812ab5 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -6,6 +6,7 @@
#include <utility>
#include "cmCustomCommandLines.h"
+#include "cmExecutionStatus.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
@@ -14,17 +15,15 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
-class cmExecutionStatus;
-
-// cmAddCustomTargetCommand
-bool cmAddCustomTargetCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmAddCustomTargetCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (args.empty()) {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
+ cmMakefile& mf = status.GetMakefile();
std::string const& targetName = args[0];
// Check the target name.
@@ -33,7 +32,7 @@ bool cmAddCustomTargetCommand::InitialPass(
e << "called with invalid target name \"" << targetName
<< "\". Target names may not contain a slash. "
<< "Use ADD_CUSTOM_COMMAND to generate files.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
@@ -122,7 +121,7 @@ bool cmAddCustomTargetCommand::InitialPass(
case doing_byproducts: {
std::string filename;
if (!cmSystemTools::FileIsFullPath(copy)) {
- filename = this->Makefile->GetCurrentBinaryDirectory();
+ filename = mf.GetCurrentBinaryDirectory();
filename += "/";
}
filename += copy;
@@ -145,7 +144,7 @@ bool cmAddCustomTargetCommand::InitialPass(
job_pool = copy;
break;
default:
- this->SetError("Wrong syntax. Unknown type of argument.");
+ status.SetError("Wrong syntax. Unknown type of argument.");
return false;
}
}
@@ -156,7 +155,7 @@ bool cmAddCustomTargetCommand::InitialPass(
std::ostringstream msg;
msg << "called with target name containing a \"" << targetName[pos]
<< "\". This character is not allowed.";
- this->SetError(msg.str());
+ status.SetError(msg.str());
return false;
}
@@ -168,8 +167,7 @@ bool cmAddCustomTargetCommand::InitialPass(
if (nameOk) {
nameOk = targetName.find(':') == std::string::npos;
}
- if (!nameOk &&
- !this->Makefile->CheckCMP0037(targetName, cmStateEnums::UTILITY)) {
+ if (!nameOk && !mf.CheckCMP0037(targetName, cmStateEnums::UTILITY)) {
return false;
}
@@ -182,39 +180,37 @@ bool cmAddCustomTargetCommand::InitialPass(
// Enforce name uniqueness.
{
std::string msg;
- if (!this->Makefile->EnforceUniqueName(targetName, msg, true)) {
- this->SetError(msg);
+ if (!mf.EnforceUniqueName(targetName, msg, true)) {
+ status.SetError(msg);
return false;
}
}
if (commandLines.empty() && !byproducts.empty()) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "BYPRODUCTS may not be specified without any COMMAND");
+ mf.IssueMessage(MessageType::FATAL_ERROR,
+ "BYPRODUCTS may not be specified without any COMMAND");
return true;
}
if (commandLines.empty() && uses_terminal) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "USES_TERMINAL may not be specified without any COMMAND");
+ mf.IssueMessage(MessageType::FATAL_ERROR,
+ "USES_TERMINAL may not be specified without any COMMAND");
return true;
}
if (commandLines.empty() && command_expand_lists) {
- this->Makefile->IssueMessage(
+ mf.IssueMessage(
MessageType::FATAL_ERROR,
"COMMAND_EXPAND_LISTS may not be specified without any COMMAND");
return true;
}
if (uses_terminal && !job_pool.empty()) {
- this->SetError("JOB_POOL is shadowed by USES_TERMINAL.");
+ status.SetError("JOB_POOL is shadowed by USES_TERMINAL.");
return false;
}
// Add the utility target to the makefile.
bool escapeOldStyle = !verbatim;
- cmTarget* target = this->Makefile->AddUtilityCommand(
+ cmTarget* target = mf.AddUtilityCommand(
targetName, cmMakefile::TargetOrigin::Project, excludeFromAll,
working_directory.c_str(), byproducts, depends, commandLines,
escapeOldStyle, comment, uses_terminal, command_expand_lists, job_pool);
diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h
index db577bc..e23ef9f 100644
--- a/Source/cmAddCustomTargetCommand.h
+++ b/Source/cmAddCustomTargetCommand.h
@@ -8,36 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmAddCustomTargetCommand
- * \brief Command that adds a target to the build system.
- *
- * cmAddCustomTargetCommand adds an extra target to the build system.
- * This is useful when you would like to add special
- * targets like "install,", "clean," and so on.
- */
-class cmAddCustomTargetCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddCustomTargetCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddCustomTargetCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddDefinitionsCommand.cxx b/Source/cmAddDefinitionsCommand.cxx
index 62e57a3..0b10aee 100644
--- a/Source/cmAddDefinitionsCommand.cxx
+++ b/Source/cmAddDefinitionsCommand.cxx
@@ -2,21 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddDefinitionsCommand.h"
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
-class cmExecutionStatus;
-
-// cmAddDefinitionsCommand
-bool cmAddDefinitionsCommand::InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus&)
+bool cmAddDefinitionsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
- // it is OK to have no arguments
- if (args.empty()) {
- return true;
- }
-
+ cmMakefile& mf = status.GetMakefile();
for (std::string const& i : args) {
- this->Makefile->AddDefineFlag(i);
+ mf.AddDefineFlag(i);
}
return true;
}
diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h
index 0e32c83..a67f095 100644
--- a/Source/cmAddDefinitionsCommand.h
+++ b/Source/cmAddDefinitionsCommand.h
@@ -8,35 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmAddDefinitionsCommand
- * \brief Specify a list of compiler defines
- *
- * cmAddDefinitionsCommand specifies a list of compiler defines. These defines
- * will be added to the compile command.
- */
-class cmAddDefinitionsCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddDefinitionsCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddDefinitionsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index 4956a47..0ddbda8 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -4,34 +4,33 @@
#include <sstream>
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmRange.h"
#include "cmTarget.h"
-class cmExecutionStatus;
-
-// cmDependenciesCommand
-bool cmAddDependenciesCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmAddDependenciesCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (args.size() < 2) {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
+ cmMakefile& mf = status.GetMakefile();
std::string const& target_name = args[0];
- if (this->Makefile->IsAlias(target_name)) {
+ if (mf.IsAlias(target_name)) {
std::ostringstream e;
e << "Cannot add target-level dependencies to alias target \""
<< target_name << "\".\n";
- this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ mf.IssueMessage(MessageType::FATAL_ERROR, e.str());
}
- if (cmTarget* target = this->Makefile->FindTargetToUse(target_name)) {
+ if (cmTarget* target = mf.FindTargetToUse(target_name)) {
// skip over target_name
for (std::string const& arg : cmMakeRange(args).advance(1)) {
- target->AddUtility(arg, this->Makefile);
+ target->AddUtility(arg, &mf);
}
} else {
std::ostringstream e;
@@ -41,7 +40,7 @@ bool cmAddDependenciesCommand::InitialPass(
<< "by the add_executable, add_library, or add_custom_target commands. "
<< "If you want to add file-level dependencies see the DEPENDS option "
<< "of the add_custom_target and add_custom_command commands.";
- this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ mf.IssueMessage(MessageType::FATAL_ERROR, e.str());
}
return true;
diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h
index ce912d3..0c60e3a 100644
--- a/Source/cmAddDependenciesCommand.h
+++ b/Source/cmAddDependenciesCommand.h
@@ -8,34 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmAddDependenciesCommand
- * \brief Add a dependency to a target
- *
- * cmAddDependenciesCommand adds a dependency to a target
- */
-class cmAddDependenciesCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddDependenciesCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddDependenciesCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index 5685fdf..59d6be3 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -4,22 +4,22 @@
#include <sstream>
+#include "cmExecutionStatus.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmStateTypes.h"
#include "cmTarget.h"
-class cmExecutionStatus;
-
-// cmExecutableCommand
-bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus&)
+bool cmAddExecutableCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (args.empty()) {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
+
+ cmMakefile& mf = status.GetMakefile();
std::vector<std::string>::const_iterator s = args.begin();
std::string const& exename = *s;
@@ -61,59 +61,58 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args,
if (nameOk && !importTarget && !isAlias) {
nameOk = exename.find(':') == std::string::npos;
}
- if (!nameOk &&
- !this->Makefile->CheckCMP0037(exename, cmStateEnums::EXECUTABLE)) {
+ if (!nameOk && !mf.CheckCMP0037(exename, cmStateEnums::EXECUTABLE)) {
return false;
}
// Special modifiers are not allowed with IMPORTED signature.
if (importTarget && (use_win32 || use_macbundle || excludeFromAll)) {
if (use_win32) {
- this->SetError("may not be given WIN32 for an IMPORTED target.");
+ status.SetError("may not be given WIN32 for an IMPORTED target.");
} else if (use_macbundle) {
- this->SetError("may not be given MACOSX_BUNDLE for an IMPORTED target.");
+ status.SetError(
+ "may not be given MACOSX_BUNDLE for an IMPORTED target.");
} else // if(excludeFromAll)
{
- this->SetError(
+ status.SetError(
"may not be given EXCLUDE_FROM_ALL for an IMPORTED target.");
}
return false;
}
if (isAlias) {
if (!cmGeneratorExpression::IsValidTargetName(exename)) {
- this->SetError("Invalid name for ALIAS: " + exename);
+ status.SetError("Invalid name for ALIAS: " + exename);
return false;
}
if (excludeFromAll) {
- this->SetError("EXCLUDE_FROM_ALL with ALIAS makes no sense.");
+ status.SetError("EXCLUDE_FROM_ALL with ALIAS makes no sense.");
return false;
}
if (importTarget || importGlobal) {
- this->SetError("IMPORTED with ALIAS is not allowed.");
+ status.SetError("IMPORTED with ALIAS is not allowed.");
return false;
}
if (args.size() != 3) {
std::ostringstream e;
e << "ALIAS requires exactly one target argument.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
std::string const& aliasedName = *s;
- if (this->Makefile->IsAlias(aliasedName)) {
+ if (mf.IsAlias(aliasedName)) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << exename << "\" because target \""
<< aliasedName << "\" is itself an ALIAS.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
- cmTarget* aliasedTarget =
- this->Makefile->FindTargetToUse(aliasedName, true);
+ cmTarget* aliasedTarget = mf.FindTargetToUse(aliasedName, true);
if (!aliasedTarget) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << exename << "\" because target \""
<< aliasedName << "\" does not already exist.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
cmStateEnums::TargetType type = aliasedTarget->GetType();
@@ -121,7 +120,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args,
std::ostringstream e;
e << "cannot create ALIAS target \"" << exename << "\" because target \""
<< aliasedName << "\" is not an executable.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
if (aliasedTarget->IsImported() &&
@@ -129,42 +128,40 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args,
std::ostringstream e;
e << "cannot create ALIAS target \"" << exename << "\" because target \""
<< aliasedName << "\" is imported but not globally visible.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
- this->Makefile->AddAlias(exename, aliasedName);
+ mf.AddAlias(exename, aliasedName);
return true;
}
// Handle imported target creation.
if (importTarget) {
// Make sure the target does not already exist.
- if (this->Makefile->FindTargetToUse(exename)) {
+ if (mf.FindTargetToUse(exename)) {
std::ostringstream e;
e << "cannot create imported target \"" << exename
<< "\" because another target with the same name already exists.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
// Create the imported target.
- this->Makefile->AddImportedTarget(exename, cmStateEnums::EXECUTABLE,
- importGlobal);
+ mf.AddImportedTarget(exename, cmStateEnums::EXECUTABLE, importGlobal);
return true;
}
// Enforce name uniqueness.
{
std::string msg;
- if (!this->Makefile->EnforceUniqueName(exename, msg)) {
- this->SetError(msg);
+ if (!mf.EnforceUniqueName(exename, msg)) {
+ status.SetError(msg);
return false;
}
}
std::vector<std::string> srclists(s, args.end());
- cmTarget* tgt =
- this->Makefile->AddExecutable(exename, srclists, excludeFromAll);
+ cmTarget* tgt = mf.AddExecutable(exename, srclists, excludeFromAll);
if (use_win32) {
tgt->SetProperty("WIN32_EXECUTABLE", "ON");
}
diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h
index ec57c3f..f7bc273 100644
--- a/Source/cmAddExecutableCommand.h
+++ b/Source/cmAddExecutableCommand.h
@@ -8,35 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmExecutablesCommand
- * \brief Defines a list of executables to build.
- *
- * cmExecutablesCommand defines a list of executable (i.e., test)
- * programs to create.
- */
-class cmAddExecutableCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddExecutableCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddExecutableCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index ad12e89..46fc61d 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -5,30 +5,29 @@
#include <sstream>
#include "cmAlgorithms.h"
+#include "cmExecutionStatus.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
#include "cmTarget.h"
-class cmExecutionStatus;
-
-// cmLibraryCommand
-bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus&)
+bool cmAddLibraryCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (args.empty()) {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
+
+ cmMakefile& mf = status.GetMakefile();
// Library type defaults to value of BUILD_SHARED_LIBS, if it exists,
// otherwise it defaults to static library.
cmStateEnums::TargetType type = cmStateEnums::SHARED_LIBRARY;
- if (cmSystemTools::IsOff(
- this->Makefile->GetDefinition("BUILD_SHARED_LIBS"))) {
+ if (cmIsOff(mf.GetDefinition("BUILD_SHARED_LIBS"))) {
type = cmStateEnums::STATIC_LIBRARY;
}
bool excludeFromAll = false;
@@ -52,7 +51,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (type == cmStateEnums::INTERFACE_LIBRARY) {
std::ostringstream e;
e << "INTERFACE library specified with conflicting STATIC type.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
++s;
@@ -62,7 +61,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (type == cmStateEnums::INTERFACE_LIBRARY) {
std::ostringstream e;
e << "INTERFACE library specified with conflicting SHARED type.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
++s;
@@ -72,7 +71,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (type == cmStateEnums::INTERFACE_LIBRARY) {
std::ostringstream e;
e << "INTERFACE library specified with conflicting MODULE type.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
++s;
@@ -82,7 +81,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (type == cmStateEnums::INTERFACE_LIBRARY) {
std::ostringstream e;
e << "INTERFACE library specified with conflicting OBJECT type.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
++s;
@@ -92,7 +91,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (type == cmStateEnums::INTERFACE_LIBRARY) {
std::ostringstream e;
e << "INTERFACE library specified with conflicting UNKNOWN type.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
++s;
@@ -102,7 +101,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (type == cmStateEnums::INTERFACE_LIBRARY) {
std::ostringstream e;
e << "INTERFACE library specified with conflicting ALIAS type.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
++s;
@@ -111,19 +110,19 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (haveSpecifiedType) {
std::ostringstream e;
e << "INTERFACE library specified with conflicting/multiple types.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
if (isAlias) {
std::ostringstream e;
e << "INTERFACE library specified with conflicting ALIAS type.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
if (excludeFromAll) {
std::ostringstream e;
e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
++s;
@@ -133,7 +132,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (type == cmStateEnums::INTERFACE_LIBRARY) {
std::ostringstream e;
e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
++s;
@@ -147,7 +146,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
} else if (type == cmStateEnums::INTERFACE_LIBRARY && *s == "GLOBAL") {
std::ostringstream e;
e << "GLOBAL option may only be used with IMPORTED libraries.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
} else {
break;
@@ -158,13 +157,13 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (s != args.end()) {
std::ostringstream e;
e << "INTERFACE library requires no source arguments.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
if (importGlobal && !importTarget) {
std::ostringstream e;
e << "INTERFACE library specified as GLOBAL, but not as IMPORTED.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
}
@@ -175,47 +174,46 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (nameOk && !importTarget && !isAlias) {
nameOk = libName.find(':') == std::string::npos;
}
- if (!nameOk && !this->Makefile->CheckCMP0037(libName, type)) {
+ if (!nameOk && !mf.CheckCMP0037(libName, type)) {
return false;
}
if (isAlias) {
if (!cmGeneratorExpression::IsValidTargetName(libName)) {
- this->SetError("Invalid name for ALIAS: " + libName);
+ status.SetError("Invalid name for ALIAS: " + libName);
return false;
}
if (excludeFromAll) {
- this->SetError("EXCLUDE_FROM_ALL with ALIAS makes no sense.");
+ status.SetError("EXCLUDE_FROM_ALL with ALIAS makes no sense.");
return false;
}
if (importTarget || importGlobal) {
- this->SetError("IMPORTED with ALIAS is not allowed.");
+ status.SetError("IMPORTED with ALIAS is not allowed.");
return false;
}
if (args.size() != 3) {
std::ostringstream e;
e << "ALIAS requires exactly one target argument.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
std::string const& aliasedName = *s;
- if (this->Makefile->IsAlias(aliasedName)) {
+ if (mf.IsAlias(aliasedName)) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << libName << "\" because target \""
<< aliasedName << "\" is itself an ALIAS.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
- cmTarget* aliasedTarget =
- this->Makefile->FindTargetToUse(aliasedName, true);
+ cmTarget* aliasedTarget = mf.FindTargetToUse(aliasedName, true);
if (!aliasedTarget) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << libName << "\" because target \""
<< aliasedName
<< "\" does not already "
"exist.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
cmStateEnums::TargetType aliasedType = aliasedTarget->GetType();
@@ -229,7 +227,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
std::ostringstream e;
e << "cannot create ALIAS target \"" << libName << "\" because target \""
<< aliasedName << "\" is not a library.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
if (aliasedTarget->IsImported() &&
@@ -237,15 +235,15 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
std::ostringstream e;
e << "cannot create ALIAS target \"" << libName << "\" because target \""
<< aliasedName << "\" is imported but not globally visible.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
- this->Makefile->AddAlias(libName, aliasedName);
+ mf.AddAlias(libName, aliasedName);
return true;
}
if (importTarget && excludeFromAll) {
- this->SetError("excludeFromAll with IMPORTED target makes no sense.");
+ status.SetError("excludeFromAll with IMPORTED target makes no sense.");
return false;
}
@@ -255,14 +253,13 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
yet its linker language. */
if ((type == cmStateEnums::SHARED_LIBRARY ||
type == cmStateEnums::MODULE_LIBRARY) &&
- !this->Makefile->GetState()->GetGlobalPropertyAsBool(
- "TARGET_SUPPORTS_SHARED_LIBS")) {
+ !mf.GetState()->GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS")) {
std::ostringstream w;
w << "ADD_LIBRARY called with "
<< (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE")
<< " option but the target platform does not support dynamic linking. "
"Building a STATIC library instead. This may lead to problems.";
- this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
+ mf.IssueMessage(MessageType::AUTHOR_WARNING, w.str());
type = cmStateEnums::STATIC_LIBRARY;
}
@@ -270,14 +267,13 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (importTarget) {
// The IMPORTED signature requires a type to be specified explicitly.
if (!haveSpecifiedType) {
- this->SetError("called with IMPORTED argument but no library type.");
+ status.SetError("called with IMPORTED argument but no library type.");
return false;
}
if (type == cmStateEnums::OBJECT_LIBRARY) {
std::string reason;
- if (!this->Makefile->GetGlobalGenerator()->HasKnownObjectFileLocation(
- &reason)) {
- this->Makefile->IssueMessage(
+ if (!mf.GetGlobalGenerator()->HasKnownObjectFileLocation(&reason)) {
+ mf.IssueMessage(
MessageType::FATAL_ERROR,
"The OBJECT library type may not be used for IMPORTED libraries" +
reason + ".");
@@ -288,28 +284,28 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (!cmGeneratorExpression::IsValidTargetName(libName)) {
std::ostringstream e;
e << "Invalid name for IMPORTED INTERFACE library target: " << libName;
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
}
// Make sure the target does not already exist.
- if (this->Makefile->FindTargetToUse(libName)) {
+ if (mf.FindTargetToUse(libName)) {
std::ostringstream e;
e << "cannot create imported target \"" << libName
<< "\" because another target with the same name already exists.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
// Create the imported target.
- this->Makefile->AddImportedTarget(libName, type, importGlobal);
+ mf.AddImportedTarget(libName, type, importGlobal);
return true;
}
// A non-imported target may not have UNKNOWN type.
if (type == cmStateEnums::UNKNOWN_LIBRARY) {
- this->Makefile->IssueMessage(
+ mf.IssueMessage(
MessageType::FATAL_ERROR,
"The UNKNOWN library type may be used only for IMPORTED libraries.");
return true;
@@ -318,8 +314,8 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
// Enforce name uniqueness.
{
std::string msg;
- if (!this->Makefile->EnforceUniqueName(libName, msg)) {
- this->SetError(msg);
+ if (!mf.EnforceUniqueName(libName, msg)) {
+ status.SetError(msg);
return false;
}
}
@@ -331,17 +327,17 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
libName.find("::") != std::string::npos) {
std::ostringstream e;
e << "Invalid name for INTERFACE library target: " << libName;
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
- this->Makefile->AddLibrary(libName, type, srclists, excludeFromAll);
+ mf.AddLibrary(libName, type, srclists, excludeFromAll);
return true;
}
cmAppend(srclists, s, args.end());
- this->Makefile->AddLibrary(libName, type, srclists, excludeFromAll);
+ mf.AddLibrary(libName, type, srclists, excludeFromAll);
return true;
}
diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h
index 56dab41..609449c 100644
--- a/Source/cmAddLibraryCommand.h
+++ b/Source/cmAddLibraryCommand.h
@@ -8,35 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmLibrarysCommand
- * \brief Defines a list of executables to build.
- *
- * cmLibrarysCommand defines a list of executable (i.e., test)
- * programs to create.
- */
-class cmAddLibraryCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddLibraryCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddLibraryCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddLinkOptionsCommand.cxx b/Source/cmAddLinkOptionsCommand.cxx
index 10ebd12..7ed31bd 100644
--- a/Source/cmAddLinkOptionsCommand.cxx
+++ b/Source/cmAddLinkOptionsCommand.cxx
@@ -2,19 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddLinkOptionsCommand.h"
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
-class cmExecutionStatus;
-
-bool cmAddLinkOptionsCommand::InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus&)
+bool cmAddLinkOptionsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
- if (args.empty()) {
- return true;
- }
-
+ cmMakefile& mf = status.GetMakefile();
for (std::string const& i : args) {
- this->Makefile->AddLinkOption(i);
+ mf.AddLinkOption(i);
}
return true;
}
diff --git a/Source/cmAddLinkOptionsCommand.h b/Source/cmAddLinkOptionsCommand.h
index 8e46be6..466fc32 100644
--- a/Source/cmAddLinkOptionsCommand.h
+++ b/Source/cmAddLinkOptionsCommand.h
@@ -8,29 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-class cmAddLinkOptionsCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddLinkOptionsCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddLinkOptionsCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 7947188..50c682f 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -5,21 +5,20 @@
#include <sstream>
#include <string.h>
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmRange.h"
#include "cmSystemTools.h"
-class cmExecutionStatus;
-
-// cmAddSubDirectoryCommand
-bool cmAddSubDirectoryCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmAddSubDirectoryCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (args.empty()) {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
+ cmMakefile& mf = status.GetMakefile();
// store the binpath
std::string const& srcArg = args.front();
std::string binArg;
@@ -35,7 +34,7 @@ bool cmAddSubDirectoryCommand::InitialPass(
if (binArg.empty()) {
binArg = arg;
} else {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
}
@@ -46,7 +45,7 @@ bool cmAddSubDirectoryCommand::InitialPass(
if (cmSystemTools::FileIsFullPath(srcArg)) {
srcPath = srcArg;
} else {
- srcPath = this->Makefile->GetCurrentSourceDirectory();
+ srcPath = mf.GetCurrentSourceDirectory();
srcPath += "/";
srcPath += srcArg;
}
@@ -54,7 +53,7 @@ bool cmAddSubDirectoryCommand::InitialPass(
std::string error = "given source \"";
error += srcArg;
error += "\" which is not an existing directory.";
- this->SetError(error);
+ status.SetError(error);
return false;
}
srcPath = cmSystemTools::CollapseFullPath(srcPath);
@@ -65,22 +64,22 @@ bool cmAddSubDirectoryCommand::InitialPass(
// No binary directory was specified. If the source directory is
// not a subdirectory of the current directory then it is an
// error.
- if (!cmSystemTools::IsSubDirectory(
- srcPath, this->Makefile->GetCurrentSourceDirectory())) {
+ if (!cmSystemTools::IsSubDirectory(srcPath,
+ mf.GetCurrentSourceDirectory())) {
std::ostringstream e;
e << "not given a binary directory but the given source directory "
<< "\"" << srcPath << "\" is not a subdirectory of \""
- << this->Makefile->GetCurrentSourceDirectory() << "\". "
+ << mf.GetCurrentSourceDirectory() << "\". "
<< "When specifying an out-of-tree source a binary directory "
<< "must be explicitly specified.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
// Remove the CurrentDirectory from the srcPath and replace it
// with the CurrentOutputDirectory.
- const std::string& src = this->Makefile->GetCurrentSourceDirectory();
- const std::string& bin = this->Makefile->GetCurrentBinaryDirectory();
+ const std::string& src = mf.GetCurrentSourceDirectory();
+ const std::string& bin = mf.GetCurrentBinaryDirectory();
size_t srcLen = src.length();
size_t binLen = bin.length();
if (srcLen > 0 && src.back() == '/') {
@@ -96,7 +95,7 @@ bool cmAddSubDirectoryCommand::InitialPass(
if (cmSystemTools::FileIsFullPath(binArg)) {
binPath = binArg;
} else {
- binPath = this->Makefile->GetCurrentBinaryDirectory();
+ binPath = mf.GetCurrentBinaryDirectory();
binPath += "/";
binPath += binArg;
}
@@ -104,7 +103,7 @@ bool cmAddSubDirectoryCommand::InitialPass(
binPath = cmSystemTools::CollapseFullPath(binPath);
// Add the subdirectory using the computed full paths.
- this->Makefile->AddSubDirectory(srcPath, binPath, excludeFromAll, true);
+ mf.AddSubDirectory(srcPath, binPath, excludeFromAll, true);
return true;
}
diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h
index 664334e..87da840 100644
--- a/Source/cmAddSubDirectoryCommand.h
+++ b/Source/cmAddSubDirectoryCommand.h
@@ -8,36 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmAddSubDirectoryCommand
- * \brief Specify a subdirectory to build
- *
- * cmAddSubDirectoryCommand specifies a subdirectory to process
- * by CMake. CMake will descend
- * into the specified source directory and process any CMakeLists.txt found.
- */
-class cmAddSubDirectoryCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddSubDirectoryCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAddSubDirectoryCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index b0c462b..7904bf5 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -4,34 +4,36 @@
#include <sstream>
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmTest.h"
#include "cmTestGenerator.h"
-class cmExecutionStatus;
+static bool cmAddTestCommandHandleNameMode(
+ std::vector<std::string> const& args, cmExecutionStatus& status);
-// cmExecutableCommand
-bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus&)
+bool cmAddTestCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (!args.empty() && args[0] == "NAME") {
- return this->HandleNameMode(args);
+ return cmAddTestCommandHandleNameMode(args, status);
}
// First argument is the name of the test Second argument is the name of
// the executable to run (a target or external program) Remaining arguments
// are the arguments to pass to the executable
if (args.size() < 2) {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
+ cmMakefile& mf = status.GetMakefile();
// Collect the command with arguments.
std::vector<std::string> command(args.begin() + 1, args.end());
// Create the test but add a generator only the first time it is
// seen. This preserves behavior from before test generators.
- cmTest* test = this->Makefile->GetTest(args[0]);
+ cmTest* test = mf.GetTest(args[0]);
if (test) {
// If the test was already added by a new-style signature do not
// allow it to be duplicated.
@@ -39,20 +41,21 @@ bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args,
std::ostringstream e;
e << " given test name \"" << args[0]
<< "\" which already exists in this directory.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
} else {
- test = this->Makefile->CreateTest(args[0]);
+ test = mf.CreateTest(args[0]);
test->SetOldStyle(true);
- this->Makefile->AddTestGenerator(new cmTestGenerator(test));
+ mf.AddTestGenerator(new cmTestGenerator(test));
}
test->SetCommand(command);
return true;
}
-bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
+bool cmAddTestCommandHandleNameMode(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
std::string name;
std::vector<std::string> configurations;
@@ -73,25 +76,25 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
for (unsigned int i = 1; i < args.size(); ++i) {
if (args[i] == "COMMAND") {
if (!command.empty()) {
- this->SetError(" may be given at most one COMMAND.");
+ status.SetError(" may be given at most one COMMAND.");
return false;
}
doing = DoingCommand;
} else if (args[i] == "CONFIGURATIONS") {
if (!configurations.empty()) {
- this->SetError(" may be given at most one set of CONFIGURATIONS.");
+ status.SetError(" may be given at most one set of CONFIGURATIONS.");
return false;
}
doing = DoingConfigs;
} else if (args[i] == "WORKING_DIRECTORY") {
if (!working_directory.empty()) {
- this->SetError(" may be given at most one WORKING_DIRECTORY.");
+ status.SetError(" may be given at most one WORKING_DIRECTORY.");
return false;
}
doing = DoingWorkingDirectory;
} else if (args[i] == "COMMAND_EXPAND_LISTS") {
if (command_expand_lists) {
- this->SetError(" may be given at most one COMMAND_EXPAND_LISTS.");
+ status.SetError(" may be given at most one COMMAND_EXPAND_LISTS.");
return false;
}
command_expand_lists = true;
@@ -109,41 +112,43 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
} else {
std::ostringstream e;
e << " given unknown argument:\n " << args[i] << "\n";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
}
// Require a test name.
if (name.empty()) {
- this->SetError(" must be given non-empty NAME.");
+ status.SetError(" must be given non-empty NAME.");
return false;
}
// Require a command.
if (command.empty()) {
- this->SetError(" must be given non-empty COMMAND.");
+ status.SetError(" must be given non-empty COMMAND.");
return false;
}
+ cmMakefile& mf = status.GetMakefile();
+
// Require a unique test name within the directory.
- if (this->Makefile->GetTest(name)) {
+ if (mf.GetTest(name)) {
std::ostringstream e;
e << " given test NAME \"" << name
<< "\" which already exists in this directory.";
- this->SetError(e.str());
+ status.SetError(e.str());
return false;
}
// Add the test.
- cmTest* test = this->Makefile->CreateTest(name);
+ cmTest* test = mf.CreateTest(name);
test->SetOldStyle(false);
test->SetCommand(command);
if (!working_directory.empty()) {
test->SetProperty("WORKING_DIRECTORY", working_directory.c_str());
}
test->SetCommandExpandLists(command_expand_lists);
- this->Makefile->AddTestGenerator(new cmTestGenerator(test, configurations));
+ mf.AddTestGenerator(new cmTestGenerator(test, configurations));
return true;
}
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index 3d37d2b..5877547 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -8,37 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmAddTestCommand
- * \brief Add a test to the lists of tests to run.
- *
- * cmAddTestCommand adds a test to the list of tests to run .
- */
-class cmAddTestCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAddTestCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-
-private:
- bool HandleNameMode(std::vector<std::string> const& args);
-};
+bool cmAddTestCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index 9ea88d3..e90a603 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -9,7 +9,7 @@
#include <stddef.h>
#include <string>
-#if !defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(CMAKE_BOOTSTRAP)
# error "cmArchiveWrite not allowed during bootstrap build!"
#endif
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index 45c6411..83199b4 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -7,28 +7,27 @@
#include <stddef.h>
#include <utility>
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
-class cmExecutionStatus;
-
-// cmAuxSourceDirectoryCommand
-bool cmAuxSourceDirectoryCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmAuxSourceDirectoryCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
if (args.size() != 2) {
- this->SetError("called with incorrect number of arguments");
+ status.SetError("called with incorrect number of arguments");
return false;
}
+ cmMakefile& mf = status.GetMakefile();
std::string sourceListValue;
std::string const& templateDirectory = args[0];
std::string tdir;
if (!cmSystemTools::FileIsFullPath(templateDirectory)) {
- tdir = this->Makefile->GetCurrentSourceDirectory();
+ tdir = mf.GetCurrentSourceDirectory();
tdir += "/";
tdir += templateDirectory;
} else {
@@ -36,7 +35,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass(
}
// was the list already populated
- const char* def = this->Makefile->GetDefinition(args[1]);
+ const char* def = mf.GetDefinition(args[1]);
if (def) {
sourceListValue = def;
}
@@ -55,14 +54,14 @@ bool cmAuxSourceDirectoryCommand::InitialPass(
std::string ext = file.substr(dotpos + 1);
std::string base = file.substr(0, dotpos);
// Process only source files
- auto cm = this->Makefile->GetCMakeInstance();
+ auto cm = mf.GetCMakeInstance();
if (!base.empty() && cm->IsSourceExtension(ext)) {
std::string fullname = templateDirectory;
fullname += "/";
fullname += file;
// add the file as a class file so
// depends can be done
- cmSourceFile* sf = this->Makefile->GetOrCreateSource(fullname);
+ cmSourceFile* sf = mf.GetOrCreateSource(fullname);
sf->SetProperty("ABSTRACT", "0");
files.push_back(std::move(fullname));
}
@@ -74,6 +73,6 @@ bool cmAuxSourceDirectoryCommand::InitialPass(
sourceListValue += ";";
}
sourceListValue += cmJoin(files, ";");
- this->Makefile->AddDefinition(args[1], sourceListValue);
+ mf.AddDefinition(args[1], sourceListValue);
return true;
}
diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h
index 973a464..ae26092 100644
--- a/Source/cmAuxSourceDirectoryCommand.h
+++ b/Source/cmAuxSourceDirectoryCommand.h
@@ -8,38 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmAuxSourceDirectoryCommand
- * \brief Specify auxiliary source code directories.
- *
- * cmAuxSourceDirectoryCommand specifies source code directories
- * that must be built as part of this build process. This directories
- * are not recursively processed like the SUBDIR command (cmSubdirCommand).
- * A side effect of this command is to create a subdirectory in the build
- * directory structure.
- */
-class cmAuxSourceDirectoryCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmAuxSourceDirectoryCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmAuxSourceDirectoryCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 80ca898..d06ec20 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -608,7 +608,7 @@ int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)
if (cmSourceFile* rsf = sf->RealSourceFile) {
return rsf->GetPropertyAsBool(prop) ? 1 : 0;
}
- return cmSystemTools::IsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
+ return cmIsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
}
void CCONV cmSourceFileSetProperty(void* arg, const char* prop,
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 026250d..e7a16b5 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -323,12 +323,11 @@ cmCTest::cmCTest()
{
std::string envValue;
if (cmSystemTools::GetEnv("CTEST_OUTPUT_ON_FAILURE", envValue)) {
- this->Impl->OutputTestOutputOnTestFailure =
- !cmSystemTools::IsOff(envValue);
+ this->Impl->OutputTestOutputOnTestFailure = !cmIsOff(envValue);
}
envValue.clear();
if (cmSystemTools::GetEnv("CTEST_PROGRESS_OUTPUT", envValue)) {
- this->Impl->TestProgressOutput = !cmSystemTools::IsOff(envValue);
+ this->Impl->TestProgressOutput = !cmIsOff(envValue);
}
this->Impl->Parts[PartStart].SetName("Start");
@@ -754,7 +753,7 @@ bool cmCTest::UpdateCTestConfiguration()
std::string const& testLoad = this->GetCTestConfiguration("TestLoad");
if (!testLoad.empty()) {
unsigned long load;
- if (cmSystemTools::StringToULong(testLoad.c_str(), &load)) {
+ if (cmStrToULong(testLoad, &load)) {
this->SetTestLoad(load);
} else {
cmCTestLog(this, WARNING,
@@ -763,7 +762,7 @@ bool cmCTest::UpdateCTestConfiguration()
}
if (this->Impl->ProduceXML) {
this->Impl->CompressXMLFiles =
- cmSystemTools::IsOn(this->GetCTestConfiguration("CompressSubmission"));
+ cmIsOn(this->GetCTestConfiguration("CompressSubmission"));
}
return true;
}
@@ -1454,7 +1453,7 @@ void cmCTest::AddSiteProperties(cmXMLWriter& xml)
xml.StartElement("Labels");
std::string l = labels;
std::vector<std::string> args;
- cmSystemTools::ExpandListArgument(l, args);
+ cmExpandList(l, args);
for (std::string const& i : args) {
xml.Element("Label", i);
}
@@ -1487,7 +1486,7 @@ std::vector<std::string> cmCTest::GetLabelsForSubprojects()
std::string labelsForSubprojects =
this->GetCTestConfiguration("LabelsForSubprojects");
std::vector<std::string> subprojects;
- cmSystemTools::ExpandListArgument(labelsForSubprojects, subprojects);
+ cmExpandList(labelsForSubprojects, subprojects);
// sort the array
std::sort(subprojects.begin(), subprojects.end());
@@ -1854,7 +1853,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
}
i++;
long repeat = 1;
- if (!cmSystemTools::StringToLong(args[i].c_str(), &repeat)) {
+ if (!cmStrToLong(args[i], &repeat)) {
errormsg =
"'--repeat-until-fail' given non-integer value '" + args[i] + "'";
return false;
@@ -1868,7 +1867,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "--test-load") && i < args.size() - 1) {
i++;
unsigned long load;
- if (cmSystemTools::StringToULong(args[i].c_str(), &load)) {
+ if (cmStrToULong(args[i], &load)) {
this->SetTestLoad(load);
} else {
cmCTestLog(this, WARNING,
@@ -1942,7 +1941,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
i < args.size() - 1) {
i++;
long outputSize;
- if (cmSystemTools::StringToLong(args[i].c_str(), &outputSize)) {
+ if (cmStrToLong(args[i], &outputSize)) {
this->Impl->TestHandler.SetTestOutputSizePassed(int(outputSize));
} else {
cmCTestLog(this, WARNING,
@@ -1954,7 +1953,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
i < args.size() - 1) {
i++;
long outputSize;
- if (cmSystemTools::StringToLong(args[i].c_str(), &outputSize)) {
+ if (cmStrToLong(args[i], &outputSize)) {
this->Impl->TestHandler.SetTestOutputSizeFailed(int(outputSize));
} else {
cmCTestLog(this, WARNING,
@@ -2001,7 +2000,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "--interactive-debug-mode") &&
i < args.size() - 1) {
i++;
- this->Impl->InteractiveDebugMode = cmSystemTools::IsOn(args[i]);
+ this->Impl->InteractiveDebugMode = cmIsOn(args[i]);
}
if (this->CheckArgument(arg, "--submit-index") && i < args.size() - 1) {
i++;
@@ -2423,7 +2422,7 @@ int cmCTest::RunCMakeAndTest(std::string* output)
cmCTestBuildAndTestHandler* handler = this->GetBuildAndTestHandler();
int retv = handler->ProcessHandler();
*output = handler->GetOutput();
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmDynamicLoader::FlushCache();
#endif
if (retv != 0) {
@@ -2565,7 +2564,7 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
cmCTestLog(this, DEBUG, "PopulateCustomVector: " << def << std::endl);
vec.clear();
- cmSystemTools::ExpandListArgument(dval, vec);
+ cmExpandList(dval, vec);
for (std::string const& it : vec) {
cmCTestLog(this, DEBUG, " -- " << it << std::endl);
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index e8fc350..6b61f1b 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -14,6 +14,7 @@
#include "cmMessageType.h"
#include "cmMessenger.h"
#include "cmState.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
@@ -26,8 +27,7 @@ cmCacheManager::cmCacheManager()
void cmCacheManager::CleanCMakeFiles(const std::string& path)
{
std::string glob = path;
- glob += "/CMakeFiles";
- glob += "/*.cmake";
+ glob += "/CMakeFiles/*.cmake";
cmsys::Glob globIt;
globIt.FindFiles(glob);
std::vector<std::string> files = globIt.GetFiles();
@@ -552,7 +552,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, const char* value,
if (type == cmStateEnums::FILEPATH || type == cmStateEnums::PATH) {
if (e.Value.find(';') != std::string::npos) {
std::vector<std::string> paths;
- cmSystemTools::ExpandListArgument(e.Value, paths);
+ cmExpandList(e.Value, paths);
const char* sep = "";
e.Value = "";
for (std::string& i : paths) {
@@ -615,7 +615,7 @@ void cmCacheManager::CacheIterator::SetValue(const char* value)
bool cmCacheManager::CacheIterator::GetValueAsBool() const
{
- return cmSystemTools::IsOn(this->GetEntry().Value);
+ return cmIsOn(this->GetEntry().Value);
}
std::vector<std::string> cmCacheManager::CacheEntry::GetPropertyList() const
@@ -695,7 +695,7 @@ bool cmCacheManager::CacheIterator::GetPropertyAsBool(
const std::string& prop) const
{
if (const char* value = this->GetProperty(prop)) {
- return cmSystemTools::IsOn(value);
+ return cmIsOn(value);
}
return false;
}
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index a9be445..8565e1c 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -84,7 +84,7 @@
#include "cmUnsetCommand.h"
#include "cmWhileCommand.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmAddCompileOptionsCommand.h"
# include "cmAddLinkOptionsCommand.h"
# include "cmAuxSourceDirectoryCommand.h"
@@ -210,7 +210,7 @@ void GetScriptingCommands(cmState* state)
"WHILE ENDWHILE structure. Or its arguments did not "
"match the opening WHILE command.");
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
state->AddBuiltinCommand(
"cmake_host_system_information",
cm::make_unique<cmCMakeHostSystemInformationCommand>());
@@ -233,21 +233,14 @@ void GetScriptingCommands(cmState* state)
void GetProjectCommands(cmState* state)
{
- state->AddBuiltinCommand("add_custom_command",
- cm::make_unique<cmAddCustomCommandCommand>());
- state->AddBuiltinCommand("add_custom_target",
- cm::make_unique<cmAddCustomTargetCommand>());
- state->AddBuiltinCommand("add_definitions",
- cm::make_unique<cmAddDefinitionsCommand>());
- state->AddBuiltinCommand("add_dependencies",
- cm::make_unique<cmAddDependenciesCommand>());
- state->AddBuiltinCommand("add_executable",
- cm::make_unique<cmAddExecutableCommand>());
- state->AddBuiltinCommand("add_library",
- cm::make_unique<cmAddLibraryCommand>());
- state->AddBuiltinCommand("add_subdirectory",
- cm::make_unique<cmAddSubDirectoryCommand>());
- state->AddBuiltinCommand("add_test", cm::make_unique<cmAddTestCommand>());
+ state->AddBuiltinCommand("add_custom_command", cmAddCustomCommandCommand);
+ state->AddBuiltinCommand("add_custom_target", cmAddCustomTargetCommand);
+ state->AddBuiltinCommand("add_definitions", cmAddDefinitionsCommand);
+ state->AddBuiltinCommand("add_dependencies", cmAddDependenciesCommand);
+ state->AddBuiltinCommand("add_executable", cmAddExecutableCommand);
+ state->AddBuiltinCommand("add_library", cmAddLibraryCommand);
+ state->AddBuiltinCommand("add_subdirectory", cmAddSubDirectoryCommand);
+ state->AddBuiltinCommand("add_test", cmAddTestCommand);
state->AddBuiltinCommand("build_command", cm::make_unique<cmBuildCommand>());
state->AddBuiltinCommand("create_test_sourcelist",
cm::make_unique<cmCreateTestSourceList>());
@@ -301,13 +294,12 @@ void GetProjectCommands(cmState* state)
cm::make_unique<cmTryCompileCommand>());
state->AddBuiltinCommand("try_run", cm::make_unique<cmTryRunCommand>());
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
state->AddBuiltinCommand("add_compile_definitions",
- cm::make_unique<cmAddCompileDefinitionsCommand>());
- state->AddBuiltinCommand("add_compile_options",
- cm::make_unique<cmAddCompileOptionsCommand>());
+ cmAddCompileDefinitionsCommand);
+ state->AddBuiltinCommand("add_compile_options", cmAddCompileOptionsCommand);
state->AddBuiltinCommand("aux_source_directory",
- cm::make_unique<cmAuxSourceDirectoryCommand>());
+ cmAuxSourceDirectoryCommand);
state->AddBuiltinCommand("export", cm::make_unique<cmExportCommand>());
state->AddBuiltinCommand("fltk_wrap_ui",
cm::make_unique<cmFLTKWrapUICommand>());
@@ -316,8 +308,7 @@ void GetProjectCommands(cmState* state)
cm::make_unique<cmIncludeExternalMSProjectCommand>());
state->AddBuiltinCommand("install_programs",
cm::make_unique<cmInstallProgramsCommand>());
- state->AddBuiltinCommand("add_link_options",
- cm::make_unique<cmAddLinkOptionsCommand>());
+ state->AddBuiltinCommand("add_link_options", cmAddLinkOptionsCommand);
state->AddBuiltinCommand("link_libraries",
cm::make_unique<cmLinkLibrariesCommand>());
state->AddBuiltinCommand("target_link_options",
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index f8b78b4..a187f99 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -12,7 +12,6 @@
#include "cmRange.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
@@ -439,7 +438,7 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
// <item>_LIB_DEPENDS. The variable contains a semicolon-separated
// list. The list contains link-type;item pairs and just items.
std::vector<std::string> deplist;
- cmSystemTools::ExpandListArgument(value, deplist);
+ cmExpandList(value, deplist);
// Look for entries meant for this configuration.
std::vector<cmLinkItem> actual_libs;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 4aa18f2..4273383 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -285,8 +285,13 @@ cmComputeLinkInformation::cmComputeLinkInformation(
}
// Get options needed to link libraries.
- this->LibLinkFlag =
- this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FLAG");
+ if (const char* flag = this->Makefile->GetDefinition(
+ "CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_FLAG")) {
+ this->LibLinkFlag = flag;
+ } else {
+ this->LibLinkFlag =
+ this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FLAG");
+ }
this->LibLinkFileFlag =
this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FILE_FLAG");
this->LibLinkSuffix =
@@ -475,7 +480,7 @@ bool cmComputeLinkInformation::Compute()
// Restore the target link type so the correct system runtime
// libraries are found.
const char* lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
- if (cmSystemTools::IsOn(lss)) {
+ if (cmIsOn(lss)) {
this->SetCurrentLinkType(LinkStatic);
} else {
this->SetCurrentLinkType(this->StartLinkType);
@@ -546,7 +551,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
libVar += "_IMPLICIT_LINK_LIBRARIES";
if (const char* libs = this->Makefile->GetDefinition(libVar)) {
std::vector<std::string> libsVec;
- cmSystemTools::ExpandListArgument(libs, libsVec);
+ cmExpandList(libs, libsVec);
for (std::string const& i : libsVec) {
if (this->ImplicitLinkLibs.find(i) == this->ImplicitLinkLibs.end()) {
this->AddItem(i, nullptr);
@@ -561,7 +566,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
dirVar += "_IMPLICIT_LINK_DIRECTORIES";
if (const char* dirs = this->Makefile->GetDefinition(dirVar)) {
std::vector<std::string> dirsVec;
- cmSystemTools::ExpandListArgument(dirs, dirsVec);
+ cmExpandList(dirs, dirsVec);
this->OrderLinkerSearchPath->AddLanguageDirectories(dirsVec);
}
}
@@ -782,7 +787,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
// Lookup the starting link type from the target (linked statically?).
const char* lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
- this->StartLinkType = cmSystemTools::IsOn(lss) ? LinkStatic : LinkShared;
+ this->StartLinkType = cmIsOn(lss) ? LinkStatic : LinkShared;
this->CurrentLinkType = this->StartLinkType;
}
@@ -806,7 +811,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
if (const char* linkSuffixes =
mf->GetDefinition("CMAKE_EXTRA_LINK_EXTENSIONS")) {
std::vector<std::string> linkSuffixVec;
- cmSystemTools::ExpandListArgument(linkSuffixes, linkSuffixVec);
+ cmExpandList(linkSuffixes, linkSuffixVec);
for (std::string const& i : linkSuffixVec) {
this->AddLinkExtension(i.c_str(), LinkUnknown);
}
@@ -814,7 +819,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
if (const char* sharedSuffixes =
mf->GetDefinition("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES")) {
std::vector<std::string> sharedSuffixVec;
- cmSystemTools::ExpandListArgument(sharedSuffixes, sharedSuffixVec);
+ cmExpandList(sharedSuffixes, sharedSuffixVec);
for (std::string const& i : sharedSuffixVec) {
this->AddLinkExtension(i.c_str(), LinkShared);
}
@@ -1283,7 +1288,7 @@ void cmComputeLinkInformation::ComputeFrameworkInfo()
// Get platform-wide implicit directories.
if (const char* implicitLinks = this->Makefile->GetDefinition(
"CMAKE_PLATFORM_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES")) {
- cmSystemTools::ExpandListArgument(implicitLinks, implicitDirVec);
+ cmExpandList(implicitLinks, implicitDirVec);
}
// Get language-specific implicit directories.
@@ -1292,7 +1297,7 @@ void cmComputeLinkInformation::ComputeFrameworkInfo()
implicitDirVar += "_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES";
if (const char* implicitDirs =
this->Makefile->GetDefinition(implicitDirVar)) {
- cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec);
+ cmExpandList(implicitDirs, implicitDirVec);
}
this->FrameworkPathsEmmitted.insert(implicitDirVec.begin(),
@@ -1511,7 +1516,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
// Get platform-wide implicit directories.
if (const char* implicitLinks = (this->Makefile->GetDefinition(
"CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES"))) {
- cmSystemTools::ExpandListArgument(implicitLinks, implicitDirVec);
+ cmExpandList(implicitLinks, implicitDirVec);
}
// Append library architecture to all implicit platform directories
@@ -1529,7 +1534,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
implicitDirVar += "_IMPLICIT_LINK_DIRECTORIES";
if (const char* implicitDirs =
this->Makefile->GetDefinition(implicitDirVar)) {
- cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec);
+ cmExpandList(implicitDirs, implicitDirVec);
}
// Store implicit link directories.
@@ -1542,7 +1547,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
implicitLibVar += "_IMPLICIT_LINK_LIBRARIES";
if (const char* implicitLibs =
this->Makefile->GetDefinition(implicitLibVar)) {
- cmSystemTools::ExpandListArgument(implicitLibs, implicitLibVec);
+ cmExpandList(implicitLibs, implicitLibVec);
}
// Store implicit link libraries.
@@ -1557,7 +1562,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
// Get platform specific rpath link directories
if (const char* rpathDirs =
(this->Makefile->GetDefinition("CMAKE_PLATFORM_RUNTIME_PATH"))) {
- cmSystemTools::ExpandListArgument(rpathDirs, this->RuntimeLinkDirs);
+ cmExpandList(rpathDirs, this->RuntimeLinkDirs);
}
}
@@ -1664,7 +1669,7 @@ static void cmCLI_ExpandListUnique(const char* str,
std::set<std::string>& emitted)
{
std::vector<std::string> tmp;
- cmSystemTools::ExpandListArgument(str, tmp);
+ cmExpandList(str, tmp);
for (std::string const& i : tmp) {
if (emitted.insert(i).second) {
out.push_back(i);
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 5b88807..3de3253 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -220,10 +220,10 @@ bool cmConditionEvaluator::GetBooleanValue(
}
// Check named constants.
- if (cmSystemTools::IsOn(arg.c_str())) {
+ if (cmIsOn(arg.GetValue())) {
return true;
}
- if (cmSystemTools::IsOff(arg.c_str())) {
+ if (cmIsOff(arg.GetValue())) {
return false;
}
@@ -239,7 +239,7 @@ bool cmConditionEvaluator::GetBooleanValue(
// Check definition.
const char* def = this->GetDefinitionIfUnquoted(arg);
- return !cmSystemTools::IsOff(def);
+ return !cmIsOff(def);
}
//=========================================================================
@@ -256,14 +256,14 @@ bool cmConditionEvaluator::GetBooleanValueOld(
return true;
}
const char* def = this->GetDefinitionIfUnquoted(arg);
- return !cmSystemTools::IsOff(def);
+ return !cmIsOff(def);
}
// Old GetVariableOrNumber behavior.
const char* def = this->GetDefinitionIfUnquoted(arg);
if (!def && atoi(arg.c_str())) {
def = arg.c_str();
}
- return !cmSystemTools::IsOff(def);
+ return !cmIsOff(def);
}
//=========================================================================
@@ -670,7 +670,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
if (def2) {
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(def2, list, true);
+ cmExpandList(def2, list, true);
result = std::find(list.begin(), list.end(), def) != list.end();
}
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 85ff0a6..e5e1ecf 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -234,7 +234,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
} else if (doing == DoingCMakeFlags) {
cmakeFlags.push_back(argv[i]);
} else if (doing == DoingCompileDefinitions) {
- cmSystemTools::ExpandListArgument(argv[i], compileDefs);
+ cmExpandList(argv[i], compileDefs);
} else if (doing == DoingLinkOptions) {
linkOptions.push_back(argv[i]);
} else if (doing == DoingLinkLibraries) {
@@ -411,8 +411,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
// compute the binary dir when TRY_COMPILE is called with a src file
// signature
if (this->SrcFileSignature) {
- this->BinaryDirectory += "/CMakeFiles";
- this->BinaryDirectory += "/CMakeTmp";
+ this->BinaryDirectory += "/CMakeFiles/CMakeTmp";
} else {
// only valid for srcfile signatures
if (!compileDefs.empty()) {
@@ -676,7 +675,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
if (const char* varListStr = this->Makefile->GetDefinition(
kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES)) {
std::vector<std::string> varList;
- cmSystemTools::ExpandListArgument(varListStr, varList);
+ cmExpandList(varListStr, varList);
vars.insert(varList.begin(), varList.end());
}
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index 5e919af..f9f9581 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -6,8 +6,6 @@
#include "cm_rhash.h"
#include "cmsys/FStream.hxx"
-#include <string.h>
-
#include "cm_memory.hxx"
static unsigned int const cmCryptoHashAlgoToId[] = {
@@ -46,36 +44,36 @@ cmCryptoHash::~cmCryptoHash()
rhash_free(this->CTX);
}
-std::unique_ptr<cmCryptoHash> cmCryptoHash::New(const char* algo)
+std::unique_ptr<cmCryptoHash> cmCryptoHash::New(cm::string_view algo)
{
- if (strcmp(algo, "MD5") == 0) {
+ if (algo == "MD5") {
return cm::make_unique<cmCryptoHash>(AlgoMD5);
}
- if (strcmp(algo, "SHA1") == 0) {
+ if (algo == "SHA1") {
return cm::make_unique<cmCryptoHash>(AlgoSHA1);
}
- if (strcmp(algo, "SHA224") == 0) {
+ if (algo == "SHA224") {
return cm::make_unique<cmCryptoHash>(AlgoSHA224);
}
- if (strcmp(algo, "SHA256") == 0) {
+ if (algo == "SHA256") {
return cm::make_unique<cmCryptoHash>(AlgoSHA256);
}
- if (strcmp(algo, "SHA384") == 0) {
+ if (algo == "SHA384") {
return cm::make_unique<cmCryptoHash>(AlgoSHA384);
}
- if (strcmp(algo, "SHA512") == 0) {
+ if (algo == "SHA512") {
return cm::make_unique<cmCryptoHash>(AlgoSHA512);
}
- if (strcmp(algo, "SHA3_224") == 0) {
+ if (algo == "SHA3_224") {
return cm::make_unique<cmCryptoHash>(AlgoSHA3_224);
}
- if (strcmp(algo, "SHA3_256") == 0) {
+ if (algo == "SHA3_256") {
return cm::make_unique<cmCryptoHash>(AlgoSHA3_256);
}
- if (strcmp(algo, "SHA3_384") == 0) {
+ if (algo == "SHA3_384") {
return cm::make_unique<cmCryptoHash>(AlgoSHA3_384);
}
- if (strcmp(algo, "SHA3_512") == 0) {
+ if (algo == "SHA3_512") {
return cm::make_unique<cmCryptoHash>(AlgoSHA3_512);
}
return std::unique_ptr<cmCryptoHash>(nullptr);
@@ -106,6 +104,7 @@ std::string cmCryptoHash::ByteHashToString(
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
std::string res;
+ res.reserve(hash.size() * 2);
for (unsigned char v : hash) {
res.push_back(hex[v >> 4]);
res.push_back(hex[v & 0xF]);
@@ -113,12 +112,10 @@ std::string cmCryptoHash::ByteHashToString(
return res;
}
-std::vector<unsigned char> cmCryptoHash::ByteHashString(
- const std::string& input)
+std::vector<unsigned char> cmCryptoHash::ByteHashString(cm::string_view input)
{
this->Initialize();
- this->Append(reinterpret_cast<unsigned char const*>(input.c_str()),
- static_cast<int>(input.size()));
+ this->Append(input);
return this->Finalize();
}
@@ -156,7 +153,7 @@ std::vector<unsigned char> cmCryptoHash::ByteHashFile(const std::string& file)
return std::vector<unsigned char>();
}
-std::string cmCryptoHash::HashString(const std::string& input)
+std::string cmCryptoHash::HashString(cm::string_view input)
{
return ByteHashToString(this->ByteHashString(input));
}
@@ -176,9 +173,9 @@ void cmCryptoHash::Append(void const* buf, size_t sz)
rhash_update(this->CTX, buf, sz);
}
-void cmCryptoHash::Append(std::string const& str)
+void cmCryptoHash::Append(cm::string_view input)
{
- this->Append(str.c_str(), str.size());
+ rhash_update(this->CTX, input.data(), input.size());
}
std::vector<unsigned char> cmCryptoHash::Finalize()
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index c7d3377..681f5cc 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -5,6 +5,8 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include "cm_string_view.hxx"
+
#include <memory>
#include <stddef.h>
#include <string>
@@ -42,7 +44,7 @@ public:
/// SHA3_224, SHA3_256, SHA3_384, SHA3_512
/// @return A valid auto pointer if algo is supported or
/// an invalid/NULL pointer otherwise
- static std::unique_ptr<cmCryptoHash> New(const char* algo);
+ static std::unique_ptr<cmCryptoHash> New(cm::string_view algo);
/// @brief Converts a hex character to its binary value (4 bits)
/// @arg input Hex character [0-9a-fA-F].
@@ -55,7 +57,7 @@ public:
/// @brief Calculates a binary hash from string input data
/// @return Binary hash vector
- std::vector<unsigned char> ByteHashString(const std::string& input);
+ std::vector<unsigned char> ByteHashString(cm::string_view input);
/// @brief Calculates a binary hash from file content
/// @see ByteHashString()
@@ -65,7 +67,7 @@ public:
/// @brief Calculates a hash string from string input data
/// @return Sequence of hex characters pairs for each byte of the binary hash
- std::string HashString(const std::string& input);
+ std::string HashString(cm::string_view input);
/// @brief Calculates a hash string from file content
/// @see HashString()
@@ -75,7 +77,7 @@ public:
void Initialize();
void Append(void const*, size_t);
- void Append(std::string const& str);
+ void Append(cm::string_view input);
std::vector<unsigned char> Finalize();
std::string FinalizeHex();
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 758a69a..20f0ef2 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -10,6 +10,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include <memory>
@@ -35,7 +36,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
this->GE->Parse(clarg);
std::string parsed_arg = cge->Evaluate(this->LG, this->Config);
if (this->CC.GetCommandExpandLists()) {
- cmAppend(argv, cmSystemTools::ExpandedListArgument(parsed_arg));
+ cmAppend(argv, cmExpandedList(parsed_arg));
} else {
argv.push_back(std::move(parsed_arg));
}
@@ -54,8 +55,8 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
std::vector<std::string> depends = this->CC.GetDepends();
for (std::string const& d : depends) {
std::unique_ptr<cmCompiledGeneratorExpression> cge = this->GE->Parse(d);
- std::vector<std::string> result = cmSystemTools::ExpandedListArgument(
- cge->Evaluate(this->LG, this->Config));
+ std::vector<std::string> result =
+ cmExpandedList(cge->Evaluate(this->LG, this->Config));
for (std::string& it : result) {
if (cmSystemTools::FileIsFullPath(it)) {
it = cmSystemTools::CollapseFullPath(it);
@@ -108,8 +109,7 @@ void cmCustomCommandGenerator::FillEmulatorsWithArguments()
continue;
}
- cmSystemTools::ExpandListArgument(emulator_property,
- this->EmulatorsWithArguments[c]);
+ cmExpandList(emulator_property, this->EmulatorsWithArguments[c]);
}
}
}
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index ed76dbf..6623d94 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -7,6 +7,7 @@
#include "cmGeneratedFileStream.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmsys/FStream.hxx"
@@ -30,7 +31,7 @@ bool cmDepends::Write(std::ostream& makeDepends, std::ostream& internalDepends)
{
std::string const srcLang = "CMAKE_DEPENDS_CHECK_" + this->Language;
cmMakefile* mf = this->LocalGenerator->GetMakefile();
- cmSystemTools::ExpandListArgument(mf->GetSafeDefinition(srcLang), pairs);
+ cmExpandList(mf->GetSafeDefinition(srcLang), pairs);
}
for (std::vector<std::string>::iterator si = pairs.begin();
si != pairs.end();) {
@@ -241,7 +242,7 @@ void cmDepends::SetIncludePathFromLanguage(const std::string& lang)
cmMakefile* mf = this->LocalGenerator->GetMakefile();
includePath = mf->GetDefinition(includePathVar);
if (includePath) {
- cmSystemTools::ExpandListArgument(includePath, this->IncludePath);
+ cmExpandList(includePath, this->IncludePath);
} else {
// Fallback to the old directory level variable if no per-target var:
includePathVar = "CMAKE_";
@@ -249,7 +250,7 @@ void cmDepends::SetIncludePathFromLanguage(const std::string& lang)
includePathVar += "_INCLUDE_PATH";
includePath = mf->GetDefinition(includePathVar);
if (includePath) {
- cmSystemTools::ExpandListArgument(includePath, this->IncludePath);
+ cmExpandList(includePath, this->IncludePath);
}
}
}
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index dc49c18..6eefe82 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -9,6 +9,7 @@
#include "cmFileTime.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#define INCLUDE_REGEX_LINE \
@@ -391,7 +392,7 @@ void cmDependsC::SetupTransforms()
std::vector<std::string> transformRules;
cmMakefile* mf = this->LocalGenerator->GetMakefile();
if (const char* xform = mf->GetDefinition("CMAKE_INCLUDE_TRANSFORMS")) {
- cmSystemTools::ExpandListArgument(xform, transformRules, true);
+ cmExpandList(xform, transformRules, true);
}
for (std::string const& tr : transformRules) {
this->ParseTransform(tr);
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 764ba30..63d1c4d 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -82,7 +82,7 @@ cmDependsFortran::cmDependsFortran(cmLocalGenerator* lg)
cmMakefile* mf = this->LocalGenerator->GetMakefile();
if (const char* c_defines =
mf->GetDefinition("CMAKE_TARGET_DEFINITIONS_Fortran")) {
- cmSystemTools::ExpandListArgument(c_defines, definitions);
+ cmExpandList(c_defines, definitions);
}
// translate i.e. FOO=BAR to FOO and add it to the list of defined
@@ -254,7 +254,7 @@ void cmDependsFortran::LocateModules()
std::vector<std::string> infoFiles;
if (const char* infoFilesValue =
mf->GetDefinition("CMAKE_TARGET_LINKED_INFO_FILES")) {
- cmSystemTools::ExpandListArgument(infoFilesValue, infoFiles);
+ cmExpandList(infoFilesValue, infoFiles);
}
for (std::string const& i : infoFiles) {
std::string targetDir = cmSystemTools::GetFilenamePath(i);
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index 5edf7ca..22cc0bc 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -145,7 +145,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
} else if (property.first == "INTERFACE_INCLUDE_DIRECTORIES") {
std::string includes = property.second;
std::vector<std::string> includeList;
- cmSystemTools::ExpandListArgument(includes, includeList);
+ cmExpandList(includes, includeList);
os << "LOCAL_EXPORT_C_INCLUDES := ";
std::string end;
for (std::string const& i : includeList) {
@@ -156,7 +156,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
} else if (property.first == "INTERFACE_LINK_OPTIONS") {
os << "LOCAL_EXPORT_LDFLAGS := ";
std::vector<std::string> linkFlagsList;
- cmSystemTools::ExpandListArgument(property.second, linkFlagsList);
+ cmExpandList(property.second, linkFlagsList);
os << cmJoin(linkFlagsList, " ") << "\n";
} else {
os << "# " << property.first << " " << (property.second) << "\n";
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 87f9b4c..35d8668 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -500,7 +500,7 @@ void getPropertyContents(cmGeneratorTarget const* tgt, const std::string& prop,
return;
}
std::vector<std::string> content;
- cmSystemTools::ExpandListArgument(p, content);
+ cmExpandList(p, content);
ifaceProperties.insert(content.begin(), content.end());
}
@@ -1207,7 +1207,7 @@ bool cmExportFileGenerator::PopulateExportProperties(
auto& targetProperties = gte->Target->GetProperties();
if (const char* exportProperties =
targetProperties.GetPropertyValue("EXPORT_PROPERTIES")) {
- for (auto& prop : cmSystemTools::ExpandedListArgument(exportProperties)) {
+ for (auto& prop : cmExpandedList(exportProperties)) {
/* Black list reserved properties */
if (cmHasLiteralPrefix(prop, "IMPORTED_") ||
cmHasLiteralPrefix(prop, "INTERFACE_")) {
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index a3c9802..f77fd3a 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -9,7 +9,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmStateTypes.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
#include "cmTarget.h"
#include <map>
@@ -104,7 +104,7 @@ void cmExportTryCompileFileGenerator::PopulateProperties(
this->FindTargets(p, target, std::string(), emitted);
std::vector<std::string> depends;
- cmSystemTools::ExpandListArgument(evalResult, depends);
+ cmExpandList(evalResult, depends);
for (std::string const& li : depends) {
cmGeneratorTarget* tgt =
target->GetLocalGenerator()->FindGeneratorTargetToUse(li);
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 4146db8..79ecf45 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -235,7 +235,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// Also we can disable external (outside the project) files by setting ON
// CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES variable.
const bool excludeExternal =
- cmSystemTools::IsOn(it.second[0]->GetMakefile()->GetSafeDefinition(
+ cmIsOn(it.second[0]->GetMakefile()->GetSafeDefinition(
"CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES"));
if (!splitted.empty() &&
(!excludeExternal || (relative.find("..") == std::string::npos)) &&
@@ -381,7 +381,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// Do not add this file if it has ".." in relative path and
// if CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES variable is on.
const bool excludeExternal =
- cmSystemTools::IsOn(lg->GetMakefile()->GetSafeDefinition(
+ cmIsOn(lg->GetMakefile()->GetSafeDefinition(
"CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES"));
if (excludeExternal &&
(relative.find("..") != std::string::npos)) {
@@ -571,15 +571,13 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
std::string systemIncludeDirs = makefile->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
if (!systemIncludeDirs.empty()) {
- cmAppend(allIncludeDirs,
- cmSystemTools::ExpandedListArgument(systemIncludeDirs));
+ cmAppend(allIncludeDirs, cmExpandedList(systemIncludeDirs));
}
systemIncludeDirs = makefile->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
if (!systemIncludeDirs.empty()) {
- cmAppend(allIncludeDirs,
- cmSystemTools::ExpandedListArgument(systemIncludeDirs));
+ cmAppend(allIncludeDirs, cmExpandedList(systemIncludeDirs));
}
std::vector<std::string>::const_iterator end =
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 06709f1..9ac355c 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -21,6 +21,7 @@
#include "cmSourceGroup.h"
#include "cmState.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmXMLWriter.h"
#include "cmake.h"
@@ -416,7 +417,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
if (const char* extraNaturesProp =
mf->GetState()->GetGlobalProperty("ECLIPSE_EXTRA_NATURES")) {
std::vector<std::string> extraNatures;
- cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures);
+ cmExpandList(extraNaturesProp, extraNatures);
for (std::string const& n : extraNatures) {
xml.Element("nature", n);
}
@@ -803,7 +804,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
if (this->CEnabled && cDefs) {
// Expand the list.
std::vector<std::string> defs;
- cmSystemTools::ExpandListArgument(cDefs, defs, true);
+ cmExpandList(cDefs, defs, true);
// the list must contain only definition-value pairs:
if ((defs.size() % 2) == 0) {
@@ -836,7 +837,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
if (this->CXXEnabled && cxxDefs) {
// Expand the list.
std::vector<std::string> defs;
- cmSystemTools::ExpandListArgument(cxxDefs, defs, true);
+ cmExpandList(cxxDefs, defs, true);
// the list must contain only definition-value pairs:
if ((defs.size() % 2) == 0) {
@@ -887,7 +888,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
std::string systemIncludeDirs =
mf->GetSafeDefinition("CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs;
- cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
+ cmExpandList(systemIncludeDirs, dirs);
this->AppendIncludeDirectories(xml, dirs, emmited);
}
compiler = mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
@@ -895,7 +896,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
std::string systemIncludeDirs =
mf->GetSafeDefinition("CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs;
- cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
+ cmExpandList(systemIncludeDirs, dirs);
this->AppendIncludeDirectories(xml, dirs, emmited);
}
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 67773e0..6c17279 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -135,7 +135,7 @@ void cmExtraSublimeTextGenerator::CreateNewProjectFile(
fout << "\n\t]";
std::string systemName = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
std::vector<std::string> tokens;
- cmSystemTools::ExpandListArgument(this->EnvSettings, tokens);
+ cmExpandList(this->EnvSettings, tokens);
if (!this->EnvSettings.empty()) {
fout << ",";
@@ -445,7 +445,7 @@ bool cmExtraSublimeTextGenerator::Open(const std::string& bindir,
if (!sublExecutable) {
return false;
}
- if (cmSystemTools::IsNOTFOUND(sublExecutable)) {
+ if (cmIsNOTFOUND(sublExecutable)) {
return false;
}
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index ec03191..4f7eaea 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -47,7 +47,7 @@
#include "cm_sys_stat.h"
#include "cmake.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmCurl.h"
# include "cmFileLockResult.h"
# include "cm_curl.h"
@@ -275,7 +275,7 @@ bool HandleReadCommand(std::vector<std::string> const& args,
bool HandleHashCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
if (args.size() != 3) {
std::ostringstream e;
e << args[0] << " requires a file name and output variable";
@@ -283,7 +283,7 @@ bool HandleHashCommand(std::vector<std::string> const& args,
return false;
}
- std::unique_ptr<cmCryptoHash> hash(cmCryptoHash::New(args[0].c_str()));
+ std::unique_ptr<cmCryptoHash> hash(cmCryptoHash::New(args[0]));
if (hash) {
std::string out = hash->HashFile(args[1]);
if (!out.empty()) {
@@ -469,8 +469,7 @@ bool HandleStringsCommand(std::vector<std::string> const& args,
// TODO: should work without temp file, but just on a memory buffer
std::string binaryFileName =
status.GetMakefile().GetCurrentBinaryDirectory();
- binaryFileName += "/CMakeFiles";
- binaryFileName += "/FileCommandStringsBinaryFile";
+ binaryFileName += "/CMakeFiles/FileCommandStringsBinaryFile";
if (cmHexFileConverter::TryConvert(fileName, binaryFileName)) {
fileName = binaryFileName;
}
@@ -703,10 +702,10 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
if (*i == "LIST_DIRECTORIES") {
++i; // skip LIST_DIRECTORIES
if (i != args.end()) {
- if (cmSystemTools::IsOn(*i)) {
+ if (cmIsOn(*i)) {
g.SetListDirs(true);
g.SetRecurseListDirs(true);
- } else if (cmSystemTools::IsOff(*i)) {
+ } else if (cmIsOff(*i)) {
g.SetListDirs(false);
g.SetRecurseListDirs(false);
} else {
@@ -1356,7 +1355,7 @@ bool HandleRemoveImpl(std::vector<std::string> const& args, bool recurse,
if (cmSystemTools::FileIsDirectory(fileName) &&
!cmSystemTools::FileIsSymlink(fileName) && recurse) {
- cmSystemTools::RemoveADirectory(fileName);
+ cmSystemTools::RepeatedRemoveDirectory(fileName);
} else {
cmSystemTools::RemoveFile(fileName);
}
@@ -1426,7 +1425,7 @@ bool HandleNativePathCommand(std::vector<std::string> const& args,
return HandlePathCommand(args, ToNativePath, status);
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
// Stuff for curl download/upload
typedef std::vector<char> cmFileCommandVectorOfChar;
@@ -1592,7 +1591,7 @@ private:
bool HandleDownloadCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
std::vector<std::string>::const_iterator i = args.begin();
if (args.size() < 3) {
status.SetError("DOWNLOAD must be called with at least three arguments.");
@@ -1656,7 +1655,7 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
} else if (*i == "TLS_VERIFY") {
++i;
if (i != args.end()) {
- tls_verify = cmSystemTools::IsOn(*i);
+ tls_verify = cmIsOn(*i);
} else {
status.SetError("TLS_VERIFY missing bool value.");
return false;
@@ -1712,7 +1711,7 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
}
std::string algo = i->substr(0, pos);
expectedHash = cmSystemTools::LowerCase(i->substr(pos + 1));
- hash = std::unique_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
+ hash = std::unique_ptr<cmCryptoHash>(cmCryptoHash::New(algo));
if (!hash) {
std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: ";
err += algo;
@@ -1961,7 +1960,7 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
bool HandleUploadCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
if (args.size() < 3) {
status.SetError("UPLOAD must be called with at least three arguments.");
return false;
@@ -2292,7 +2291,7 @@ bool HandleGenerateCommand(std::vector<std::string> const& args,
bool HandleLockCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
// Default values
bool directory = false;
bool release = false;
@@ -2357,8 +2356,7 @@ bool HandleLockCommand(std::vector<std::string> const& args,
return false;
}
long scanned;
- if (!cmSystemTools::StringToLong(args[i].c_str(), &scanned) ||
- scanned < 0) {
+ if (!cmStrToLong(args[i], &scanned) || scanned < 0) {
std::ostringstream e;
e << "TIMEOUT value \"" << args[i] << "\" is not an unsigned integer.";
status.GetMakefile().IssueMessage(MessageType::FATAL_ERROR, e.str());
diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx
index 62f132d..1d66050 100644
--- a/Source/cmFileCopier.cxx
+++ b/Source/cmFileCopier.cxx
@@ -172,7 +172,7 @@ bool cmFileCopier::GetDefaultDirectoryPermissions(mode_t** mode)
"CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (default_dir_install_permissions && *default_dir_install_permissions) {
std::vector<std::string> items;
- cmSystemTools::ExpandListArgument(default_dir_install_permissions, items);
+ cmExpandList(default_dir_install_permissions, items);
for (const auto& arg : items) {
if (!this->CheckPermissions(arg, **mode)) {
this->Status.SetError(
diff --git a/Source/cmFileInstaller.cxx b/Source/cmFileInstaller.cxx
index d28ef41..6a95b92 100644
--- a/Source/cmFileInstaller.cxx
+++ b/Source/cmFileInstaller.cxx
@@ -6,6 +6,7 @@
#include "cmExecutionStatus.h"
#include "cmFSPermissions.h"
#include "cmMakefile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
@@ -28,7 +29,7 @@ cmFileInstaller::cmFileInstaller(cmExecutionStatus& status)
// 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);
+ this->Always = cmIsOn(install_always);
}
// Get the current manifest.
this->Manifest =
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index b1ccc83..9bacfc4 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -324,7 +324,7 @@ bool cmFindBase::CheckForVariableInCache()
this->Makefile->GetDefinition(this->VariableName)) {
cmState* state = this->Makefile->GetState();
const char* cacheEntry = state->GetCacheEntryValue(this->VariableName);
- bool found = !cmSystemTools::IsNOTFOUND(cacheValue);
+ bool found = !cmIsNOTFOUND(cacheValue);
bool cached = cacheEntry != nullptr;
if (found) {
// If the user specifies the entry on the command line without a
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index a5937a0..c5209c4 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -9,6 +9,7 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL");
@@ -160,7 +161,7 @@ void cmFindCommon::SelectDefaultSearchModes()
for (auto& path : search_paths) {
const char* def = this->Makefile->GetDefinition(path.second);
if (def) {
- path.first = !cmSystemTools::IsOn(def);
+ path.first = !cmIsOn(def);
}
}
}
@@ -195,7 +196,7 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
// Construct the list of path roots with no trailing slashes.
std::vector<std::string> roots;
if (rootPath) {
- cmSystemTools::ExpandListArgument(rootPath, roots);
+ cmExpandList(rootPath, roots);
}
if (sysrootCompile) {
roots.emplace_back(sysrootCompile);
@@ -261,7 +262,7 @@ void cmFindCommon::GetIgnoredPaths(std::vector<std::string>& ignore)
continue;
}
- cmSystemTools::ExpandListArgument(ignorePath, ignore);
+ cmExpandList(ignorePath, ignore);
}
for (std::string& i : ignore) {
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 73d602d..dc160b5 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -13,6 +13,7 @@
#include "cmMakefile.h"
#include "cmState.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
@@ -237,8 +238,8 @@ cmFindLibraryHelper::cmFindLibraryHelper(cmMakefile* mf)
this->Makefile->GetRequiredDefinition("CMAKE_FIND_LIBRARY_PREFIXES");
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);
+ cmExpandList(prefixes_list, this->Prefixes, true);
+ cmExpandList(suffixes_list, this->Suffixes, true);
this->RegexFromList(this->PrefixRegexStr, this->Prefixes);
this->RegexFromList(this->SuffixRegexStr, this->Suffixes);
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 0159ca5..ae93eff 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -194,7 +194,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
// priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
if (const char* def =
this->Makefile->GetDefinition("CMAKE_FIND_USE_PACKAGE_REGISTRY")) {
- this->NoUserRegistry = !cmSystemTools::IsOn(def);
+ this->NoUserRegistry = !cmIsOn(def);
} else if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
this->NoUserRegistry = true;
}
@@ -498,7 +498,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
// NEW behavior is to honor the <pkg>_ROOT variables.
std::string const rootVar = this->Name + "_ROOT";
if (const char* pkgRoot = this->Makefile->GetDefinition(rootVar)) {
- cmSystemTools::ExpandListArgument(pkgRoot, rootPaths, false);
+ cmExpandList(pkgRoot, rootPaths, false);
}
cmSystemTools::GetPath(rootPaths, rootVar.c_str());
} break;
@@ -752,7 +752,7 @@ bool cmFindPackageCommand::HandlePackageMode(
// Try to load the config file if the directory is known
bool fileFound = false;
if (this->UseConfigFiles) {
- if (!cmSystemTools::IsOff(def)) {
+ if (!cmIsOff(def)) {
// Get the directory from the variable value.
std::string dir = def;
cmSystemTools::ConvertToUnixSlashes(dir);
@@ -772,7 +772,7 @@ bool cmFindPackageCommand::HandlePackageMode(
}
// Search for the config file if it is not already found.
- if (cmSystemTools::IsOff(def) || !fileFound) {
+ if (cmIsOff(def) || !fileFound) {
fileFound = this->FindConfig();
}
@@ -1099,7 +1099,7 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
if (foundProp && *foundProp) {
std::string tmp = foundProp;
- cmSystemTools::ExpandListArgument(tmp, foundContents, false);
+ cmExpandList(tmp, foundContents, false);
std::vector<std::string>::iterator nameIt =
std::find(foundContents.begin(), foundContents.end(), this->Name);
if (nameIt != foundContents.end()) {
@@ -1113,7 +1113,7 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
if (notFoundProp && *notFoundProp) {
std::string tmp = notFoundProp;
- cmSystemTools::ExpandListArgument(tmp, notFoundContents, false);
+ cmExpandList(tmp, notFoundContents, false);
std::vector<std::string>::iterator nameIt =
std::find(notFoundContents.begin(), notFoundContents.end(), this->Name);
if (nameIt != notFoundContents.end()) {
@@ -1148,8 +1148,7 @@ void cmFindPackageCommand::AppendSuccessInformation()
const char* upperResult = this->Makefile->GetDefinition(upperFound);
const char* result = this->Makefile->GetDefinition(found);
- bool packageFound =
- ((cmSystemTools::IsOn(result)) || (cmSystemTools::IsOn(upperResult)));
+ bool packageFound = ((cmIsOn(result)) || (cmIsOn(upperResult)));
this->AppendToFoundProperty(packageFound);
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index a565786..9c6f1b4 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -17,6 +17,7 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmRange.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
class cmForEachFunctionBlocker : public cmFunctionBlocker
@@ -195,7 +196,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
} else if (doing == DoingLists) {
const char* value = this->Makefile->GetDefinition(args[i]);
if (value && *value) {
- cmSystemTools::ExpandListArgument(value, fb->Args, true);
+ cmExpandList(value, fb->Args, true);
}
} else {
std::ostringstream e;
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 2f47788..7475e9f 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -6,14 +6,14 @@
#include "cmSystemTools.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cm_codecvt.hxx"
# include "cm_zlib.h"
#endif
cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
if (encoding != codecvt::None) {
imbue(std::locale(getloc(), new codecvt(encoding)));
}
@@ -32,7 +32,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name,
cmSystemTools::Error("Cannot open file for write: " + this->TempName);
cmSystemTools::ReportLastSystemError("");
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
if (encoding != codecvt::None) {
imbue(std::locale(getloc(), new codecvt(encoding)));
}
@@ -169,7 +169,7 @@ bool cmGeneratedFileStreamBase::Close()
return replaced;
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
int cmGeneratedFileStreamBase::CompressFile(std::string const& oldname,
std::string const& newname)
{
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 4d3a005..133a72b 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -13,6 +13,7 @@
#include "cmGeneratorExpressionEvaluator.h"
#include "cmGeneratorExpressionLexer.h"
#include "cmGeneratorExpressionParser.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
cmGeneratorExpression::cmGeneratorExpression(cmListFileBacktrace backtrace)
@@ -294,7 +295,7 @@ void cmGeneratorExpression::Split(const std::string& input,
preGenex = input.substr(startPos + 1, pos - startPos - 1);
}
if (!part.empty()) {
- cmSystemTools::ExpandListArgument(part, output);
+ cmExpandList(part, output);
}
}
pos += 2;
@@ -327,7 +328,7 @@ void cmGeneratorExpression::Split(const std::string& input,
lastPos = pos;
}
if (lastPos < input.size()) {
- cmSystemTools::ExpandListArgument(input.substr(lastPos), output);
+ cmExpandList(input.substr(lastPos), output);
}
}
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index f78c72e..9f761ed 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -169,7 +169,7 @@ static const struct BoolNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent* /*content*/,
cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
{
- return !cmSystemTools::IsOff(parameters.front()) ? "1" : "0";
+ return !cmIsOff(parameters.front()) ? "1" : "0";
}
} boolNode;
@@ -281,11 +281,11 @@ static const struct InListNode : public cmGeneratorExpressionNode
case cmPolicies::WARN:
if (parameters.front().empty()) {
check = true;
- cmSystemTools::ExpandListArgument(parameters[1], checkValues, true);
+ cmExpandList(parameters[1], checkValues, true);
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
- cmSystemTools::ExpandListArgument(parameters[1], values);
+ cmExpandList(parameters[1], values);
if (check && values != checkValues) {
std::ostringstream e;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0085)
@@ -302,7 +302,7 @@ static const struct InListNode : public cmGeneratorExpressionNode
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
- cmSystemTools::ExpandListArgument(parameters[1], values, true);
+ cmExpandList(parameters[1], values, true);
break;
}
@@ -348,7 +348,7 @@ static const struct FilterNode : public cmGeneratorExpressionNode
}
std::vector<std::string> values, result;
- cmSystemTools::ExpandListArgument(parameters.front(), values, true);
+ cmExpandList(parameters.front(), values, true);
std::copy_if(values.cbegin(), values.cend(), std::back_inserter(result),
[&re, exclude](std::string const& input) {
@@ -377,7 +377,7 @@ static const struct RemoveDuplicatesNode : public cmGeneratorExpressionNode
}
std::vector<std::string> values;
- cmSystemTools::ExpandListArgument(parameters.front(), values, true);
+ cmExpandList(parameters.front(), values, true);
auto valuesEnd = cmRemoveDuplicates(values);
auto valuesBegin = values.cbegin();
@@ -914,8 +914,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
mapProp += cmSystemTools::UpperCase(context->Config);
if (const char* mapValue =
context->CurrentTarget->GetProperty(mapProp)) {
- cmSystemTools::ExpandListArgument(cmSystemTools::UpperCase(mapValue),
- mappedConfigs);
+ cmExpandList(cmSystemTools::UpperCase(mapValue), mappedConfigs);
return std::find(mappedConfigs.begin(), mappedConfigs.end(),
cmSystemTools::UpperCase(parameters.front())) !=
mappedConfigs.end()
@@ -943,7 +942,7 @@ static const struct JoinNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
{
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(parameters.front(), list);
+ cmExpandList(parameters.front(), list);
return cmJoin(list, parameters[1]);
}
} joinNode;
@@ -1421,7 +1420,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
const char* imp = nullptr;
std::string suffix;
if (gt->Target->GetMappedConfig(context->Config, &loc, &imp, suffix)) {
- cmSystemTools::ExpandListArgument(loc, objects);
+ cmExpandList(loc, objects);
}
context->HadContextSensitiveCondition = true;
} else {
@@ -1499,8 +1498,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
reportError(context, content->GetOriginalExpression(), error);
return std::string();
}
- cmSystemTools::ExpandListArgument(featuresKnown,
- availableFeatures[lang]);
+ cmExpandList(featuresKnown, availableFeatures[lang]);
}
}
@@ -2216,7 +2214,7 @@ static const struct ShellPathNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
{
std::vector<std::string> listIn;
- cmSystemTools::ExpandListArgument(parameters.front(), listIn);
+ cmExpandList(parameters.front(), listIn);
if (listIn.empty()) {
reportError(context, content->GetOriginalExpression(),
"\"\" is not an absolute path.");
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 03fc5ae..4dd1e5b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -241,10 +241,9 @@ EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry(
cmGeneratorTarget::TargetPropertyEntry* entry)
{
EvaluatedTargetPropertyEntry ee(entry->LinkImplItem, entry->GetBacktrace());
- cmSystemTools::ExpandListArgument(
- entry->Evaluate(thisTarget->GetLocalGenerator(), config, false, thisTarget,
- dagChecker, lang),
- ee.Values);
+ cmExpandList(entry->Evaluate(thisTarget->GetLocalGenerator(), config, false,
+ thisTarget, dagChecker, lang),
+ ee.Values);
if (entry->GetHadContextSensitiveCondition()) {
ee.ContextDependent = true;
}
@@ -723,10 +722,9 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
if (const char* dirs =
depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")) {
cmGeneratorExpression ge;
- cmSystemTools::ExpandListArgument(
- ge.Parse(dirs)->Evaluate(lg, config, false, headTarget, depTgt,
- dagChecker, language),
- result);
+ cmExpandList(ge.Parse(dirs)->Evaluate(lg, config, false, headTarget,
+ depTgt, dagChecker, language),
+ result);
}
if (!depTgt->IsImported() || excludeImported) {
return;
@@ -735,10 +733,9 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
if (const char* dirs =
depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES")) {
cmGeneratorExpression ge;
- cmSystemTools::ExpandListArgument(
- ge.Parse(dirs)->Evaluate(lg, config, false, headTarget, depTgt,
- dagChecker, language),
- result);
+ cmExpandList(ge.Parse(dirs)->Evaluate(lg, config, false, headTarget,
+ depTgt, dagChecker, language),
+ result);
}
}
}
@@ -828,7 +825,7 @@ bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
std::string const& config) const
{
const char* feature = "INTERPROCEDURAL_OPTIMIZATION";
- const bool result = cmSystemTools::IsOn(this->GetFeature(feature, config));
+ const bool result = cmIsOn(this->GetFeature(feature, config));
if (!result) {
// 'INTERPROCEDURAL_OPTIMIZATION' is off, no need to check policies
@@ -1114,10 +1111,9 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
std::vector<std::string> result;
for (std::string const& it : this->Target->GetSystemIncludeDirectories()) {
cmGeneratorExpression ge;
- cmSystemTools::ExpandListArgument(
- ge.Parse(it)->Evaluate(this->LocalGenerator, config, false, this,
- &dagChecker, language),
- result);
+ cmExpandList(ge.Parse(it)->Evaluate(this->LocalGenerator, config, false,
+ this, &dagChecker, language),
+ result);
}
std::vector<cmGeneratorTarget const*> const& deps =
@@ -1282,7 +1278,7 @@ void AddInterfaceEntries(cmGeneratorTarget const* headTarget,
cmGeneratorExpressionContext context(
headTarget->GetLocalGenerator(), config, false, headTarget,
headTarget, true, lib.Backtrace, lang);
- cmSystemTools::ExpandListArgument(
+ cmExpandList(
lib.Target->EvaluateInterfaceProperty(prop, &context, dagChecker),
ee.Values);
ee.ContextDependent = context.HadContextSensitiveCondition;
@@ -1311,10 +1307,9 @@ void AddObjectEntries(cmGeneratorTarget const* headTarget,
cge->SetEvaluateForBuildsystem(true);
EvaluatedTargetPropertyEntry ee(lib, lib.Backtrace);
- cmSystemTools::ExpandListArgument(
- cge->Evaluate(headTarget->GetLocalGenerator(), config, false,
- headTarget, dagChecker),
- ee.Values);
+ cmExpandList(cge->Evaluate(headTarget->GetLocalGenerator(), config,
+ false, headTarget, dagChecker),
+ ee.Values);
if (cge->GetHadContextSensitiveCondition()) {
ee.ContextDependent = true;
}
@@ -1407,7 +1402,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths(
cmStringRange sourceEntries = this->Target->GetSourceEntries();
for (std::string const& entry : sourceEntries) {
std::vector<std::string> items;
- cmSystemTools::ExpandListArgument(entry, items);
+ cmExpandList(entry, items);
for (std::string const& item : items) {
if (cmHasLiteralPrefix(item, "$<TARGET_OBJECTS:") &&
item.back() == '>') {
@@ -1423,7 +1418,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths(
const char* debugProp =
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
if (debugProp) {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ cmExpandList(debugProp, debugProperties);
}
bool debugSources = !this->DebugSourcesDone &&
@@ -1977,7 +1972,7 @@ bool cmGeneratorTarget::MacOSXUseInstallNameDir() const
const char* build_with_install_name =
this->GetProperty("BUILD_WITH_INSTALL_NAME_DIR");
if (build_with_install_name) {
- return cmSystemTools::IsOn(build_with_install_name);
+ return cmIsOn(build_with_install_name);
}
cmPolicies::PolicyStatus cmp0068 = this->GetPolicyStatusCMP0068();
@@ -2526,7 +2521,7 @@ void cmGeneratorTarget::ComputeModuleDefinitionInfo(
info.WindowsExportAllSymbols =
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS") &&
this->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS");
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
info.DefFileGenerated =
info.WindowsExportAllSymbols || info.Sources.size() > 1;
#else
@@ -2557,10 +2552,9 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result,
cmGeneratorExpressionDAGChecker dagChecker(this, "AUTOUIC_OPTIONS", nullptr,
nullptr);
- cmSystemTools::ExpandListArgument(
- ge.Parse(prop)->Evaluate(this->LocalGenerator, config, false, this,
- &dagChecker),
- result);
+ cmExpandList(ge.Parse(prop)->Evaluate(this->LocalGenerator, config, false,
+ this, &dagChecker),
+ result);
}
void processILibs(const std::string& config,
@@ -2688,7 +2682,7 @@ void cmTargetTraceDependencies::Trace()
// Queue dependencies added explicitly by the user.
if (const char* additionalDeps = sf->GetProperty("OBJECT_DEPENDS")) {
std::vector<std::string> objDeps;
- cmSystemTools::ExpandListArgument(additionalDeps, objDeps);
+ cmExpandList(additionalDeps, objDeps);
for (std::string& objDep : objDeps) {
if (cmSystemTools::FileIsFullPath(objDep)) {
objDep = cmSystemTools::CollapseFullPath(objDep);
@@ -2909,7 +2903,7 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config,
archs = this->GetProperty("OSX_ARCHITECTURES");
}
if (archs) {
- cmSystemTools::ExpandListArgument(std::string(archs), archVec);
+ cmExpandList(std::string(archs), archVec);
}
}
@@ -3039,7 +3033,7 @@ void processIncludeDirectories(
}
}
- if (!cmSystemTools::IsOff(entryInclude)) {
+ if (!cmIsOff(entryInclude)) {
cmSystemTools::ConvertToUnixSlashes(entryInclude);
}
@@ -3074,7 +3068,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
const char* debugProp =
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
if (debugProp) {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ cmExpandList(debugProp, debugProperties);
}
bool debugIncludes = !this->DebugIncludesDone &&
@@ -3185,7 +3179,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileOptions(
const char* debugProp =
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
if (debugProp) {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ cmExpandList(debugProp, debugProperties);
}
bool debugOptions = !this->DebugCompileOptionsDone &&
@@ -3232,7 +3226,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileFeatures(
const char* debugProp =
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
if (debugProp) {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ cmExpandList(debugProp, debugProperties);
}
bool debugFeatures = !this->DebugCompileFeaturesDone &&
@@ -3281,7 +3275,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileDefinitions(
const char* debugProp =
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
if (debugProp) {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ cmExpandList(debugProp, debugProperties);
}
bool debugDefines = !this->DebugCompileDefinitionsDone &&
@@ -3356,7 +3350,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkOptions(
const char* debugProp =
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
if (debugProp) {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ cmExpandList(debugProp, debugProperties);
}
bool debugOptions = !this->DebugLinkOptionsDone &&
@@ -3382,7 +3376,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkOptions(
const std::string wrapper(this->Makefile->GetSafeDefinition(
"CMAKE_" + language + "_LINKER_WRAPPER_FLAG"));
std::vector<std::string> wrapperFlag;
- cmSystemTools::ExpandListArgument(wrapper, wrapperFlag);
+ cmExpandList(wrapper, wrapperFlag);
const std::string wrapperSep(this->Makefile->GetSafeDefinition(
"CMAKE_" + language + "_LINKER_WRAPPER_FLAG_SEP"));
bool concatFlagAndArgs = true;
@@ -3504,7 +3498,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetStaticLibraryLinkOptions(
std::vector<EvaluatedTargetPropertyEntry> entries;
if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) {
std::vector<std::string> options;
- cmSystemTools::ExpandListArgument(linkOptions, options);
+ cmExpandList(linkOptions, options);
for (const auto& option : options) {
std::unique_ptr<TargetPropertyEntry> entry(
CreateTargetPropertyEntry(option));
@@ -3614,7 +3608,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDirectories(
const char* debugProp =
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
if (debugProp) {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ cmExpandList(debugProp, debugProperties);
}
bool debugDirectories = !this->DebugLinkDirectoriesDone &&
@@ -3660,7 +3654,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDepends(
std::vector<EvaluatedTargetPropertyEntry> entries;
if (const char* linkDepends = this->GetProperty("LINK_DEPENDS")) {
std::vector<std::string> depends;
- cmSystemTools::ExpandListArgument(linkDepends, depends);
+ cmExpandList(linkDepends, depends);
for (const auto& depend : depends) {
std::unique_ptr<TargetPropertyEntry> entry(
CreateTargetPropertyEntry(depend));
@@ -4214,7 +4208,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const
// Process public headers to mark the source files.
if (const char* files = this->GetProperty("PUBLIC_HEADER")) {
std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
+ cmExpandList(files, relFiles);
for (std::string const& relFile : relFiles) {
if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) {
SourceFileFlags& flags = this->SourceFlagsMap[sf];
@@ -4228,7 +4222,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const
// precedence if a file is listed in both.
if (const char* files = this->GetProperty("PRIVATE_HEADER")) {
std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
+ cmExpandList(files, relFiles);
for (std::string const& relFile : relFiles) {
if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) {
SourceFileFlags& flags = this->SourceFlagsMap[sf];
@@ -4241,7 +4235,7 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const
// Mark sources listed as resources.
if (const char* files = this->GetProperty("RESOURCE")) {
std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
+ cmExpandList(files, relFiles);
for (std::string const& relFile : relFiles) {
if (cmSourceFile* sf = this->Makefile->GetSource(relFile)) {
SourceFileFlags& flags = this->SourceFlagsMap[sf];
@@ -4270,7 +4264,7 @@ cmGeneratorTarget::GetCompatibleInterfaces(std::string const& config) const
#define CM_READ_COMPATIBLE_INTERFACE(X, x) \
if (const char* prop = li->GetProperty("COMPATIBLE_INTERFACE_" #X)) { \
std::vector<std::string> props; \
- cmSystemTools::ExpandListArgument(prop, props); \
+ cmExpandList(prop, props); \
compat.Props##x.insert(props.begin(), props.end()); \
}
CM_READ_COMPATIBLE_INTERFACE(BOOL, Bool)
@@ -4384,7 +4378,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
}
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(prop, props);
+ cmExpandList(prop, props);
std::string pdir = cmSystemTools::GetCMakeRoot();
pdir += "/Help/prop_tgt/";
@@ -4614,7 +4608,7 @@ bool getTypedProperty<bool>(cmGeneratorTarget const* tgt,
}
const char* value = tgt->GetProperty(prop);
- return cmSystemTools::IsOn(genexInterpreter->Evaluate(value, prop));
+ return cmIsOn(genexInterpreter->Evaluate(value, prop));
}
template <>
@@ -4732,7 +4726,7 @@ std::pair<bool, const char*> consistentProperty(const char* lhs,
switch (t) {
case BoolType: {
- bool same = cmSystemTools::IsOn(lhs) == cmSystemTools::IsOn(rhs);
+ bool same = cmIsOn(lhs) == cmIsOn(rhs);
return std::make_pair(same, same ? lhs : nullptr);
}
case StringType:
@@ -4763,7 +4757,7 @@ std::pair<bool, std::string> consistentProperty(const std::string& lhs,
switch (t) {
case BoolType: {
- bool same = cmSystemTools::IsOn(lhs) == cmSystemTools::IsOn(rhs);
+ bool same = cmIsOn(lhs) == cmIsOn(rhs);
return std::make_pair(same, same ? lhs : null_ptr);
}
case StringType:
@@ -5115,7 +5109,7 @@ void cmGeneratorTarget::ReportPropertyOrigin(
const char* debugProp = this->Target->GetMakefile()->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES");
if (debugProp) {
- cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ cmExpandList(debugProp, debugProperties);
}
bool debugOrigin = !this->DebugCompatiblePropertiesDone[p] &&
@@ -5167,10 +5161,9 @@ void cmGeneratorTarget::ExpandLinkItems(
}
std::vector<std::string> libs;
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
- cmSystemTools::ExpandListArgument(cge->Evaluate(this->LocalGenerator, config,
- false, headTarget, this,
- &dagChecker),
- libs);
+ cmExpandList(cge->Evaluate(this->LocalGenerator, config, false, headTarget,
+ this, &dagChecker),
+ libs);
this->LookupLinkItems(libs, cge->GetBacktrace(), items);
hadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition();
}
@@ -5747,12 +5740,12 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
if (!iface.AllDone) {
iface.AllDone = true;
iface.Multiplicity = info->Multiplicity;
- cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
+ cmExpandList(info->Languages, iface.Languages);
this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config,
headTarget, usage_requirements_only, iface.Libraries,
iface.HadHeadSensitiveCondition);
std::vector<std::string> deps;
- cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
+ cmExpandList(info->SharedDeps, deps);
this->LookupLinkItems(deps, cmListFileBacktrace(), iface.SharedDeps);
}
@@ -5875,10 +5868,10 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
std::string soProp = "IMPORTED_NO_SONAME";
soProp += suffix;
if (const char* config_no_soname = this->GetProperty(soProp)) {
- info.NoSOName = cmSystemTools::IsOn(config_no_soname);
+ info.NoSOName = cmIsOn(config_no_soname);
} else if (const char* no_soname =
this->GetProperty("IMPORTED_NO_SONAME")) {
- info.NoSOName = cmSystemTools::IsOn(no_soname);
+ info.NoSOName = cmIsOn(no_soname);
}
}
@@ -6041,7 +6034,7 @@ void cmGeneratorTarget::GetObjectLibrariesCMP0026(
cmStringRange rng = this->Target->GetSourceEntries();
for (std::string const& entry : rng) {
std::vector<std::string> files;
- cmSystemTools::ExpandListArgument(entry, files);
+ cmExpandList(entry, files);
for (std::string const& li : files) {
if (cmHasLiteralPrefix(li, "$<TARGET_OBJECTS:") && li.back() == '>') {
std::string objLibName = li.substr(17, li.size() - 18);
@@ -6255,7 +6248,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
std::unique_ptr<cmCompiledGeneratorExpression> const cge = ge.Parse(*le);
std::string const& evaluated =
cge->Evaluate(this->LocalGenerator, config, false, head, &dagChecker);
- cmSystemTools::ExpandListArgument(evaluated, llibs);
+ cmExpandList(evaluated, llibs);
if (cge->GetHadHeadSensitiveCondition()) {
impl.HadHeadSensitiveCondition = true;
}
@@ -6449,8 +6442,7 @@ bool cmGeneratorTarget::NeedImportLibraryName(std::string const& config) const
std::string cmGeneratorTarget::GetSupportDirectory() const
{
std::string dir = this->LocalGenerator->GetCurrentBinaryDirectory();
- dir += "/CMakeFiles";
- dir += "/";
+ dir += "/CMakeFiles/";
dir += this->GetName();
#if defined(__VMS)
dir += "_dir";
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index c948b2a..d56af3d 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -22,7 +22,7 @@ bool cmGetFilenameComponentCommand::InitialPass(
// already, if so use that value
if (args.size() >= 4 && args.back() == "CACHE") {
const char* cacheValue = this->Makefile->GetDefinition(args.front());
- if (cacheValue && !cmSystemTools::IsNOTFOUND(cacheValue)) {
+ if (cacheValue && !cmIsNOTFOUND(cacheValue)) {
return true;
}
}
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 00ebbb5..fc9ae01 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -469,7 +469,7 @@ void cmGhsMultiTargetGenerator::WriteSourceProperty(
const char* prop = sf->GetProperty(propName);
if (prop) {
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(prop, list);
+ cmExpandList(prop, list);
for (auto& p : list) {
fout << " " << propFlag << p << std::endl;
}
@@ -561,10 +561,8 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
for (auto& sg : groupFilesList) {
std::ostream* fout;
bool useProjectFile =
- cmSystemTools::IsOn(
- this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE")) ||
- cmSystemTools::IsOn(
- this->Makefile->GetDefinition("CMAKE_GHS_NO_SOURCE_GROUP_FILE"));
+ cmIsOn(this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE")) ||
+ cmIsOn(this->Makefile->GetDefinition("CMAKE_GHS_NO_SOURCE_GROUP_FILE"));
if (useProjectFile || sg.empty()) {
fout = &fout_proj;
} else {
@@ -740,8 +738,7 @@ bool cmGhsMultiTargetGenerator::DetermineIfIntegrityApp()
{
const char* p = this->GeneratorTarget->GetProperty("ghs_integrity_app");
if (p) {
- return cmSystemTools::IsOn(
- this->GeneratorTarget->GetProperty("ghs_integrity_app"));
+ return cmIsOn(this->GeneratorTarget->GetProperty("ghs_integrity_app"));
}
std::vector<cmSourceFile*> sources;
this->GeneratorTarget->GetSourceFiles(sources, this->ConfigName);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 88da5eb..80fd234 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -44,7 +44,7 @@
#include "cmWorkingDirectory.h"
#include "cmake.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmCryptoHash.h"
# include "cmQtAutoGenGlobalInitializer.h"
# include "cm_jsoncpp_value.h"
@@ -114,7 +114,7 @@ cmGlobalGenerator::~cmGlobalGenerator()
this->ClearGeneratorMembers();
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
Json::Value cmGlobalGenerator::GetJson() const
{
Json::Value generator = Json::objectValue;
@@ -186,15 +186,15 @@ std::string cmGlobalGenerator::SelectMakeProgram(
const std::string& inMakeProgram, const std::string& makeDefault) const
{
std::string makeProgram = inMakeProgram;
- if (cmSystemTools::IsOff(makeProgram)) {
+ if (cmIsOff(makeProgram)) {
const char* makeProgramCSTR =
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
- if (cmSystemTools::IsOff(makeProgramCSTR)) {
+ if (cmIsOff(makeProgramCSTR)) {
makeProgram = makeDefault;
} else {
makeProgram = makeProgramCSTR;
}
- if (cmSystemTools::IsOff(makeProgram) && !makeProgram.empty()) {
+ if (cmIsOff(makeProgram) && !makeProgram.empty()) {
makeProgram = "CMAKE_MAKE_PROGRAM-NOTFOUND";
}
}
@@ -300,7 +300,7 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET ||
target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY ||
target->GetType() == cmStateEnums::TargetType::UTILITY ||
- cmSystemTools::IsOn(target->GetProperty("ghs_integrity_app"))) {
+ cmIsOn(target->GetProperty("ghs_integrity_app"))) {
continue;
}
@@ -382,14 +382,14 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
return false;
}
if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") ||
- cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile);
if (!setMakeProgram.empty()) {
mf->ReadListFile(setMakeProgram);
}
}
if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") ||
- cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
std::ostringstream err;
err << "CMake was unable to find a build program corresponding to \""
<< this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You "
@@ -522,7 +522,7 @@ void cmGlobalGenerator::EnableLanguage(
if (!this->ConfiguredFilesPath.empty()) {
rootBin = this->ConfiguredFilesPath;
}
- rootBin += "/";
+ rootBin += '/';
rootBin += cmVersion::GetCMakeVersion();
// set the dir for parent files so they can be used by modules
@@ -771,8 +771,7 @@ void cmGlobalGenerator::EnableLanguage(
compilerEnv += "_COMPILER_ENV_VAR";
std::ostringstream noCompiler;
const char* compilerFile = mf->GetDefinition(compilerName);
- if (!compilerFile || !*compilerFile ||
- cmSystemTools::IsNOTFOUND(compilerFile)) {
+ if (!compilerFile || !*compilerFile || cmIsNOTFOUND(compilerFile)) {
/* clang-format off */
noCompiler <<
"No " << compilerName << " could be found.\n"
@@ -1149,7 +1148,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l,
std::string("CMAKE_") + std::string(l) + std::string("_IGNORE_EXTENSIONS");
std::string ignoreExts = mf->GetSafeDefinition(ignoreExtensionsVar);
std::vector<std::string> extensionList;
- cmSystemTools::ExpandListArgument(ignoreExts, extensionList);
+ cmExpandList(ignoreExts, extensionList);
for (std::string const& i : extensionList) {
this->IgnoreExtensions[i] = true;
}
@@ -1162,7 +1161,7 @@ void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l,
std::string("_SOURCE_FILE_EXTENSIONS");
const std::string& exts = mf->GetSafeDefinition(extensionsVar);
std::vector<std::string> extensionList;
- cmSystemTools::ExpandListArgument(exts, extensionList);
+ cmExpandList(exts, extensionList);
for (std::string const& i : extensionList) {
this->ExtensionToLanguage[i] = l;
}
@@ -1278,8 +1277,7 @@ void cmGlobalGenerator::Configure()
const char* logs[] = { "CMakeOutput.log", "CMakeError.log", nullptr };
for (const char** log = logs; *log; ++log) {
std::string f = this->CMakeInstance->GetHomeOutputDirectory();
- f += "/CMakeFiles";
- f += "/";
+ f += "/CMakeFiles/";
f += *log;
if (cmSystemTools::FileExists(f)) {
msg << "\nSee also \"" << f << "\".";
@@ -1547,7 +1545,7 @@ bool cmGlobalGenerator::ComputeTargetDepends()
bool cmGlobalGenerator::QtAutoGen()
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmQtAutoGenGlobalInitializer initializer(this->LocalGenerators);
return initializer.generate();
#else
@@ -1622,8 +1620,7 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
std::string const& standardIncludesStr =
mf->GetSafeDefinition(standardIncludesVar);
std::vector<std::string> standardIncludesVec;
- cmSystemTools::ExpandListArgument(standardIncludesStr,
- standardIncludesVec);
+ cmExpandList(standardIncludesStr, standardIncludesVec);
standardIncludesSet.insert(standardIncludesVec.begin(),
standardIncludesVec.end());
}
@@ -1710,8 +1707,7 @@ void cmGlobalGenerator::CheckTargetProperties()
continue;
}
for (auto const& lib : target.second.GetOriginalLinkLibraries()) {
- if (lib.first.size() > 9 &&
- cmSystemTools::IsNOTFOUND(lib.first.c_str())) {
+ if (lib.first.size() > 9 && cmIsNOTFOUND(lib.first)) {
std::string varName = lib.first.substr(0, lib.first.size() - 9);
if (state->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) {
varName += " (ADVANCED)";
@@ -1734,10 +1730,10 @@ void cmGlobalGenerator::CheckTargetProperties()
std::string incDirs = cmGeneratorExpression::Preprocess(
incDirProp, cmGeneratorExpression::StripAllGeneratorExpressions);
- cmSystemTools::ExpandListArgument(incDirs, incs);
+ cmExpandList(incDirs, incs);
for (std::string const& incDir : incs) {
- if (incDir.size() > 9 && cmSystemTools::IsNOTFOUND(incDir.c_str())) {
+ if (incDir.size() > 9 && cmIsNOTFOUND(incDir)) {
std::string varName = incDir.substr(0, incDir.size() - 9);
if (state->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) {
varName += " (ADVANCED)";
@@ -2270,14 +2266,6 @@ bool cmGlobalGenerator::NameResolvesToFramework(
return false;
}
-inline std::string removeQuotes(const std::string& s)
-{
- if (s.front() == '\"' && s.back() == '\"') {
- return s.substr(1, s.size() - 2);
- }
- return s;
-}
-
bool cmGlobalGenerator::CheckCMP0037(std::string const& targetName,
std::string const& reason) const
{
@@ -2365,7 +2353,7 @@ void cmGlobalGenerator::AddGlobalTarget_Package(
} else {
const char* noPackageAll =
mf->GetDefinition("CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY");
- if (!noPackageAll || cmSystemTools::IsOff(noPackageAll)) {
+ if (!noPackageAll || cmIsOff(noPackageAll)) {
gti.Depends.emplace_back(this->GetAllTargetName());
}
}
@@ -2534,7 +2522,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
} else {
const char* noall =
mf->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
- if (!noall || cmSystemTools::IsOff(noall)) {
+ if (!noall || cmIsOff(noall)) {
gti.Depends.emplace_back(this->GetAllTargetName());
}
}
@@ -2617,7 +2605,7 @@ bool cmGlobalGenerator::UseFolderProperty() const
// If this property is defined, let the setter turn this on or off...
//
if (prop) {
- return cmSystemTools::IsOn(prop);
+ return cmIsOn(prop);
}
// By default, this feature is OFF, since it is not supported in the
@@ -2829,7 +2817,7 @@ std::set<std::string> const& cmGlobalGenerator::GetDirectoryContent(
void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
std::string const& content)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
// Ignore if there are no outputs.
if (outputs.empty()) {
return;
@@ -2859,11 +2847,10 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
void cmGlobalGenerator::CheckRuleHashes()
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
std::string home = this->GetCMakeInstance()->GetHomeOutputDirectory();
std::string pfile = home;
- pfile += "/CMakeFiles";
- pfile += "/CMakeRuleHashes.txt";
+ pfile += "/CMakeFiles/CMakeRuleHashes.txt";
this->CheckRuleHashes(pfile, home);
this->WriteRuleHashes(pfile);
#endif
@@ -2940,8 +2927,7 @@ void cmGlobalGenerator::WriteSummary()
{
// Record all target directories in a central location.
std::string fname = this->CMakeInstance->GetHomeOutputDirectory();
- fname += "/CMakeFiles";
- fname += "/TargetDirectories.txt";
+ fname += "/CMakeFiles/TargetDirectories.txt";
cmGeneratedFileStream fout(fname);
for (cmLocalGenerator* lg : this->LocalGenerators) {
@@ -2963,7 +2949,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
file += "/Labels.txt";
std::string json_file = dir + "/Labels.json";
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
// Check whether labels are enabled for this target.
const char* targetLabels = target->GetProperty("LABELS");
const char* directoryLabels =
@@ -2985,7 +2971,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
// List the target-wide labels. All sources in the target get
// these labels.
if (targetLabels) {
- cmSystemTools::ExpandListArgument(targetLabels, labels);
+ cmExpandList(targetLabels, labels);
if (!labels.empty()) {
fout << "# Target labels\n";
for (std::string const& l : labels) {
@@ -3000,12 +2986,11 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
std::vector<std::string> cmakeDirectoryLabelsList;
if (directoryLabels) {
- cmSystemTools::ExpandListArgument(directoryLabels, directoryLabelsList);
+ cmExpandList(directoryLabels, directoryLabelsList);
}
if (cmakeDirectoryLabels) {
- cmSystemTools::ExpandListArgument(cmakeDirectoryLabels,
- cmakeDirectoryLabelsList);
+ cmExpandList(cmakeDirectoryLabels, cmakeDirectoryLabelsList);
}
if (!directoryLabelsList.empty() || !cmakeDirectoryLabelsList.empty()) {
@@ -3042,7 +3027,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
if (const char* svalue = sf->GetProperty("LABELS")) {
labels.clear();
Json::Value& lj_source_labels = lj_source["labels"] = Json::arrayValue;
- cmSystemTools::ExpandListArgument(svalue, labels);
+ cmExpandList(svalue, labels);
for (std::string const& label : labels) {
fout << " " << label << "\n";
lj_source_labels.append(label);
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index ea40ebc..830974d 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -25,7 +25,7 @@
#include "cmTargetDepend.h"
#include "cm_codecvt.hxx"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmFileLockPool.h"
# include "cm_jsoncpp_value.h"
#endif
@@ -109,7 +109,7 @@ public:
return codecvt::None;
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
/** Get a JSON object describing the generator. */
virtual Json::Value GetJson() const;
#endif
@@ -462,7 +462,7 @@ public:
const std::set<const cmGeneratorTarget*>& GetFilenameTargetDepends(
cmSourceFile* sf) const;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
cmFileLockPool& GetFileLockPool() { return FileLockPool; }
#endif
@@ -665,7 +665,7 @@ private:
mutable std::map<cmSourceFile*, std::set<cmGeneratorTarget const*>>
FilenameTargetDepends;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
// Pool of file locks
cmFileLockPool FileLockPool;
#endif
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 9f3dab7..5aae546 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -139,8 +139,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
/* check if OS location has been updated by platform scripts */
std::string platform = mf->GetSafeDefinition("GHS_TARGET_PLATFORM");
std::string osdir = mf->GetSafeDefinition("GHS_OS_DIR");
- if (cmSystemTools::IsOff(osdir.c_str()) &&
- platform.find("integrity") != std::string::npos) {
+ if (cmIsOff(osdir) && platform.find("integrity") != std::string::npos) {
if (!this->CMakeInstance->GetIsInTryCompile()) {
/* required OS location is not found */
std::string m =
@@ -151,8 +150,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
}
osdir = "GHS_OS_DIR-NOT-SPECIFIED";
} else if (!this->CMakeInstance->GetIsInTryCompile() &&
- cmSystemTools::IsOff(this->OsDir) &&
- !cmSystemTools::IsOff(osdir)) {
+ cmIsOff(this->OsDir) && !cmIsOff(osdir)) {
/* OS location was updated by auto-selection */
std::string m = "Green Hills MULTI: GHS_OS_DIR not specified; found \"";
m += osdir;
@@ -164,8 +162,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
// Determine GHS_BSP_NAME
std::string bspName = mf->GetSafeDefinition("GHS_BSP_NAME");
- if (cmSystemTools::IsOff(bspName.c_str()) &&
- platform.find("integrity") != std::string::npos) {
+ if (cmIsOff(bspName) && platform.find("integrity") != std::string::npos) {
bspName = "sim" + arch;
/* write back the calculate name for next time */
mf->AddCacheDefinition("GHS_BSP_NAME", bspName.c_str(),
@@ -335,18 +332,18 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(std::ostream& fout,
// Specify BSP option if supplied by user
const char* bspName =
this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
- if (!cmSystemTools::IsOff(bspName)) {
+ if (!cmIsOff(bspName)) {
fout << " -bsp " << bspName << std::endl;
}
// Specify OS DIR if supplied by user
// -- not all platforms require this entry in the project file
- if (!cmSystemTools::IsOff(this->OsDir.c_str())) {
+ if (!cmIsOff(this->OsDir)) {
const char* osDirOption =
this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR_OPTION");
std::replace(this->OsDir.begin(), this->OsDir.end(), '\\', '/');
fout << " ";
- if (cmSystemTools::IsOff(osDirOption)) {
+ if (cmIsOff(osDirOption)) {
fout << "";
} else {
fout << osDirOption;
@@ -470,7 +467,7 @@ void cmGlobalGhsMultiGenerator::WriteAllTarget(
if (t->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
}
- if (!cmSystemTools::IsOn(t->GetProperty("EXCLUDE_FROM_ALL"))) {
+ if (!cmIsOn(t->GetProperty("EXCLUDE_FROM_ALL"))) {
defaultTargets.push_back(t);
}
}
@@ -625,7 +622,7 @@ void cmGlobalGhsMultiGenerator::WriteMacros(std::ostream& fout,
this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS");
if (nullptr != ghsGpjMacros) {
std::vector<std::string> expandedList;
- cmSystemTools::ExpandListArgument(std::string(ghsGpjMacros), expandedList);
+ cmExpandList(std::string(ghsGpjMacros), expandedList);
for (std::string const& arg : expandedList) {
fout << "macro " << arg << std::endl;
}
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index addb0c7..29caa16 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -560,7 +560,7 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
if (pos != std::string::npos) {
const char* fv = &this->NinjaVersion[pos + k_DYNDEP_.size()];
unsigned long dyndep = 0;
- cmSystemTools::StringToULong(fv, &dyndep);
+ cmStrToULong(fv, &dyndep);
if (dyndep == 1) {
this->NinjaSupportsDyndeps = true;
}
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 35af0e1..d311c1e 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -22,6 +22,7 @@
#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTargetDepend.h"
#include "cmake.h"
@@ -147,9 +148,7 @@ void cmGlobalUnixMakefileGenerator3::Generate()
}
for (cmLocalGenerator* lg : this->LocalGenerators) {
std::string markFileName = lg->GetCurrentBinaryDirectory();
- markFileName += "/";
- markFileName += "/CMakeFiles";
- markFileName += "/progress.marks";
+ markFileName += "/CMakeFiles/progress.marks";
cmGeneratedFileStream markFile(markFileName);
markFile << this->CountProgressMarksInAll(lg) << "\n";
}
@@ -198,8 +197,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
// see if the build system must be regenerated.
std::string makefileName =
this->GetCMakeInstance()->GetHomeOutputDirectory();
- makefileName += "/CMakeFiles";
- makefileName += "/Makefile2";
+ makefileName += "/CMakeFiles/Makefile2";
cmGeneratedFileStream makefileStream(makefileName, false,
this->GetMakefileEncoding());
if (!makefileStream) {
@@ -258,8 +256,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// see if the build system must be regenerated.
std::string cmakefileName =
this->GetCMakeInstance()->GetHomeOutputDirectory();
- cmakefileName += "/CMakeFiles";
- cmakefileName += "/Makefile.cmake";
+ cmakefileName += "/CMakeFiles/Makefile.cmake";
cmGeneratedFileStream cmakefileStream(cmakefileName);
if (!cmakefileStream) {
return;
@@ -320,8 +317,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// Build the path to the cache check file.
std::string check = this->GetCMakeInstance()->GetHomeOutputDirectory();
- check += "/CMakeFiles";
- check += "/cmake.check_cache";
+ check += "/CMakeFiles/cmake.check_cache";
// Set the corresponding makefile in the cmake file.
cmakefileStream << "# The corresponding makefile is:\n"
@@ -352,8 +348,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
for (cmLocalGenerator* localGen : this->LocalGenerators) {
lg = static_cast<cmLocalUnixMakefileGenerator3*>(localGen);
tmpStr = lg->GetCurrentBinaryDirectory();
- tmpStr += "/CMakeFiles";
- tmpStr += "/CMakeDirectoryInformation.cmake";
+ tmpStr += "/CMakeFiles/CMakeDirectoryInformation.cmake";
cmakefileStream << " \""
<< lg->MaybeConvertToRelativePath(binDir, tmpStr)
<< "\"\n";
@@ -697,7 +692,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
if (const char* tgtMsg =
this->GetCMakeInstance()->GetState()->GetGlobalProperty(
"TARGET_MESSAGES")) {
- targetMessages = cmSystemTools::IsOn(tgtMsg);
+ targetMessages = cmIsOn(tgtMsg);
}
if (targetMessages) {
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 720b6c5..02d25fb 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -1038,8 +1038,7 @@ std::string cmGlobalVisualStudio10Generator::GenerateRuleFile(
// The VS 10 generator needs to create the .rule files on disk.
// Hide them away under the CMakeFiles directory.
std::string ruleDir = this->GetCMakeInstance()->GetHomeOutputDirectory();
- ruleDir += "/CMakeFiles";
- ruleDir += "/";
+ ruleDir += "/CMakeFiles/";
ruleDir += cmSystemTools::ComputeStringMD5(
cmSystemTools::GetFilenamePath(output).c_str());
std::string ruleFile = ruleDir + "/";
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 8e67fad..e0d86ca 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -201,7 +201,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations(
if (target.GetProperty("EXTERNAL_MSPROJECT")) {
if (const char* m = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(i))) {
- cmSystemTools::ExpandListArgument(m, mapConfig);
+ cmExpandList(m, mapConfig);
if (!mapConfig.empty()) {
dstConfig = mapConfig[0].c_str();
}
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index ca80d3b..7136746 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -256,7 +256,7 @@ cmLocalGenerator* cmGlobalVisualStudio7Generator::CreateLocalGenerator(
return lg;
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
Json::Value cmGlobalVisualStudio7Generator::GetJson() const
{
Json::Value generator = this->cmGlobalVisualStudioGenerator::GetJson();
@@ -512,8 +512,7 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
}
fout << "\tGlobalSection(" << name << ") = " << sectionType << "\n";
std::vector<std::string> keyValuePairs;
- cmSystemTools::ExpandListArgument(root->GetMakefile()->GetProperty(it),
- keyValuePairs);
+ cmExpandList(root->GetMakefile()->GetProperty(it), keyValuePairs);
for (std::string const& itPair : keyValuePairs) {
const std::string::size_type posEqual = itPair.find('=');
if (posEqual != std::string::npos) {
@@ -668,8 +667,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
cmGeneratorExpression ge;
std::unique_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(propertyValue);
- if (cmSystemTools::IsOn(
- cge->Evaluate(target->GetLocalGenerator(), i))) {
+ if (cmIsOn(cge->Evaluate(target->GetLocalGenerator(), i))) {
activeConfigs.insert(i);
}
}
@@ -685,7 +683,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
for (std::string const& i : configs) {
const char* propertyValue =
target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i);
- if (cmSystemTools::IsOff(propertyValue)) {
+ if (cmIsOff(propertyValue)) {
activeConfigs.insert(i);
}
}
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index f004afb..9b84732 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -23,7 +23,7 @@ public:
//! Create a local generator appropriate to this Global Generator
cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
Json::Value GetJson() const override;
#endif
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index cc6e421..20deafe 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -250,7 +250,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
if (target.GetProperty("EXTERNAL_MSPROJECT")) {
if (const char* m = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(i))) {
- cmSystemTools::ExpandListArgument(m, mapConfig);
+ cmExpandList(m, mapConfig);
if (!mapConfig.empty()) {
dstConfig = mapConfig[0].c_str();
}
@@ -299,7 +299,7 @@ bool cmGlobalVisualStudio8Generator::DeployInhibited(
cmGeneratorExpression ge;
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(propStr);
std::string prop = cge->Evaluate(target.LocalGenerator, config);
- rVal = cmSystemTools::IsOn(prop);
+ rVal = cmIsOn(prop);
}
return rVal;
}
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index ba541a9..5c057c6 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -487,7 +487,7 @@ bool cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
// Visual Studio generators know how to lookup their build tool
// directly instead of needing a helper module to do it, so we
// do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
- if (cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
mf->AddDefinition("CMAKE_MAKE_PROGRAM", this->GetVSMakeProgram());
}
return true;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 029b976..1882f89 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -38,12 +38,12 @@
struct cmLinkImplementation;
-#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(__APPLE__)
+#if !defined(CMAKE_BOOTSTRAP) && defined(__APPLE__)
# define HAVE_APPLICATION_SERVICES
# include <ApplicationServices/ApplicationServices.h>
#endif
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmXMLParser.h"
// parse the xml file storing the installed version of Xcode on
@@ -188,7 +188,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
if (name != GetActualName()) {
return nullptr;
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
cmXcodeVersionParser parser;
std::string versionFile;
{
@@ -240,7 +240,7 @@ bool cmGlobalXCodeGenerator::FindMakeProgram(cmMakefile* mf)
// The Xcode generator knows how to lookup its build tool
// directly instead of needing a helper module to do it, so we
// do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
- if (cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
mf->AddDefinition("CMAKE_MAKE_PROGRAM", this->GetXcodeBuildCommand());
}
return true;
@@ -882,7 +882,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
if (extraFileAttributes) {
// Expand the list of attributes.
std::vector<std::string> attributes;
- cmSystemTools::ExpandListArgument(extraFileAttributes, attributes);
+ cmExpandList(extraFileAttributes, attributes);
// Store the attributes.
for (const auto& attribute : attributes) {
@@ -1399,8 +1399,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt)
// language.
cmMakefile* mf = gtgt->Target->GetMakefile();
std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory();
- fname += "/CMakeFiles";
- fname += "/";
+ fname += "/CMakeFiles/";
fname += gtgt->GetName();
fname += "-CMakeForceLinker";
fname += ".";
@@ -1774,8 +1773,7 @@ void cmGlobalXCodeGenerator::AddPositionIndependentLinkAttribute(
}
buildSettings->AddAttribute(
- "LD_NO_PIE",
- this->CreateString(cmSystemTools::IsOn(PICValue) ? "NO" : "YES"));
+ "LD_NO_PIE", this->CreateString(cmIsOn(PICValue) ? "NO" : "YES"));
}
void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
@@ -2482,10 +2480,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget(
std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
cmGeneratorTarget* gtgt)
{
- std::vector<std::string> const configVector =
- cmSystemTools::ExpandedListArgument(
- this->CurrentMakefile->GetRequiredDefinition(
- "CMAKE_CONFIGURATION_TYPES"));
+ std::vector<std::string> const configVector = cmExpandedList(
+ this->CurrentMakefile->GetRequiredDefinition("CMAKE_CONFIGURATION_TYPES"));
cmXCodeObject* configlist =
this->CreateObject(cmXCodeObject::XCConfigurationList);
cmXCodeObject* buildConfigurations =
@@ -3223,8 +3219,7 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf)
const char* osxArch = mf->GetDefinition("CMAKE_OSX_ARCHITECTURES");
const char* sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT");
if (osxArch && sysroot) {
- cmSystemTools::ExpandListArgument(std::string(osxArch),
- this->Architectures);
+ cmExpandList(std::string(osxArch), this->Architectures);
}
if (this->Architectures.empty()) {
@@ -3627,7 +3622,7 @@ void cmGlobalXCodeGenerator::AppendDefines(BuildObjectListOrString& defs,
// Expand the list of definitions.
std::vector<std::string> defines;
- cmSystemTools::ExpandListArgument(defines_list, defines);
+ cmExpandList(defines_list, defines);
// Store the definitions in the string.
this->AppendDefines(defs, defines, dflag);
@@ -3704,8 +3699,7 @@ std::string cmGlobalXCodeGenerator::ComputeInfoPListLocation(
cmGeneratorTarget* target)
{
std::string plist = target->GetLocalGenerator()->GetCurrentBinaryDirectory();
- plist += "/CMakeFiles";
- plist += "/";
+ plist += "/CMakeFiles/";
plist += target->GetName();
plist += ".dir/Info.plist";
return plist;
@@ -3741,7 +3735,7 @@ bool cmGlobalXCodeGenerator::UseEffectivePlatformName(cmMakefile* mf) const
return mf->PlatformIsAppleEmbedded();
}
- return cmSystemTools::IsOn(epnValue);
+ return cmIsOn(epnValue);
}
bool cmGlobalXCodeGenerator::ShouldStripResourcePath(cmMakefile*) const
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index 9befb78..7d0ef83 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -15,6 +15,7 @@
#include "cmMakefile.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
@@ -234,8 +235,7 @@ void cmGraphVizWriter::ReadSettings(
this->TargetsToIgnoreRegex.clear();
if (!ignoreTargetsRegexes.empty()) {
std::vector<std::string> ignoreTargetsRegExVector;
- cmSystemTools::ExpandListArgument(ignoreTargetsRegexes,
- ignoreTargetsRegExVector);
+ cmExpandList(ignoreTargetsRegexes, ignoreTargetsRegExVector);
for (std::string const& currentRegexString : ignoreTargetsRegExVector) {
cmsys::RegularExpression currentRegex;
if (!currentRegex.compile(currentRegexString)) {
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index 7b992d7..e80aa8e 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -8,7 +8,7 @@
#include "cmAlgorithms.h"
#include "cmIDEFlagTable.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
cmIDEOptions::cmIDEOptions()
{
@@ -166,7 +166,7 @@ void cmIDEOptions::AddDefines(std::string const& defines)
{
if (!defines.empty()) {
// Expand the list of definitions.
- cmSystemTools::ExpandListArgument(defines, this->Defines);
+ cmExpandList(defines, this->Defines);
}
}
void cmIDEOptions::AddDefines(const std::vector<std::string>& defines)
@@ -188,7 +188,7 @@ void cmIDEOptions::AddIncludes(std::string const& includes)
{
if (!includes.empty()) {
// Expand the list of includes.
- cmSystemTools::ExpandListArgument(includes, this->Includes);
+ cmExpandList(includes, this->Includes);
}
}
void cmIDEOptions::AddIncludes(const std::vector<std::string>& includes)
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 62e2abd..eb10aa8 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -9,6 +9,7 @@
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
@@ -116,7 +117,7 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string& inc)
return;
}
- if (!cmSystemTools::IsOff(inc)) {
+ if (!cmIsOff(inc)) {
cmSystemTools::ConvertToUnixSlashes(inc);
if (!cmSystemTools::FileIsFullPath(inc)) {
diff --git a/Source/cmIncludeGuardCommand.cxx b/Source/cmIncludeGuardCommand.cxx
index 3b126b0..e560910 100644
--- a/Source/cmIncludeGuardCommand.cxx
+++ b/Source/cmIncludeGuardCommand.cxx
@@ -21,7 +21,7 @@ enum IncludeGuardScope
std::string GetIncludeGuardVariableName(std::string const& filePath)
{
std::string result = "__INCGUARD_";
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
result += cmSystemTools::ComputeStringMD5(filePath);
#else
result += cmSystemTools::MakeCidentifier(filePath);
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 5349a9d..51689a2 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -673,7 +673,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
const char* files = target.GetProperty("PRIVATE_HEADER");
if ((files) && (*files)) {
std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
+ cmExpandList(files, relFiles);
std::vector<std::string> absFiles;
if (!this->MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles)) {
return false;
@@ -688,7 +688,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
files = target.GetProperty("PUBLIC_HEADER");
if ((files) && (*files)) {
std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
+ cmExpandList(files, relFiles);
std::vector<std::string> absFiles;
if (!this->MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles)) {
return false;
@@ -703,7 +703,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
files = target.GetProperty("RESOURCE");
if ((files) && (*files)) {
std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
+ cmExpandList(files, relFiles);
std::vector<std::string> absFiles;
if (!this->MakeFilesFullPath("RESOURCE", relFiles, absFiles)) {
return false;
@@ -1268,7 +1268,7 @@ bool cmInstallCommand::HandleDirectoryMode(
bool cmInstallCommand::HandleExportAndroidMKMode(
std::vector<std::string> const& args)
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
// This is the EXPORT mode.
cmInstallCommandArguments ica(this->DefaultComponentName);
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index 9357a5c..1d8210c 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -67,8 +67,7 @@ void cmInstallDirectoryGenerator::GenerateScriptForConfig(
cmGeneratorExpression ge;
for (std::string const& d : this->Directories) {
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(d);
- cmSystemTools::ExpandListArgument(
- cge->Evaluate(this->LocalGenerator, config), dirs);
+ cmExpandList(cge->Evaluate(this->LocalGenerator, config), dirs);
}
// Make sure all dirs have absolute paths.
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index f5bedab..d4562de 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -7,7 +7,7 @@
#include <sstream>
#include <utility>
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
# include "cmExportInstallAndroidMKGenerator.h"
#endif
#include "cmExportInstallFileGenerator.h"
@@ -31,7 +31,7 @@ cmInstallExportGenerator::cmInstallExportGenerator(
, LocalGenerator(nullptr)
{
if (android) {
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
this->EFGen = new cmExportInstallAndroidMKGenerator(this);
#endif
} else {
@@ -57,8 +57,7 @@ void cmInstallExportGenerator::ComputeTempDir()
// Choose a temporary directory in which to generate the import
// files to be installed.
this->TempDir = this->LocalGenerator->GetCurrentBinaryDirectory();
- this->TempDir += "/CMakeFiles";
- this->TempDir += "/Export";
+ this->TempDir += "/CMakeFiles/Export";
if (this->Destination.empty()) {
return;
}
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index e8e82cc..c4048d4 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -4,7 +4,7 @@
#include "cmGeneratorExpression.h"
#include "cmInstallType.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
#include <memory>
@@ -85,8 +85,7 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(
cmGeneratorExpression ge;
for (std::string const& f : this->Files) {
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(f);
- cmSystemTools::ExpandListArgument(
- cge->Evaluate(this->LocalGenerator, config), files);
+ cmExpandList(cge->Evaluate(this->LocalGenerator, config), files);
}
this->AddFilesInstallRule(os, config, indent, files);
}
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 4e0be5e..ed1c80a 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -88,8 +88,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
if (this->Target->NeedRelinkBeforeInstall(config)) {
fromDirConfig =
this->Target->GetLocalGenerator()->GetCurrentBinaryDirectory();
- fromDirConfig += "/CMakeFiles";
- fromDirConfig += "/CMakeRelink.dir/";
+ fromDirConfig += "/CMakeFiles/CMakeRelink.dir/";
} else {
cmStateEnums::ArtifactType artifact = this->ImportLibrary
? cmStateEnums::ImportLibraryArtifact
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index 537b4ec..1e6c385 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -5,7 +5,7 @@
#include "cmAlgorithms.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
#include <utility>
@@ -97,7 +97,7 @@ bool cmInstalledFile::GetPropertyAsBool(const std::string& prop) const
{
std::string value;
bool isSet = this->GetProperty(prop, value);
- return isSet && cmSystemTools::IsOn(value);
+ return isSet && cmIsOn(value);
}
void cmInstalledFile::GetPropertyAsList(const std::string& prop,
@@ -107,5 +107,5 @@ void cmInstalledFile::GetPropertyAsList(const std::string& prop,
this->GetProperty(prop, value);
list.clear();
- cmSystemTools::ExpandListArgument(value, list);
+ cmExpandList(value, list);
}
diff --git a/Source/cmLDConfigLDConfigTool.cxx b/Source/cmLDConfigLDConfigTool.cxx
index 586ea96..d5cc621 100644
--- a/Source/cmLDConfigLDConfigTool.cxx
+++ b/Source/cmLDConfigLDConfigTool.cxx
@@ -4,6 +4,7 @@
#include "cmLDConfigLDConfigTool.h"
#include "cmMakefile.h"
#include "cmRuntimeDependencyArchive.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmUVProcessChain.h"
@@ -33,7 +34,7 @@ bool cmLDConfigLDConfigTool::GetLDConfigPaths(std::vector<std::string>& paths)
}
std::vector<std::string> ldConfigCommand;
- cmSystemTools::ExpandListArgument(ldConfigPath, ldConfigCommand);
+ cmExpandList(ldConfigPath, ldConfigCommand);
ldConfigCommand.emplace_back("-v");
ldConfigCommand.emplace_back("-N"); // Don't rebuild the cache.
ldConfigCommand.emplace_back("-X"); // Don't update links.
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index 656907a..53b68eb 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -13,11 +13,11 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
class cmOutputConverter;
@@ -156,16 +156,20 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
return false;
}
+ if (!lg.GetMakefile()->IsOn("CMAKE_CUDA_COMPILER_HAS_DEVICE_LINK_PHASE")) {
+ return false;
+ }
+
if (const char* resolveDeviceSymbols =
target.GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
// If CUDA_RESOLVE_DEVICE_SYMBOLS has been explicitly set we need
// to honor the value no matter what it is.
- return cmSystemTools::IsOn(resolveDeviceSymbols);
+ return cmIsOn(resolveDeviceSymbols);
}
if (const char* separableCompilation =
target.GetProperty("CUDA_SEPARABLE_COMPILATION")) {
- if (cmSystemTools::IsOn(separableCompilation)) {
+ if (cmIsOn(separableCompilation)) {
bool doDeviceLinking = false;
switch (target.GetType()) {
case cmStateEnums::SHARED_LIBRARY:
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 868f564..cbb1d3a 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -119,7 +119,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
return true;
}
// expand the variable into a list
- cmSystemTools::ExpandListArgument(listString, list, true);
+ cmExpandList(listString, list, true);
// if no empty elements then just return
if (std::find(list.begin(), list.end(), std::string()) == list.end()) {
return true;
@@ -132,7 +132,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
// ExpandListArgument without the true which will remove
// empty values
list.clear();
- cmSystemTools::ExpandListArgument(listString, list);
+ cmExpandList(listString, list);
std::string warn = cmPolicies::GetPolicyWarning(cmPolicies::CMP0007);
warn += " List has value = [";
warn += listString;
@@ -145,7 +145,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
// ExpandListArgument without the true which will remove
// empty values
list.clear();
- cmSystemTools::ExpandListArgument(listString, list);
+ cmExpandList(listString, list);
return true;
case cmPolicies::NEW:
return true;
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index df0d00c..7ef475a 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -7,6 +7,7 @@
#include "cmMessenger.h"
#include "cmState.h"
#include "cmStateDirectory.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include <assert.h>
@@ -483,7 +484,7 @@ std::vector<BT<std::string>> ExpandListWithBacktrace(
{
std::vector<BT<std::string>> result;
std::vector<std::string> tmp;
- cmSystemTools::ExpandListArgument(list, tmp);
+ cmExpandList(list, tmp);
result.reserve(tmp.size());
for (std::string& i : tmp) {
result.emplace_back(std::move(i), bt);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3deaeb0..159791e 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -29,7 +29,7 @@
#include "cmake.h"
#include "cmsys/RegularExpression.hxx"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# define CM_LG_ENCODE_OBJECT_NAMES
# include "cmCryptoHash.h"
#endif
@@ -311,7 +311,7 @@ void cmLocalGenerator::GenerateTestFiles()
this->Makefile->GetProperty("TEST_INCLUDE_FILES");
if (testIncludeFiles) {
std::vector<std::string> includesList;
- cmSystemTools::ExpandListArgument(testIncludeFiles, includesList);
+ cmExpandList(testIncludeFiles, includesList);
for (std::string const& i : includesList) {
fout << "include(\"" << i << "\")" << std::endl;
}
@@ -745,12 +745,10 @@ std::string cmLocalGenerator::GetIncludeFlags(
OutputFormat shellFormat = forResponseFile ? RESPONSE : SHELL;
std::ostringstream includeFlags;
- std::string flagVar = "CMAKE_INCLUDE_FLAG_";
- flagVar += lang;
- std::string const& includeFlag = this->Makefile->GetSafeDefinition(flagVar);
- flagVar = "CMAKE_INCLUDE_FLAG_SEP_";
- flagVar += lang;
- const char* sep = this->Makefile->GetDefinition(flagVar);
+ std::string const& includeFlag =
+ this->Makefile->GetSafeDefinition(cmStrCat("CMAKE_INCLUDE_FLAG_", lang));
+ const char* sep =
+ this->Makefile->GetDefinition(cmStrCat("CMAKE_INCLUDE_FLAG_SEP_", lang));
bool quotePaths = false;
if (this->Makefile->GetDefinition("CMAKE_QUOTE_INCLUDE_PATHS")) {
quotePaths = true;
@@ -767,23 +765,16 @@ std::string cmLocalGenerator::GetIncludeFlags(
// Support special system include flag if it is available and the
// normal flag is repeated for each directory.
- std::string sysFlagVar = "CMAKE_INCLUDE_SYSTEM_FLAG_";
- sysFlagVar += lang;
const char* sysIncludeFlag = nullptr;
if (repeatFlag) {
- sysIncludeFlag = this->Makefile->GetDefinition(sysFlagVar);
+ sysIncludeFlag = this->Makefile->GetDefinition(
+ cmStrCat("CMAKE_INCLUDE_SYSTEM_FLAG_", lang));
}
- std::string fwSearchFlagVar = "CMAKE_";
- fwSearchFlagVar += lang;
- fwSearchFlagVar += "_FRAMEWORK_SEARCH_FLAG";
- const char* fwSearchFlag = this->Makefile->GetDefinition(fwSearchFlagVar);
-
- std::string sysFwSearchFlagVar = "CMAKE_";
- sysFwSearchFlagVar += lang;
- sysFwSearchFlagVar += "_SYSTEM_FRAMEWORK_SEARCH_FLAG";
- const char* sysFwSearchFlag =
- this->Makefile->GetDefinition(sysFwSearchFlagVar);
+ const char* fwSearchFlag = this->Makefile->GetDefinition(
+ cmStrCat("CMAKE_", lang, "_FRAMEWORK_SEARCH_FLAG"));
+ const char* sysFwSearchFlag = this->Makefile->GetDefinition(
+ cmStrCat("CMAKE_", lang, "_SYSTEM_FRAMEWORK_SEARCH_FLAG"));
bool flagUsed = false;
std::set<std::string> emitted;
@@ -793,9 +784,8 @@ std::string cmLocalGenerator::GetIncludeFlags(
for (std::string const& i : includes) {
if (fwSearchFlag && *fwSearchFlag && this->Makefile->IsOn("APPLE") &&
cmSystemTools::IsPathToFramework(i)) {
- std::string frameworkDir = i;
- frameworkDir += "/../";
- frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
+ std::string const frameworkDir =
+ cmSystemTools::CollapseFullPath(cmStrCat(i, "/../"));
if (emitted.insert(frameworkDir).second) {
if (sysFwSearchFlag && target &&
target->IsSystemIncludeDirectory(i, config, lang)) {
@@ -910,9 +900,9 @@ void cmLocalGenerator::AddCompileOptions(std::string& flags,
std::unique_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(jmcExprGen);
std::string isJMCEnabled = cge->Evaluate(this, config);
- if (cmSystemTools::IsOn(isJMCEnabled)) {
+ if (cmIsOn(isJMCEnabled)) {
std::vector<std::string> optVec;
- cmSystemTools::ExpandListArgument(jmc, optVec);
+ cmExpandList(jmc, optVec);
this->AppendCompileOptions(flags, optVec);
}
}
@@ -963,11 +953,9 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit(
// These are intended to simulate additional implicit include directories.
std::vector<std::string> userStandardDirs;
{
- std::string key = "CMAKE_";
- key += lang;
- key += "_STANDARD_INCLUDE_DIRECTORIES";
- std::string const value = this->Makefile->GetSafeDefinition(key);
- cmSystemTools::ExpandListArgument(value, userStandardDirs);
+ std::string const value = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", lang, "_STANDARD_INCLUDE_DIRECTORIES"));
+ cmExpandList(value, userStandardDirs);
for (std::string& usd : userStandardDirs) {
cmSystemTools::ConvertToUnixSlashes(usd);
}
@@ -989,12 +977,11 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit(
// * Compilers like gfortran do not search their own implicit include
// directories for modules ('.mod' files).
if (lang != "Fortran") {
- std::string key = "CMAKE_";
- key += lang;
- key += "_IMPLICIT_INCLUDE_DIRECTORIES";
- if (const char* value = this->Makefile->GetDefinition(key)) {
+ const char* value = this->Makefile->GetDefinition(
+ cmStrCat("CMAKE_", lang, "_IMPLICIT_INCLUDE_DIRECTORIES"));
+ if (value != nullptr) {
size_t const impDirVecOldSize = impDirVec.size();
- cmSystemTools::ExpandListArgument(value, impDirVec);
+ cmExpandList(value, impDirVec);
// FIXME: Use cmRange with 'advance()' when it supports non-const.
for (size_t i = impDirVecOldSize; i < impDirVec.size(); ++i) {
cmSystemTools::ConvertToUnixSlashes(impDirVec[i]);
@@ -1210,9 +1197,8 @@ void cmLocalGenerator::GetTargetFlags(
linkFlags += " ";
}
if (!buildType.empty()) {
- std::string configLinkFlags = "LINK_FLAGS_";
- configLinkFlags += buildType;
- targetLinkFlags = target->GetProperty(configLinkFlags);
+ targetLinkFlags =
+ target->GetProperty(cmStrCat("LINK_FLAGS_", buildType));
if (targetLinkFlags) {
linkFlags += targetLinkFlags;
linkFlags += " ";
@@ -1234,9 +1220,8 @@ void cmLocalGenerator::GetTargetFlags(
this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS");
linkFlags += " ";
if (!buildType.empty()) {
- std::string build = "CMAKE_EXE_LINKER_FLAGS_";
- build += buildType;
- linkFlags += this->Makefile->GetSafeDefinition(build);
+ linkFlags += this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_EXE_LINKER_FLAGS_", buildType));
linkFlags += " ";
}
if (linkLanguage.empty()) {
@@ -1257,11 +1242,8 @@ void cmLocalGenerator::GetTargetFlags(
}
if (target->IsExecutableWithExports()) {
- std::string exportFlagVar = "CMAKE_EXE_EXPORTS_";
- exportFlagVar += linkLanguage;
- exportFlagVar += "_FLAG";
-
- linkFlags += this->Makefile->GetSafeDefinition(exportFlagVar);
+ linkFlags += this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_EXE_EXPORTS_", linkLanguage, "_FLAG"));
linkFlags += " ";
}
}
@@ -1272,8 +1254,7 @@ void cmLocalGenerator::GetTargetFlags(
frameworkPath, linkPath);
}
- if (cmSystemTools::IsOn(
- this->Makefile->GetDefinition("BUILD_SHARED_LIBS"))) {
+ if (cmIsOn(this->Makefile->GetDefinition("BUILD_SHARED_LIBS"))) {
std::string sFlagVar = std::string("CMAKE_SHARED_BUILD_") +
linkLanguage + std::string("_FLAGS");
linkFlags += this->Makefile->GetSafeDefinition(sFlagVar);
@@ -1293,9 +1274,8 @@ void cmLocalGenerator::GetTargetFlags(
linkFlags += " ";
}
if (!buildType.empty()) {
- std::string configLinkFlags = "LINK_FLAGS_";
- configLinkFlags += buildType;
- targetLinkFlags = target->GetProperty(configLinkFlags);
+ targetLinkFlags =
+ target->GetProperty(cmStrCat("LINK_FLAGS_", buildType));
if (targetLinkFlags) {
linkFlags += targetLinkFlags;
linkFlags += " ";
@@ -1470,20 +1450,12 @@ void cmLocalGenerator::OutputLinkLibraries(
}
// Add standard libraries for this language.
- std::string standardLibsVar = "CMAKE_";
- standardLibsVar += cli.GetLinkLanguage();
- standardLibsVar += "_STANDARD_LIBRARIES";
- std::string stdLibString;
- if (const char* stdLibs = this->Makefile->GetDefinition(standardLibsVar)) {
- stdLibString = stdLibs;
- }
+ std::string stdLibString = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", cli.GetLinkLanguage(), "_STANDARD_LIBRARIES"));
// Append the framework search path flags.
- std::string fwSearchFlagVar = "CMAKE_";
- fwSearchFlagVar += linkLanguage;
- fwSearchFlagVar += "_FRAMEWORK_SEARCH_FLAG";
- std::string fwSearchFlag =
- this->Makefile->GetSafeDefinition(fwSearchFlagVar);
+ std::string fwSearchFlag = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", linkLanguage, "_FRAMEWORK_SEARCH_FLAG"));
frameworkPath = linkLineComputer->ComputeFrameworkPath(cli, fwSearchFlag);
linkPath =
@@ -1538,10 +1510,8 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
}
if (add_shlib_flags) {
- std::string linkFlagsVar = "CMAKE_SHARED_LIBRARY_LINK_";
- linkFlagsVar += linkLanguage;
- linkFlagsVar += "_FLAGS";
- linkFlags = this->Makefile->GetSafeDefinition(linkFlagsVar);
+ linkFlags = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_SHARED_LIBRARY_LINK_", linkLanguage, "_FLAGS"));
}
}
return linkFlags;
@@ -1599,10 +1569,8 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
const std::string& config)
{
// Add language-specific flags.
- std::string flagsVar = "CMAKE_";
- flagsVar += lang;
- flagsVar += "_FLAGS";
- this->AddConfigVariableFlags(flags, flagsVar, config);
+ this->AddConfigVariableFlags(flags, cmStrCat("CMAKE_", lang, "_FLAGS"),
+ config);
// Add MSVC runtime library flags. This is activated by the presence
// of a default selection whether or not it is overridden by a property.
@@ -1773,10 +1741,9 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags,
// Add flags for dealing with shared libraries for this language.
if (shared) {
- flagsVar = "CMAKE_SHARED_LIBRARY_";
- flagsVar += lang;
- flagsVar += "_FLAGS";
- this->AppendFlags(flags, this->Makefile->GetDefinition(flagsVar));
+ this->AppendFlags(flags,
+ this->Makefile->GetDefinition(
+ cmStrCat("CMAKE_SHARED_LIBRARY_", lang, "_FLAGS")));
}
}
@@ -1795,7 +1762,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
std::string extProp = lang + "_EXTENSIONS";
bool ext = true;
if (const char* extPropValue = target->GetProperty(extProp)) {
- if (cmSystemTools::IsOff(extPropValue)) {
+ if (cmIsOff(extPropValue)) {
ext = false;
}
}
@@ -1810,7 +1777,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
if (const char* opt =
target->Target->GetMakefile()->GetDefinition(option_flag)) {
std::vector<std::string> optVec;
- cmSystemTools::ExpandListArgument(opt, optVec);
+ cmExpandList(opt, optVec);
for (std::string const& i : optVec) {
this->AppendFlagEscape(flags, i);
}
@@ -1839,7 +1806,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
this->IssueMessage(MessageType::FATAL_ERROR, e.str());
} else {
std::vector<std::string> optVec;
- cmSystemTools::ExpandListArgument(opt, optVec);
+ cmExpandList(opt, optVec);
for (std::string const& i : optVec) {
this->AppendFlagEscape(flags, i);
}
@@ -1900,7 +1867,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
std::string const& opt =
target->Target->GetMakefile()->GetRequiredDefinition(option_flag);
std::vector<std::string> optVec;
- cmSystemTools::ExpandListArgument(opt, optVec);
+ cmExpandList(opt, optVec);
for (std::string const& i : optVec) {
this->AppendFlagEscape(flags, i);
}
@@ -1917,7 +1884,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
if (const char* opt =
target->Target->GetMakefile()->GetDefinition(option_flag)) {
std::vector<std::string> optVec;
- cmSystemTools::ExpandListArgument(opt, optVec);
+ cmExpandList(opt, optVec);
for (std::string const& i : optVec) {
this->AppendFlagEscape(flags, i);
}
@@ -2065,9 +2032,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared,
std::string originalFlags =
this->GlobalGenerator->GetSharedLibFlagsForLanguage(lang);
if (shared) {
- std::string flagsVar = "CMAKE_SHARED_LIBRARY_";
- flagsVar += lang;
- flagsVar += "_FLAGS";
+ std::string flagsVar = cmStrCat("CMAKE_SHARED_LIBRARY_", lang, "_FLAGS");
std::string const& flags = this->Makefile->GetSafeDefinition(flagsVar);
if (flags != originalFlags) {
@@ -2106,20 +2071,16 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
std::string picFlags;
if (targetType == cmStateEnums::EXECUTABLE) {
- std::string flagsVar = "CMAKE_";
- flagsVar += lang;
- flagsVar += "_COMPILE_OPTIONS_PIE";
- picFlags = this->Makefile->GetSafeDefinition(flagsVar);
+ picFlags = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_PIE"));
}
if (picFlags.empty()) {
- std::string flagsVar = "CMAKE_";
- flagsVar += lang;
- flagsVar += "_COMPILE_OPTIONS_PIC";
- picFlags = this->Makefile->GetSafeDefinition(flagsVar);
+ picFlags = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_PIC"));
}
if (!picFlags.empty()) {
std::vector<std::string> options;
- cmSystemTools::ExpandListArgument(picFlags, options);
+ cmExpandList(picFlags, options);
for (std::string const& o : options) {
this->AppendFlagEscape(flags, o);
}
@@ -2191,7 +2152,7 @@ void cmLocalGenerator::AppendIPOLinkerFlags(std::string& flags,
}
std::vector<std::string> flagsList;
- cmSystemTools::ExpandListArgument(rawFlagsList, flagsList);
+ cmExpandList(rawFlagsList, flagsList);
for (std::string const& o : flagsList) {
this->AppendFlagEscape(flags, o);
}
@@ -2212,10 +2173,10 @@ void cmLocalGenerator::AppendPositionIndependentLinkerFlags(
return;
}
- const std::string mode = cmSystemTools::IsOn(PICValue) ? "PIE" : "NO_PIE";
+ const std::string mode = cmIsOn(PICValue) ? "PIE" : "NO_PIE";
std::string supported = "CMAKE_" + lang + "_LINK_" + mode + "_SUPPORTED";
- if (cmSystemTools::IsOff(this->Makefile->GetDefinition(supported))) {
+ if (cmIsOff(this->Makefile->GetDefinition(supported))) {
return;
}
@@ -2227,7 +2188,7 @@ void cmLocalGenerator::AppendPositionIndependentLinkerFlags(
}
std::vector<std::string> flagsList;
- cmSystemTools::ExpandListArgument(pieFlags, flagsList);
+ cmExpandList(pieFlags, flagsList);
for (const auto& flag : flagsList) {
this->AppendFlagEscape(flags, flag);
}
@@ -2244,7 +2205,7 @@ void cmLocalGenerator::AppendCompileOptions(std::string& options,
// Expand the list of options.
std::vector<std::string> options_vec;
- cmSystemTools::ExpandListArgument(options_list, options_vec);
+ cmExpandList(options_list, options_vec);
this->AppendCompileOptions(options, options_vec, regex);
}
@@ -2279,7 +2240,7 @@ void cmLocalGenerator::AppendIncludeDirectories(
// Expand the list of includes.
std::vector<std::string> includes_vec;
- cmSystemTools::ExpandListArgument(includes_list, includes_vec);
+ cmExpandList(includes_list, includes_vec);
this->AppendIncludeDirectories(includes, includes_vec, sourceFile);
}
@@ -2304,7 +2265,7 @@ void cmLocalGenerator::AppendIncludeDirectories(
std::string inc = include;
- if (!cmSystemTools::IsOff(inc)) {
+ if (!cmIsOff(inc)) {
cmSystemTools::ConvertToUnixSlashes(inc);
}
@@ -2356,10 +2317,8 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines,
// Lookup the define flag for the current language.
std::string dflag = "-D";
if (!lang.empty()) {
- std::string defineFlagVar = "CMAKE_";
- defineFlagVar += lang;
- defineFlagVar += "_DEFINE_FLAG";
- const char* df = this->Makefile->GetDefinition(defineFlagVar);
+ const char* df =
+ this->Makefile->GetDefinition(cmStrCat("CMAKE_", lang, "_DEFINE_FLAG"));
if (df && *df) {
dflag = df;
}
@@ -2405,13 +2364,11 @@ void cmLocalGenerator::AppendFeatureOptions(std::string& flags,
const std::string& lang,
const char* feature)
{
- std::string optVar = "CMAKE_";
- optVar += lang;
- optVar += "_COMPILE_OPTIONS_";
- optVar += feature;
- if (const char* optionList = this->Makefile->GetDefinition(optVar)) {
+ const char* optionList = this->Makefile->GetDefinition(
+ cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_", feature));
+ if (optionList != nullptr) {
std::vector<std::string> options;
- cmSystemTools::ExpandListArgument(optionList, options);
+ cmExpandList(optionList, options);
for (std::string const& o : options) {
this->AppendFlagEscape(flags, o);
}
@@ -2762,10 +2719,8 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
if (!replaceExt) {
std::string lang = source.GetLanguage();
if (!lang.empty()) {
- std::string repVar = "CMAKE_";
- repVar += lang;
- repVar += "_OUTPUT_EXTENSION_REPLACE";
- replaceExt = this->Makefile->IsOn(repVar);
+ replaceExt = this->Makefile->IsOn(
+ cmStrCat("CMAKE_", lang, "_OUTPUT_EXTENSION_REPLACE"));
}
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index f0c6806..455e491 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -461,7 +461,7 @@ private:
void ComputeObjectMaxPath();
};
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
bool cmLocalGeneratorCheckObjectName(std::string& objName,
std::string::size_type dir_len,
std::string::size_type max_total_len);
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 248f4a6..ec35551 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -25,6 +25,7 @@
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
#include "cmsys/FStream.hxx"
@@ -222,7 +223,7 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os)
cmGlobalNinjaGenerator::WriteComment(
os, "Pools defined by global property JOB_POOLS");
std::vector<std::string> pools;
- cmSystemTools::ExpandListArgument(jobpools, pools);
+ cmExpandList(jobpools, pools);
for (std::string const& pool : pools) {
const std::string::size_type eq = pool.find('=');
unsigned int jobs;
@@ -613,7 +614,7 @@ void cmLocalNinjaGenerator::AdditionalCleanFiles()
{
cmGeneratorExpression ge;
auto cge = ge.Parse(prop_value);
- cmSystemTools::ExpandListArgument(
+ cmExpandList(
cge->Evaluate(this,
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")),
cleanFiles);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index c6b63ba..b4ed033 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -40,7 +40,7 @@
// Include dependency scanners for supported languages. Only the
// C/C++ scanner is needed for bootstrapping CMake.
#include "cmDependsC.h"
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
# include "cmDependsFortran.h"
# include "cmDependsJava.h"
#endif
@@ -428,8 +428,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
{
std::string infoFileName = this->GetCurrentBinaryDirectory();
- infoFileName += "/CMakeFiles";
- infoFileName += "/CMakeDirectoryInformation.cmake";
+ infoFileName += "/CMakeFiles/CMakeDirectoryInformation.cmake";
// Open the output file.
cmGeneratedFileStream infoFileStream(infoFileName);
@@ -853,7 +852,7 @@ void cmLocalUnixMakefileGenerator3::AppendRuleDepend(
// it is specifically enabled by the user or project.
const char* nodep =
this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY");
- if (!nodep || cmSystemTools::IsOff(nodep)) {
+ if (!nodep || cmIsOff(nodep)) {
depends.emplace_back(ruleFileName);
}
}
@@ -1102,7 +1101,7 @@ void cmLocalUnixMakefileGenerator3::AppendDirectoryCleanCommand(
this->Makefile->GetProperty("ADDITIONAL_CLEAN_FILES")) {
cmGeneratorExpression ge;
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop_value);
- cmSystemTools::ExpandListArgument(
+ cmExpandList(
cge->Evaluate(this,
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")),
cleanFiles);
@@ -1345,8 +1344,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(
bool needRescanDirInfo = false;
{
std::string dirInfoFile = this->GetCurrentBinaryDirectory();
- dirInfoFile += "/CMakeFiles";
- dirInfoFile += "/CMakeDirectoryInformation.cmake";
+ dirInfoFile += "/CMakeFiles/CMakeDirectoryInformation.cmake";
int result;
if (!ftc->Compare(internalDependFile, dirInfoFile, &result) ||
result < 0) {
@@ -1411,8 +1409,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
bool haveDirectoryInfo = false;
{
std::string dirInfoFile = this->GetCurrentBinaryDirectory();
- dirInfoFile += "/CMakeFiles";
- dirInfoFile += "/CMakeDirectoryInformation.cmake";
+ dirInfoFile += "/CMakeFiles/CMakeDirectoryInformation.cmake";
if (mf->ReadListFile(dirInfoFile) &&
!cmSystemTools::GetErrorOccuredFlag()) {
haveDirectoryInfo = true;
@@ -1423,7 +1420,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
if (haveDirectoryInfo) {
// Test whether we need to force Unix paths.
if (const char* force = mf->GetDefinition("CMAKE_FORCE_UNIX_PATHS")) {
- if (!cmSystemTools::IsOff(force)) {
+ if (!cmIsOff(force)) {
cmSystemTools::SetForceUnixPaths(true);
}
}
@@ -1466,8 +1463,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
// for each language we need to scan, scan it
std::vector<std::string> langs;
- cmSystemTools::ExpandListArgument(
- mf->GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES"), langs);
+ cmExpandList(mf->GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES"), langs);
for (std::string const& lang : langs) {
// construct the checker
// Create the scanner for this language
@@ -1477,7 +1473,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
// TODO: Handle RC (resource files) dependencies correctly.
scanner = cm::make_unique<cmDependsC>(this, targetDir, lang, &validDeps);
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
else if (lang == "Fortran") {
ruleFileStream << "# Note that incremental build could trigger "
<< "a call to cmake_copy_f90_mod on each re-build\n";
@@ -1512,7 +1508,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose)
// Convert the string to a list and preserve empty entries.
std::vector<std::string> pairs;
- cmSystemTools::ExpandListArgument(pairs_string, pairs, true);
+ cmExpandList(pairs_string, pairs, true);
for (std::vector<std::string>::const_iterator i = pairs.begin();
i != pairs.end() && (i + 1) != pairs.end();) {
const std::string& depender = *i++;
@@ -1642,8 +1638,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
progCmd << this->ConvertToOutputFormat(
cmSystemTools::CollapseFullPath(progressDir), cmOutputConverter::SHELL);
- std::string progressFile = "/CMakeFiles";
- progressFile += "/progress.marks";
+ std::string progressFile = "/CMakeFiles/progress.marks";
std::string progressFileNameFull = this->ConvertToFullPath(progressFile);
progCmd << " "
<< this->ConvertToOutputFormat(
@@ -1651,8 +1646,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
cmOutputConverter::SHELL);
commands.push_back(progCmd.str());
}
- std::string mf2Dir = "CMakeFiles/";
- mf2Dir += "Makefile2";
+ std::string mf2Dir = "CMakeFiles/Makefile2";
commands.push_back(this->GetRecursiveMakeCall(mf2Dir, recursiveTarget));
this->CreateCDCommand(commands, this->GetBinaryDirectory(),
this->GetCurrentBinaryDirectory());
@@ -1690,7 +1684,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
depends.clear();
const char* noall =
this->Makefile->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
- if (!noall || cmSystemTools::IsOff(noall)) {
+ if (!noall || cmIsOff(noall)) {
// Drive the build before installing.
depends.emplace_back("all");
} else if (regenerate) {
@@ -1744,7 +1738,7 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf,
return;
}
std::vector<std::string> files;
- cmSystemTools::ExpandListArgument(infoDef, files);
+ cmExpandList(infoDef, files);
// Each depend information file corresponds to a target. Clear the
// dependencies for that target.
@@ -1912,11 +1906,11 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
std::vector<std::string> transformRules;
if (const char* xform =
this->Makefile->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")) {
- cmSystemTools::ExpandListArgument(xform, transformRules);
+ cmExpandList(xform, transformRules);
}
if (const char* xform =
target->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")) {
- cmSystemTools::ExpandListArgument(xform, transformRules);
+ cmExpandList(xform, transformRules);
}
if (!transformRules.empty()) {
cmakefileStream << "set(CMAKE_INCLUDE_TRANSFORMS\n";
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 8154f3e..893e14e 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -98,8 +98,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
force_commands.push_back(force_command);
std::string no_main_dependency;
std::string force = this->GetCurrentBinaryDirectory();
- force += "/CMakeFiles";
- force += "/";
+ force += "/CMakeFiles/";
force += l->GetName();
force += "_force";
if (cmSourceFile* file = this->Makefile->AddCustomCommandToOutput(
@@ -147,8 +146,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
std::string stampName = this->GetCurrentBinaryDirectory();
stampName += "/CMakeFiles";
cmSystemTools::MakeDirectory(stampName.c_str());
- stampName += "/";
- stampName += "generate.stamp";
+ stampName += "/generate.stamp";
cmsys::ofstream stamp(stampName.c_str());
stamp << "# CMake generation timestamp file for this directory.\n";
@@ -1526,7 +1524,7 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
// Check for extra object-file dependencies.
if (const char* deps = sf.GetProperty("OBJECT_DEPENDS")) {
std::vector<std::string> depends;
- cmSystemTools::ExpandListArgument(deps, depends);
+ cmExpandList(deps, depends);
const char* sep = "";
for (std::vector<std::string>::iterator j = depends.begin();
j != depends.end(); ++j) {
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 86a002f..992fc1b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -47,7 +47,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
# include "cmVariableWatch.h"
#endif
@@ -97,7 +97,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
// cmListFileCache in the top level if necessary.
this->CheckCMP0000 = false;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->AddSourceGroup("", "^.*$");
this->AddSourceGroup("Source Files", CM_SOURCE_REGEX);
this->AddSourceGroup("Header Files", CM_HEADER_REGEX);
@@ -1182,8 +1182,7 @@ cmTarget* cmMakefile::AddUtilityCommand(
// Store the custom command in the target.
if (!commandLines.empty() || !depends.empty()) {
std::string force = this->GetCurrentBinaryDirectory();
- force += "/CMakeFiles";
- force += "/";
+ force += "/CMakeFiles/";
force += utilityName;
std::vector<std::string> forced;
forced.push_back(force);
@@ -1349,7 +1348,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
if (const char* cdefs = this->GetProperty("COMPILE_DEFINITIONS")) {
// Expand the list.
std::vector<std::string> defs;
- cmSystemTools::ExpandListArgument(cdefs, defs);
+ cmExpandList(cdefs, defs);
// Recompose the list without the definition.
std::vector<std::string>::const_iterator defEnd =
@@ -1425,7 +1424,7 @@ void cmMakefile::PushFunctionScope(std::string const& fileName,
this->PushLoopBlockBarrier();
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->GetGlobalGenerator()->GetFileLockPool().PushFunctionScope();
#endif
@@ -1442,7 +1441,7 @@ void cmMakefile::PopFunctionScope(bool reportError)
this->PopFunctionBlockerBarrier(reportError);
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->GetGlobalGenerator()->GetFileLockPool().PopFunctionScope();
#endif
@@ -1497,7 +1496,7 @@ public:
this->Snapshot = this->GG->GetCMakeInstance()->GetCurrentSnapshot();
this->GG->GetCMakeInstance()->SetCurrentSnapshot(this->Snapshot);
this->GG->SetCurrentMakefile(mf);
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->GG->GetFileLockPool().PushFileScope();
#endif
}
@@ -1506,7 +1505,7 @@ public:
{
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
this->Makefile->PopSnapshot(this->ReportError);
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->GG->GetFileLockPool().PopFileScope();
#endif
this->GG->SetCurrentMakefile(this->CurrentMakefile);
@@ -1800,7 +1799,7 @@ void cmMakefile::AddDefinition(const std::string& name, cm::string_view value)
}
this->StateSnapshot.SetDefinition(name, value);
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmVariableWatch* vv = this->GetVariableWatch();
if (vv) {
vv->VariableAccessed(name, cmVariableWatch::VARIABLE_MODIFIED_ACCESS,
@@ -1837,10 +1836,10 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
std::vector<std::string> files;
nvalue = value ? value : "";
- cmSystemTools::ExpandListArgument(nvalue, files);
+ cmExpandList(nvalue, files);
nvalue.clear();
for (cc = 0; cc < files.size(); cc++) {
- if (!cmSystemTools::IsOff(files[cc])) {
+ if (!cmIsOff(files[cc])) {
files[cc] = cmSystemTools::CollapseFullPath(files[cc]);
}
if (cc > 0) {
@@ -1921,7 +1920,7 @@ void cmMakefile::RemoveDefinition(const std::string& name)
this->LogUnused("unsetting", name);
}
this->StateSnapshot.RemoveDefinition(name);
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmVariableWatch* vv = this->GetVariableWatch();
if (vv) {
vv->VariableAccessed(name, cmVariableWatch::VARIABLE_REMOVED_ACCESS,
@@ -1953,7 +1952,7 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target)
if (const char* linkLibsProp = this->GetProperty("LINK_LIBRARIES")) {
std::vector<std::string> linkLibs;
- cmSystemTools::ExpandListArgument(linkLibsProp, linkLibs);
+ cmExpandList(linkLibsProp, linkLibs);
for (std::vector<std::string>::iterator j = linkLibs.begin();
j != linkLibs.end(); ++j) {
@@ -2079,7 +2078,7 @@ cmSourceFile* cmMakefile::GetSourceFileWithOutput(
return nullptr;
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
cmSourceGroup* cmMakefile::GetSourceGroup(
const std::vector<std::string>& name) const
{
@@ -2281,7 +2280,7 @@ void cmMakefile::ExpandVariablesCMP0019()
if (const char* linkLibsProp = this->GetProperty("LINK_LIBRARIES")) {
std::vector<std::string> linkLibs;
- cmSystemTools::ExpandListArgument(linkLibsProp, linkLibs);
+ cmExpandList(linkLibsProp, linkLibs);
for (std::vector<std::string>::iterator l = linkLibs.begin();
l != linkLibs.end(); ++l) {
@@ -2324,7 +2323,7 @@ void cmMakefile::ExpandVariablesCMP0019()
bool cmMakefile::IsOn(const std::string& name) const
{
const char* value = this->GetDefinition(name);
- return cmSystemTools::IsOn(value);
+ return cmIsOn(value);
}
bool cmMakefile::IsSet(const std::string& name) const
@@ -2338,7 +2337,7 @@ bool cmMakefile::IsSet(const std::string& name) const
return false;
}
- if (cmSystemTools::IsNOTFOUND(value)) {
+ if (cmIsNOTFOUND(value)) {
return false;
}
@@ -2460,7 +2459,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const
if (!def) {
def = this->GetState()->GetInitializedCacheValue(name);
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
if (cmVariableWatch* vv = this->GetVariableWatch()) {
if (!def) {
vv->VariableAccessed(
@@ -2477,7 +2476,7 @@ const std::string* cmMakefile::GetDef(const std::string& name) const
if (!def) {
def = this->GetState()->GetInitializedCacheValue(name);
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmVariableWatch* vv = this->GetVariableWatch();
if (vv && !this->SuppressSideEffects) {
bool const watch_function_executed =
@@ -3050,7 +3049,7 @@ std::string cmMakefile::GetConfigurations(std::vector<std::string>& configs,
if (this->GetGlobalGenerator()->IsMultiConfig()) {
if (const char* configTypes =
this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
- cmSystemTools::ExpandListArgument(configTypes, configs);
+ cmExpandList(configTypes, configs);
}
return "";
}
@@ -3167,7 +3166,7 @@ bool cmMakefile::ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
if (i.Delim == cmListFileArgument::Quoted) {
outArgs.push_back(value);
} else {
- cmSystemTools::ExpandListArgument(value, outArgs);
+ cmExpandList(value, outArgs);
}
}
return !cmSystemTools::GetFatalErrorOccured();
@@ -3200,7 +3199,7 @@ bool cmMakefile::ExpandArguments(
outArgs.emplace_back(value, true);
} else {
std::vector<std::string> stringArgs;
- cmSystemTools::ExpandListArgument(value, stringArgs);
+ cmExpandList(value, stringArgs);
for (std::string const& stringArg : stringArgs) {
outArgs.emplace_back(stringArg, false);
}
@@ -3327,7 +3326,7 @@ void cmMakefile::AddTargetObject(std::string const& tgtName,
cmSourceFile* sf = this->GetOrCreateSource(objFile, true);
sf->SetObjectLibrary(tgtName);
sf->SetProperty("EXTERNAL_OBJECT", "1");
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->SourceGroups[this->ObjectLibrariesSourceGroupIndex].AddGroupFile(
sf->GetFullPath());
#endif
@@ -3509,7 +3508,7 @@ cmGlobalGenerator* cmMakefile::GetGlobalGenerator() const
return this->GlobalGenerator;
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmVariableWatch* cmMakefile::GetVariableWatch() const
{
if (this->GetCMakeInstance() &&
@@ -3558,7 +3557,7 @@ std::string cmMakefile::GetModulesFile(const std::string& filename,
const char* cmakeModulePath = this->GetDefinition("CMAKE_MODULE_PATH");
if (cmakeModulePath) {
std::vector<std::string> modulePath;
- cmSystemTools::ExpandListArgument(cmakeModulePath, modulePath);
+ cmExpandList(cmakeModulePath, modulePath);
// Look through the possible module directories.
for (std::string itempl : modulePath) {
@@ -3650,7 +3649,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
// Replace #cmakedefine instances.
if (this->cmDefineRegex.find(line)) {
const char* def = this->GetDefinition(this->cmDefineRegex.match(2));
- if (!cmSystemTools::IsOff(def)) {
+ if (!cmIsOff(def)) {
const std::string indentation = this->cmDefineRegex.match(1);
cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine",
"#" + indentation + "define");
@@ -3666,7 +3665,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine01",
"#" + indentation + "define");
output += line;
- if (!cmSystemTools::IsOff(def)) {
+ if (!cmIsOff(def)) {
output += " 1";
} else {
output += " 0";
@@ -3830,7 +3829,7 @@ const char* cmMakefile::GetProperty(const std::string& prop, bool chain) const
bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
{
- return cmSystemTools::IsOn(this->GetProperty(prop));
+ return cmIsOn(this->GetProperty(prop));
}
std::vector<std::string> cmMakefile::GetPropertyKeys() const
@@ -3883,7 +3882,7 @@ void cmMakefile::AddCMakeDependFilesFromUser()
{
std::vector<std::string> deps;
if (const char* deps_str = this->GetProperty("CMAKE_CONFIGURE_DEPENDS")) {
- cmSystemTools::ExpandListArgument(deps_str, deps);
+ cmExpandList(deps_str, deps);
}
for (std::string const& dep : deps) {
if (cmSystemTools::FileIsFullPath(dep)) {
@@ -3931,14 +3930,14 @@ void cmMakefile::PushScope()
this->GetState()->CreateVariableScopeSnapshot(this->StateSnapshot);
this->PushLoopBlockBarrier();
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->GetGlobalGenerator()->GetFileLockPool().PushFunctionScope();
#endif
}
void cmMakefile::PopScope()
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->GetGlobalGenerator()->GetFileLockPool().PopFunctionScope();
#endif
@@ -3962,7 +3961,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char* varDef)
return;
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmVariableWatch* vv = this->GetVariableWatch();
if (vv) {
vv->VariableAccessed(var, cmVariableWatch::VARIABLE_MODIFIED_ACCESS,
@@ -4220,7 +4219,7 @@ bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var)
{
// Check for an explicit CMAKE_POLICY_WARNING_CMP<NNNN> setting.
if (const char* val = this->GetDefinition(var)) {
- return cmSystemTools::IsOn(val);
+ return cmIsOn(val);
}
// Enable optional policy warnings with --debug-output, --trace,
// or --trace-expand.
@@ -4378,7 +4377,7 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target,
}
std::vector<std::string> availableFeatures;
- cmSystemTools::ExpandListArgument(features, availableFeatures);
+ cmExpandList(features, availableFeatures);
if (std::find(availableFeatures.begin(), availableFeatures.end(), feature) ==
availableFeatures.end()) {
std::ostringstream e;
@@ -4648,31 +4647,31 @@ void cmMakefile::CheckNeededCxxLanguage(const std::string& feature,
if (const char* propCxx98 =
this->GetDefinition("CMAKE_CXX98_COMPILE_FEATURES")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(propCxx98, props);
+ cmExpandList(propCxx98, props);
needCxx98 = std::find(props.begin(), props.end(), feature) != props.end();
}
if (const char* propCxx11 =
this->GetDefinition("CMAKE_CXX11_COMPILE_FEATURES")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(propCxx11, props);
+ cmExpandList(propCxx11, props);
needCxx11 = std::find(props.begin(), props.end(), feature) != props.end();
}
if (const char* propCxx14 =
this->GetDefinition("CMAKE_CXX14_COMPILE_FEATURES")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(propCxx14, props);
+ cmExpandList(propCxx14, props);
needCxx14 = std::find(props.begin(), props.end(), feature) != props.end();
}
if (const char* propCxx17 =
this->GetDefinition("CMAKE_CXX17_COMPILE_FEATURES")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(propCxx17, props);
+ cmExpandList(propCxx17, props);
needCxx17 = std::find(props.begin(), props.end(), feature) != props.end();
}
if (const char* propCxx20 =
this->GetDefinition("CMAKE_CXX20_COMPILE_FEATURES")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(propCxx20, props);
+ cmExpandList(propCxx20, props);
needCxx20 = std::find(props.begin(), props.end(), feature) != props.end();
}
}
@@ -4772,19 +4771,19 @@ void cmMakefile::CheckNeededCLanguage(const std::string& feature,
if (const char* propC90 =
this->GetDefinition("CMAKE_C90_COMPILE_FEATURES")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(propC90, props);
+ cmExpandList(propC90, props);
needC90 = std::find(props.begin(), props.end(), feature) != props.end();
}
if (const char* propC99 =
this->GetDefinition("CMAKE_C99_COMPILE_FEATURES")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(propC99, props);
+ cmExpandList(propC99, props);
needC99 = std::find(props.begin(), props.end(), feature) != props.end();
}
if (const char* propC11 =
this->GetDefinition("CMAKE_C11_COMPILE_FEATURES")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(propC11, props);
+ cmExpandList(propC11, props);
needC11 = std::find(props.begin(), props.end(), feature) != props.end();
}
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 4d61c05..a6d1757 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -30,7 +30,7 @@
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmSourceGroup.h"
#endif
@@ -503,7 +503,7 @@ public:
*/
bool CanIWriteThisFile(std::string const& fileName) const;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
/**
* Get the vector source groups.
*/
@@ -649,7 +649,7 @@ public:
* Get the variable watch. This is used to determine when certain variables
* are accessed.
*/
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmVariableWatch* GetVariableWatch() const;
#endif
@@ -945,7 +945,7 @@ protected:
// Track the value of the computed DEFINITIONS property.
std::string DefineFlagsOrig;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
std::vector<cmSourceGroup> SourceGroups;
size_t ObjectLibrariesSourceGroupIndex;
#endif
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 19c667e..097ce45 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -83,7 +83,7 @@ void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
bool relink)
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
const bool requiresDeviceLinking = requireDeviceLinking(
*this->GeneratorTarget, *this->LocalGenerator, this->ConfigName);
if (!requiresDeviceLinking) {
@@ -165,7 +165,7 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
const std::string linkRuleVar = "CMAKE_CUDA_DEVICE_LINK_EXECUTABLE";
const std::string linkRule = this->GetLinkRule(linkRuleVar);
std::vector<std::string> commands1;
- cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
+ cmExpandList(linkRule, real_link_commands);
bool useResponseFileForObjects =
this->CheckUseResponseFileForObjects(linkLanguage);
@@ -297,14 +297,13 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
if (this->GeneratorTarget->IsAppBundleOnApple()) {
this->OSXBundleGenerator->CreateAppBundle(targetNames.Output, outpath);
}
- outpath += "/";
+ outpath += '/';
std::string outpathImp;
if (relink) {
outpath = this->Makefile->GetCurrentBinaryDirectory();
- outpath += "/CMakeFiles";
- outpath += "/CMakeRelink.dir";
+ outpath += "/CMakeFiles/CMakeRelink.dir";
cmSystemTools::MakeDirectory(outpath);
- outpath += "/";
+ outpath += '/';
if (!targetNames.ImportLibrary.empty()) {
outpathImp = outpath;
}
@@ -314,7 +313,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
outpathImp = this->GeneratorTarget->GetDirectory(
this->ConfigName, cmStateEnums::ImportLibraryArtifact);
cmSystemTools::MakeDirectory(outpathImp);
- outpathImp += "/";
+ outpathImp += '/';
}
}
@@ -325,7 +324,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string pdbOutputPath =
this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
cmSystemTools::MakeDirectory(pdbOutputPath);
- pdbOutputPath += "/";
+ pdbOutputPath += '/';
std::string targetFullPath = outpath + targetNames.Output;
std::string targetFullPathReal = outpath + targetNames.Real;
@@ -488,7 +487,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
linkLanguage, this->ConfigName);
std::string linkRule = this->GetLinkRule(linkRuleVar);
std::vector<std::string> commands1;
- cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
+ cmExpandList(linkRule, real_link_commands);
if (this->GeneratorTarget->IsExecutableWithExports()) {
// If a separate rule for creating an import library is specified
// add it now.
@@ -496,7 +495,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
implibRuleVar += linkLanguage;
implibRuleVar += "_CREATE_IMPORT_LIBRARY";
if (const char* rule = this->Makefile->GetDefinition(implibRuleVar)) {
- cmSystemTools::ExpandListArgument(rule, real_link_commands);
+ cmExpandList(rule, real_link_commands);
}
}
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 8d342f3..45c74cb 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -236,7 +236,7 @@ void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
const std::string& linkRuleVar, bool relink)
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
// TODO: Merge the methods that call this method to avoid
// code duplication.
std::vector<std::string> commands;
@@ -370,7 +370,7 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
// Construct the main link rule and expand placeholders.
rulePlaceholderExpander->SetTargetImpLib(targetOutputReal);
std::string linkRule = this->GetLinkRule(linkRuleVar);
- cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
+ cmExpandList(linkRule, real_link_commands);
// Expand placeholders.
for (std::string& real_link_command : real_link_commands) {
@@ -465,30 +465,29 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
this->OSXBundleGenerator->CreateFramework(this->TargetNames.Output,
outpath);
- outpath += "/";
+ outpath += '/';
} else if (this->GeneratorTarget->IsCFBundleOnApple()) {
outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
this->OSXBundleGenerator->CreateCFBundle(this->TargetNames.Output,
outpath);
- outpath += "/";
+ outpath += '/';
} else if (relink) {
outpath = this->Makefile->GetCurrentBinaryDirectory();
- outpath += "/CMakeFiles";
- outpath += "/CMakeRelink.dir";
+ outpath += "/CMakeFiles/CMakeRelink.dir";
cmSystemTools::MakeDirectory(outpath);
- outpath += "/";
+ outpath += '/';
if (!this->TargetNames.ImportLibrary.empty()) {
outpathImp = outpath;
}
} else {
outpath = this->GeneratorTarget->GetDirectory(this->ConfigName);
cmSystemTools::MakeDirectory(outpath);
- outpath += "/";
+ outpath += '/';
if (!this->TargetNames.ImportLibrary.empty()) {
outpathImp = this->GeneratorTarget->GetDirectory(
this->ConfigName, cmStateEnums::ImportLibraryArtifact);
cmSystemTools::MakeDirectory(outpathImp);
- outpathImp += "/";
+ outpathImp += '/';
}
}
@@ -650,7 +649,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
arCreateVar, linkLanguage, this->ConfigName);
if (const char* rule = this->Makefile->GetDefinition(arCreateVar)) {
- cmSystemTools::ExpandListArgument(rule, archiveCreateCommands);
+ cmExpandList(rule, archiveCreateCommands);
}
std::string arAppendVar = "CMAKE_";
arAppendVar += linkLanguage;
@@ -660,7 +659,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
arAppendVar, linkLanguage, this->ConfigName);
if (const char* rule = this->Makefile->GetDefinition(arAppendVar)) {
- cmSystemTools::ExpandListArgument(rule, archiveAppendCommands);
+ cmExpandList(rule, archiveAppendCommands);
}
std::string arFinishVar = "CMAKE_";
arFinishVar += linkLanguage;
@@ -670,7 +669,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
arFinishVar, linkLanguage, this->ConfigName);
if (const char* rule = this->Makefile->GetDefinition(arFinishVar)) {
- cmSystemTools::ExpandListArgument(rule, archiveFinishCommands);
+ cmExpandList(rule, archiveFinishCommands);
}
}
@@ -880,7 +879,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
} else {
// Get the set of commands.
std::string linkRule = this->GetLinkRule(linkRuleVar);
- cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
+ cmExpandList(linkRule, real_link_commands);
if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE") &&
(this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY)) {
std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat(
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 7b26324..f35df32 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -49,7 +49,7 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
this->NoRuleMessages = false;
if (const char* ruleStatus =
cm->GetState()->GetGlobalProperty("RULE_MESSAGES")) {
- this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
+ this->NoRuleMessages = cmIsOff(ruleStatus);
}
MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
}
@@ -159,10 +159,9 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
std::vector<std::string> files;
cmGeneratorExpression ge;
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop_value);
- cmSystemTools::ExpandListArgument(
- cge->Evaluate(this->LocalGenerator, config, false, this->GeneratorTarget,
- nullptr, nullptr),
- files);
+ cmExpandList(cge->Evaluate(this->LocalGenerator, config, false,
+ this->GeneratorTarget, nullptr, nullptr),
+ files);
return files;
};
@@ -187,7 +186,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
// add custom commands to the clean rules?
const char* clean_no_custom = this->Makefile->GetProperty("CLEAN_NO_CUSTOM");
- bool clean = cmSystemTools::IsOff(clean_no_custom);
+ bool clean = cmIsOff(clean_no_custom);
// First generate the object rule files. Save a list of all object
// files for this target.
@@ -680,12 +679,12 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
}
const std::string& compileRule =
this->Makefile->GetRequiredDefinition(cmdVar);
- cmSystemTools::ExpandListArgument(compileRule, compileCommands);
+ cmExpandList(compileRule, compileCommands);
} else {
const std::string cmdVar = "CMAKE_" + lang + "_COMPILE_OBJECT";
const std::string& compileRule =
this->Makefile->GetRequiredDefinition(cmdVar);
- cmSystemTools::ExpandListArgument(compileRule, compileCommands);
+ cmExpandList(compileRule, compileCommands);
}
if (this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS") &&
@@ -783,7 +782,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
// goes to the beginning of the command line.
if (!compileCommands.empty() && !compilerLauncher.empty()) {
std::vector<std::string> args;
- cmSystemTools::ExpandListArgument(compilerLauncher, args, true);
+ cmExpandList(compilerLauncher, args, true);
if (!args.empty()) {
args[0] = this->LocalGenerator->ConvertToOutputFormat(
args[0], cmOutputConverter::SHELL);
@@ -822,7 +821,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
std::vector<std::string> outputs(1, relativeObj);
if (const char* extra_outputs_str = source.GetProperty("OBJECT_OUTPUTS")) {
// Register these as extra files to clean.
- cmSystemTools::ExpandListArgument(extra_outputs_str, outputs);
+ cmExpandList(extra_outputs_str, outputs);
this->CleanFiles.insert(outputs.begin() + 1, outputs.end());
}
@@ -860,7 +859,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
if (const char* preprocessRule =
this->Makefile->GetDefinition(preprocessRuleVar)) {
std::vector<std::string> preprocessCommands;
- cmSystemTools::ExpandListArgument(preprocessRule, preprocessCommands);
+ cmExpandList(preprocessRule, preprocessCommands);
std::string shellObjI = this->LocalGenerator->ConvertToOutputFormat(
objI, cmOutputConverter::SHELL);
@@ -907,7 +906,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
if (const char* assemblyRule =
this->Makefile->GetDefinition(assemblyRuleVar)) {
std::vector<std::string> assemblyCommands;
- cmSystemTools::ExpandListArgument(assemblyRule, assemblyCommands);
+ cmExpandList(assemblyRule, assemblyCommands);
std::string shellObjS = this->LocalGenerator->ConvertToOutputFormat(
objS, cmOutputConverter::SHELL);
@@ -1182,7 +1181,7 @@ void cmMakefileTargetGenerator::WriteObjectDependRules(
// shared between the object file and dependency scanning rule.
depends.push_back(source.GetFullPath());
if (const char* objectDeps = source.GetProperty("OBJECT_DEPENDS")) {
- cmSystemTools::ExpandListArgument(objectDeps, depends);
+ cmExpandList(objectDeps, depends);
}
}
@@ -1529,7 +1528,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
"CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_OBJECTS";
if (const char* val = this->Makefile->GetDefinition(responseVar)) {
if (*val) {
- return cmSystemTools::IsOn(val);
+ return cmIsOn(val);
}
}
@@ -1568,7 +1567,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForLibraries(
"CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_LIBRARIES";
if (const char* val = this->Makefile->GetDefinition(responseVar)) {
if (*val) {
- return cmSystemTools::IsOn(val);
+ return cmIsOn(val);
}
}
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx
index 66d3c88..dec32fa 100644
--- a/Source/cmMessageCommand.cxx
+++ b/Source/cmMessageCommand.cxx
@@ -104,10 +104,9 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
// Check if any indentation has requested:
// `CMAKE_MESSAGE_INDENT` is a list of "padding" pieces
// to be joined and prepended to the message lines.
- auto indent =
- cmJoin(cmSystemTools::ExpandedListArgument(
- this->Makefile->GetSafeDefinition("CMAKE_MESSAGE_INDENT")),
- "");
+ auto indent = cmJoin(cmExpandedList(this->Makefile->GetSafeDefinition(
+ "CMAKE_MESSAGE_INDENT")),
+ "");
// Make every line of the `message` indented
// NOTE Can't reuse `cmDocumentationFormatter::PrintPreformatted`
// here cuz it appends `\n` to the EOM ;-(
diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx
index 07d011e..af83478 100644
--- a/Source/cmMessenger.cxx
+++ b/Source/cmMessenger.cxx
@@ -6,7 +6,7 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmsys/SystemInformation.hxx"
#endif
@@ -106,7 +106,7 @@ void displayMessage(MessageType t, std::ostringstream& msg)
// Add a terminating blank line.
msg << "\n";
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
// Add a C++ stack trace to internal errors.
if (t == MessageType::INTERNAL_ERROR) {
std::string stack = cmsys::SystemInformation::GetProgramStack(0, 0);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 865ae7d..4ebeb60 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -440,12 +440,12 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeDeviceLinkCmd()
case cmStateEnums::MODULE_LIBRARY: {
const std::string cudaLinkCmd(
this->GetMakefile()->GetDefinition("CMAKE_CUDA_DEVICE_LINK_LIBRARY"));
- cmSystemTools::ExpandListArgument(cudaLinkCmd, linkCmds);
+ cmExpandList(cudaLinkCmd, linkCmds);
} break;
case cmStateEnums::EXECUTABLE: {
const std::string cudaLinkCmd(this->GetMakefile()->GetDefinition(
"CMAKE_CUDA_DEVICE_LINK_EXECUTABLE"));
- cmSystemTools::ExpandListArgument(cudaLinkCmd, linkCmds);
+ cmExpandList(cudaLinkCmd, linkCmds);
} break;
default:
break;
@@ -474,7 +474,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
linkCmdStr += rule;
}
}
- cmSystemTools::ExpandListArgument(linkCmdStr, linkCmds);
+ cmExpandList(linkCmdStr, linkCmds);
if (this->GetGeneratorTarget()->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
std::string cmakeCommand =
this->GetLocalGenerator()->ConvertToOutputFormat(
@@ -510,7 +510,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
linkCmdVar, this->TargetLinkLanguage, this->GetConfigName());
std::string const& linkCmd = mf->GetRequiredDefinition(linkCmdVar);
- cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
+ cmExpandList(linkCmd, linkCmds);
}
{
std::string linkCmdVar = "CMAKE_";
@@ -521,7 +521,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
linkCmdVar, this->TargetLinkLanguage, this->GetConfigName());
std::string const& linkCmd = mf->GetRequiredDefinition(linkCmdVar);
- cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
+ cmExpandList(linkCmd, linkCmds);
}
#ifdef __APPLE__
// On macOS ranlib truncates the fractional part of the static archive
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c3459be..64b2bf6 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -548,8 +548,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
// Lookup the explicit preprocessing rule.
std::string ppVar = "CMAKE_" + lang;
ppVar += "_PREPROCESS_SOURCE";
- cmSystemTools::ExpandListArgument(
- this->GetMakefile()->GetRequiredDefinition(ppVar), ppCmds);
+ cmExpandList(this->GetMakefile()->GetRequiredDefinition(ppVar), ppCmds);
}
for (std::string& i : ppCmds) {
@@ -686,11 +685,11 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
cmdVar = "CMAKE_CUDA_COMPILE_WHOLE_COMPILATION";
}
const std::string& compileCmd = mf->GetRequiredDefinition(cmdVar);
- cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ cmExpandList(compileCmd, compileCmds);
} else {
const std::string cmdVar = "CMAKE_" + lang + "_COMPILE_OBJECT";
const std::string& compileCmd = mf->GetRequiredDefinition(cmdVar);
- cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ cmExpandList(compileCmd, compileCmds);
}
// See if we need to use a compiler launcher like ccache or distcc
@@ -754,7 +753,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
// goes to the beginning of the command line.
if (!compileCmds.empty() && !compilerLauncher.empty()) {
std::vector<std::string> args;
- cmSystemTools::ExpandListArgument(compilerLauncher, args, true);
+ cmExpandList(compilerLauncher, args, true);
if (!args.empty()) {
args[0] = this->LocalGenerator->ConvertToOutputFormat(
args[0], cmOutputConverter::SHELL);
@@ -998,8 +997,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
objBuild.ExplicitDeps.push_back(sourceFileName);
if (const char* objectDeps = source->GetProperty("OBJECT_DEPENDS")) {
- std::vector<std::string> depList =
- cmSystemTools::ExpandedListArgument(objectDeps);
+ std::vector<std::string> depList = cmExpandedList(objectDeps);
for (std::string& odi : depList) {
if (cmSystemTools::FileIsFullPath(odi)) {
odi = cmSystemTools::CollapseFullPath(odi);
@@ -1152,7 +1150,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
if (const char* objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) {
cmNinjaBuild build("phony");
build.Comment = "Additional output files.";
- build.Outputs = cmSystemTools::ExpandedListArgument(objectOutputs);
+ build.Outputs = cmExpandedList(objectOutputs);
std::transform(build.Outputs.begin(), build.Outputs.end(),
build.Outputs.begin(), MapToNinjaPath());
build.ExplicitDeps = objBuild.Outputs;
@@ -1301,12 +1299,12 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
}
const std::string& compileCmd =
this->GetMakefile()->GetRequiredDefinition(cmdVar);
- cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ cmExpandList(compileCmd, compileCmds);
} else {
const std::string cmdVar = "CMAKE_" + language + "_COMPILE_OBJECT";
const std::string& compileCmd =
this->GetMakefile()->GetRequiredDefinition(cmdVar);
- cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ cmExpandList(compileCmd, compileCmds);
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
@@ -1333,11 +1331,10 @@ void cmNinjaTargetGenerator::AdditionalCleanFiles()
{
cmGeneratorExpression ge;
auto cge = ge.Parse(prop_value);
- cmSystemTools::ExpandListArgument(
- cge->Evaluate(lg,
- this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"),
- false, this->GeneratorTarget, nullptr, nullptr),
- cleanFiles);
+ cmExpandList(cge->Evaluate(
+ lg, this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"),
+ false, this->GeneratorTarget, nullptr, nullptr),
+ cleanFiles);
}
std::string const& binaryDir = lg->GetCurrentBinaryDirectory();
cmGlobalNinjaGenerator* gg = lg->GetGlobalNinjaGenerator();
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 1225cbd..8fca4c0 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -37,8 +37,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
cmGeneratorTarget* genTarget = this->GetGeneratorTarget();
std::string utilCommandName = lg->GetCurrentBinaryDirectory();
- utilCommandName += "/CMakeFiles";
- utilCommandName += "/";
+ utilCommandName += "/CMakeFiles/";
utilCommandName += this->GetTargetName() + ".util";
utilCommandName = this->ConvertToNinjaPath(utilCommandName);
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index 3724ba7..a30f487 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -11,7 +11,6 @@
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
class cmExecutionStatus;
@@ -67,7 +66,7 @@ bool cmOptionCommand::InitialPass(std::vector<std::string> const& args,
if (args.size() == 3) {
initialValue = args[2];
}
- bool init = cmSystemTools::IsOn(initialValue);
+ bool init = cmIsOn(initialValue);
this->Makefile->AddCacheDefinition(args[0], init ? "ON" : "OFF",
args[1].c_str(), cmStateEnums::BOOL);
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index da7f8bc..bf516e3 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -9,6 +9,7 @@
#include <vector>
#include "cmState.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
cmOutputConverter::cmOutputConverter(cmStateSnapshot const& snapshot)
@@ -153,7 +154,7 @@ cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat(
{
FortranFormat format = FortranFormatNone;
if (!value.empty()) {
- for (std::string const& fi : cmSystemTools::ExpandedListArgument(value)) {
+ for (std::string const& fi : cmExpandedList(value)) {
if (fi == "FIXED") {
format = FortranFormatFixed;
}
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 587e21c..de47ce0 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -123,7 +123,7 @@ public:
incDirProp, cmGeneratorExpression::StripAllGeneratorExpressions);
std::vector<std::string> includes;
- cmSystemTools::ExpandListArgument(incDirs, includes);
+ cmExpandList(incDirs, includes);
for (std::string& path : includes) {
this->Makefile->ExpandVariablesInString(path);
diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx
index 04fa0fb..5e7e2f3 100644
--- a/Source/cmParseArgumentsCommand.cxx
+++ b/Source/cmParseArgumentsCommand.cxx
@@ -131,7 +131,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
}
parseFromArgV = true;
argIter++; // move past PARSE_ARGV
- if (!cmSystemTools::StringToULong(argIter->c_str(), &argvStart)) {
+ if (!cmStrToULong(*argIter, &argvStart)) {
this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"PARSE_ARGV index '" + *argIter +
"' is not an unsigned integer");
@@ -161,17 +161,17 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
// the second argument is a (cmake) list of options without argument
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(*argIter++, list);
+ cmExpandList(*argIter++, list);
parser.Bind(list, options, duplicateKey);
// the third argument is a (cmake) list of single argument options
list.clear();
- cmSystemTools::ExpandListArgument(*argIter++, list);
+ cmExpandList(*argIter++, list);
parser.Bind(list, singleValArgs, duplicateKey);
// the fourth argument is a (cmake) list of multi argument options
list.clear();
- cmSystemTools::ExpandListArgument(*argIter++, list);
+ cmExpandList(*argIter++, list);
parser.Bind(list, multiValArgs, duplicateKey);
list.clear();
@@ -179,13 +179,13 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
// Flatten ;-lists in the arguments into a single list as was done
// by the original function(CMAKE_PARSE_ARGUMENTS).
for (; argIter != argEnd; ++argIter) {
- cmSystemTools::ExpandListArgument(*argIter, list);
+ cmExpandList(*argIter, list);
}
} else {
// in the PARSE_ARGV move read the arguments from ARGC and ARGV#
std::string argc = this->Makefile->GetSafeDefinition("ARGC");
unsigned long count;
- if (!cmSystemTools::StringToULong(argc.c_str(), &count)) {
+ if (!cmStrToULong(argc, &count)) {
this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"PARSE_ARGV called with ARGC='" + argc +
"' that is not an unsigned integer");
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 51a61dc..d33cd32 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -34,7 +34,7 @@ static bool stringToId(const char* input, cmPolicies::PolicyID& pid)
}
}
long id;
- if (!cmSystemTools::StringToLong(input + 3, &id)) {
+ if (!cmStrToLong(input + 3, &id)) {
return false;
}
if (id >= cmPolicies::CMPCOUNT) {
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index ca5a587..21de8c6 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -49,8 +49,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
{
cmMakefile* makefile = localGen->GetMakefile();
// Detect global autogen target name
- if (cmSystemTools::IsOn(
- makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET"))) {
+ if (cmIsOn(makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET"))) {
std::string targetName =
makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET_NAME");
if (targetName.empty()) {
@@ -61,8 +60,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
}
// Detect global autorcc target name
- if (cmSystemTools::IsOn(
- makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET"))) {
+ if (cmIsOn(makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET"))) {
std::string targetName =
makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET_NAME");
if (targetName.empty()) {
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 360df25..d21fc61 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -243,9 +243,9 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
this->Verbosity = makefile->GetSafeDefinition("CMAKE_AUTOGEN_VERBOSE");
if (!this->Verbosity.empty()) {
unsigned long iVerb = 0;
- if (!cmSystemTools::StringToULong(this->Verbosity.c_str(), &iVerb)) {
+ if (!cmStrToULong(this->Verbosity, &iVerb)) {
// Non numeric verbosity
- this->Verbosity = cmSystemTools::IsOn(this->Verbosity) ? "1" : "0";
+ this->Verbosity = cmIsOn(this->Verbosity) ? "1" : "0";
}
}
@@ -294,11 +294,9 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
// Info directory
this->Dir.Info = cbd;
- this->Dir.Info += "/CMakeFiles";
- this->Dir.Info += '/';
+ this->Dir.Info += "/CMakeFiles/";
this->Dir.Info += this->Target->GetName();
- this->Dir.Info += "_autogen";
- this->Dir.Info += ".dir";
+ this->Dir.Info += "_autogen.dir";
cmSystemTools::ConvertToUnixSlashes(this->Dir.Info);
// Build directory
@@ -392,7 +390,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
this->Target->GetSafeProperty("AUTOGEN_TARGET_DEPENDS");
if (!deps.empty()) {
std::vector<std::string> extraDeps;
- cmSystemTools::ExpandListArgument(deps, extraDeps);
+ cmExpandList(deps, extraDeps);
for (std::string const& depName : extraDeps) {
// Allow target and file dependencies
auto* depTarget = makefile->FindTargetToUse(depName);
@@ -407,8 +405,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
// CMAKE_AUTOMOC_RELAXED_MODE deprecation warning
if (this->Moc.Enabled) {
- if (cmSystemTools::IsOn(
- makefile->GetDefinition("CMAKE_AUTOMOC_RELAXED_MODE"))) {
+ if (cmIsOn(makefile->GetDefinition("CMAKE_AUTOMOC_RELAXED_MODE"))) {
std::string msg = "AUTOMOC: CMAKE_AUTOMOC_RELAXED_MODE is "
"deprecated an will be removed in the future. ";
msg += "Consider disabling it and converting the target ";
@@ -543,7 +540,7 @@ bool cmQtAutoGenInitializer::InitUic()
std::string const usp =
this->Target->GetSafeProperty("AUTOUIC_SEARCH_PATHS");
if (!usp.empty()) {
- cmSystemTools::ExpandListArgument(usp, this->Uic.SearchPaths);
+ cmExpandList(usp, this->Uic.SearchPaths);
std::string const& srcDir = makefile->GetCurrentSourceDirectory();
for (std::string& path : this->Uic.SearchPaths) {
path = cmSystemTools::CollapseFullPath(path, srcDir);
@@ -689,7 +686,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
{
std::string const opts = sf->GetSafeProperty(kw.AUTORCC_OPTIONS);
if (!opts.empty()) {
- cmSystemTools::ExpandListArgument(opts, qrc.Options);
+ cmExpandList(opts, qrc.Options);
}
}
this->Rcc.Qrcs.push_back(std::move(qrc));
@@ -808,7 +805,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
if (!uicOpts.empty()) {
this->Uic.FileFiles.push_back(std::move(realPath));
std::vector<std::string> optsVec;
- cmSystemTools::ExpandListArgument(uicOpts, optsVec);
+ cmExpandList(uicOpts, optsVec);
this->Uic.FileOptions.push_back(std::move(optsVec));
}
} else {
@@ -862,8 +859,8 @@ bool cmQtAutoGenInitializer::InitScanFiles()
const bool modernQt = (this->QtVersion.Major >= 5);
// Target rcc options
std::vector<std::string> optionsTarget;
- cmSystemTools::ExpandListArgument(
- this->Target->GetSafeProperty(kw.AUTORCC_OPTIONS), optionsTarget);
+ cmExpandList(this->Target->GetSafeProperty(kw.AUTORCC_OPTIONS),
+ optionsTarget);
// Check if file name is unique
for (Qrc& qrc : this->Rcc.Qrcs) {
@@ -1523,7 +1520,7 @@ void cmQtAutoGenInitializer::AddCleanFile(std::string const& fileName)
static unsigned int CharPtrToUInt(const char* const input)
{
unsigned long tmp = 0;
- if (input != nullptr && cmSystemTools::StringToULong(input, &tmp)) {
+ if (input != nullptr && cmStrToULong(input, &tmp)) {
return static_cast<unsigned int>(tmp);
}
return 0;
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 0ad87b1..0e8fa9a 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -22,11 +22,11 @@ cmQtAutoGenerator::Logger::Logger()
std::string verbose;
if (cmSystemTools::GetEnv("VERBOSE", verbose) && !verbose.empty()) {
unsigned long iVerbose = 0;
- if (cmSystemTools::StringToULong(verbose.c_str(), &iVerbose)) {
+ if (cmStrToULong(verbose, &iVerbose)) {
SetVerbosity(static_cast<unsigned int>(iVerbose));
} else {
// Non numeric verbosity
- SetVerbose(cmSystemTools::IsOn(verbose));
+ SetVerbose(cmIsOn(verbose));
}
}
}
@@ -34,7 +34,7 @@ cmQtAutoGenerator::Logger::Logger()
std::string colorEnv;
cmSystemTools::GetEnv("COLOR", colorEnv);
if (!colorEnv.empty()) {
- SetColorOutput(cmSystemTools::IsOn(colorEnv));
+ SetColorOutput(cmIsOn(colorEnv));
} else {
SetColorOutput(true);
}
@@ -46,7 +46,7 @@ cmQtAutoGenerator::Logger::~Logger() = default;
void cmQtAutoGenerator::Logger::RaiseVerbosity(std::string const& value)
{
unsigned long verbosity = 0;
- if (cmSystemTools::StringToULong(value.c_str(), &verbosity)) {
+ if (cmStrToULong(value, &verbosity)) {
if (this->Verbosity_ < verbosity) {
this->Verbosity_ = static_cast<unsigned int>(verbosity);
}
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index e693816..2cbf113 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -1511,7 +1511,7 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
};
auto InfoGetList = [makefile](const char* key) -> std::vector<std::string> {
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition(key), list);
+ cmExpandList(makefile->GetSafeDefinition(key), list);
return list;
};
auto InfoGetLists =
@@ -1528,8 +1528,7 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
if (length >= 2) {
std::string::const_iterator itBeg = value.begin() + (pos + 1);
std::string::const_iterator itEnd = itBeg + (length - 2);
- lists.emplace_back(
- cmSystemTools::ExpandedListArgument(std::string(itBeg, itEnd)));
+ lists.emplace_back(cmExpandedList(std::string(itBeg, itEnd)));
}
pos += length;
pos += ListSep.size();
@@ -1551,7 +1550,7 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
auto InfoGetConfigList =
[&InfoGetConfig](const char* key) -> std::vector<std::string> {
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(InfoGetConfig(key), list);
+ cmExpandList(InfoGetConfig(key), list);
return list;
};
auto LogInfoError = [this](std::string const& msg) -> bool {
@@ -1582,7 +1581,7 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
BaseConst_.MultiConfig = InfoGetBool("AM_MULTI_CONFIG");
{
unsigned long num = 1;
- if (cmSystemTools::StringToULong(InfoGet("AM_PARALLEL").c_str(), &num)) {
+ if (cmStrToULong(InfoGet("AM_PARALLEL"), &num)) {
num = std::max<unsigned long>(num, 1);
num = std::min<unsigned long>(num, ParallelMax);
}
@@ -1630,8 +1629,7 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
// - Qt environment
{
unsigned long qtv = BaseConst_.QtVersionMajor;
- if (cmSystemTools::StringToULong(InfoGet("AM_QT_VERSION_MAJOR").c_str(),
- &qtv)) {
+ if (cmStrToULong(InfoGet("AM_QT_VERSION_MAJOR"), &qtv)) {
BaseConst_.QtVersionMajor = static_cast<unsigned int>(qtv);
}
}
diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx
index c75b2ca..ea3cad9 100644
--- a/Source/cmQtAutoRcc.cxx
+++ b/Source/cmQtAutoRcc.cxx
@@ -29,7 +29,7 @@ bool cmQtAutoRcc::Init(cmMakefile* makefile)
auto InfoGetList =
[makefile](std::string const& key) -> std::vector<std::string> {
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition(key), list);
+ cmExpandList(makefile->GetSafeDefinition(key), list);
return list;
};
auto InfoGetConfig = [makefile,
@@ -47,7 +47,7 @@ bool cmQtAutoRcc::Init(cmMakefile* makefile)
auto InfoGetConfigList =
[&InfoGetConfig](std::string const& key) -> std::vector<std::string> {
std::vector<std::string> list;
- cmSystemTools::ExpandListArgument(InfoGetConfig(key), list);
+ cmExpandList(InfoGetConfig(key), list);
return list;
};
auto LogInfoError = [this](std::string const& msg) -> bool {
diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx
index d0ee4d4..4ba21fa 100644
--- a/Source/cmRemoveCommand.cxx
+++ b/Source/cmRemoveCommand.cxx
@@ -3,7 +3,7 @@
#include "cmRemoveCommand.h"
#include "cmMakefile.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
class cmExecutionStatus;
@@ -25,13 +25,12 @@ bool cmRemoveCommand::InitialPass(std::vector<std::string> const& args,
}
// expand the variable
- std::vector<std::string> const varArgsExpanded =
- cmSystemTools::ExpandedListArgument(cacheValue);
+ std::vector<std::string> const varArgsExpanded = cmExpandedList(cacheValue);
// expand the args
// check for REMOVE(VAR v1 v2 ... vn)
std::vector<std::string> const argsExpanded =
- cmSystemTools::ExpandedLists(args.begin() + 1, args.end());
+ cmExpandedLists(args.begin() + 1, args.end());
// now create the new value
std::string value;
diff --git a/Source/cmRuntimeDependencyArchive.cxx b/Source/cmRuntimeDependencyArchive.cxx
index ca85287..1b3f387 100644
--- a/Source/cmRuntimeDependencyArchive.cxx
+++ b/Source/cmRuntimeDependencyArchive.cxx
@@ -9,11 +9,12 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#if defined(_WIN32)
# include "cmGlobalGenerator.h"
-# ifdef CMAKE_BUILD_WITH_CMAKE
+# ifndef CMAKE_BOOTSTRAP
# include "cmGlobalVisualStudioVersionedGenerator.h"
# endif
# include "cmVSSetupHelper.h"
@@ -36,7 +37,7 @@ static void AddVisualStudioPath(std::vector<std::string>& paths,
// If generating for the VS IDE, use the same instance.
std::string vsloc;
bool found = false;
-# ifdef CMAKE_BUILD_WITH_CMAKE
+# ifndef CMAKE_BOOTSTRAP
if (gg->GetName().find(prefix) == 0) {
cmGlobalVisualStudioVersionedGenerator* vsgen =
static_cast<cmGlobalVisualStudioVersionedGenerator*>(gg);
@@ -217,7 +218,7 @@ bool cmRuntimeDependencyArchive::GetGetRuntimeDependenciesCommand(
std::string toolCommand = this->GetMakefile()->GetSafeDefinition(
"CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND");
if (!toolCommand.empty()) {
- cmSystemTools::ExpandListArgument(toolCommand, command);
+ cmExpandList(toolCommand, command);
return true;
}
diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx
index 879cc95..affff54 100644
--- a/Source/cmSearchPath.cxx
+++ b/Source/cmSearchPath.cxx
@@ -79,7 +79,7 @@ void cmSearchPath::AddCMakePath(const std::string& variable)
// Get a path from a CMake variable.
if (const char* value = this->FC->Makefile->GetDefinition(variable)) {
std::vector<std::string> expanded;
- cmSystemTools::ExpandListArgument(value, expanded);
+ cmExpandList(value, expanded);
for (std::string const& p : expanded) {
this->AddPathInternal(
@@ -104,7 +104,7 @@ void cmSearchPath::AddCMakePrefixPath(const std::string& variable)
// Get a path from a CMake variable.
if (const char* value = this->FC->Makefile->GetDefinition(variable)) {
std::vector<std::string> expanded;
- cmSystemTools::ExpandListArgument(value, expanded);
+ cmExpandList(value, expanded);
this->AddPrefixPaths(
expanded, this->FC->Makefile->GetCurrentSourceDirectory().c_str());
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index e9343c7..9192c11 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -11,6 +11,7 @@
#include "cmRange.h"
#include "cmSourceFile.h"
#include "cmState.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTest.h"
@@ -331,8 +332,8 @@ bool cmSetPropertyCommand::HandleTest(cmTest* test)
bool cmSetPropertyCommand::HandleCacheMode()
{
if (this->PropertyName == "ADVANCED") {
- if (!this->Remove && !cmSystemTools::IsOn(this->PropertyValue) &&
- !cmSystemTools::IsOff(this->PropertyValue)) {
+ if (!this->Remove && !cmIsOn(this->PropertyValue) &&
+ !cmIsOff(this->PropertyValue)) {
std::ostringstream e;
e << "given non-boolean value \"" << this->PropertyValue
<< R"(" for CACHE property "ADVANCED". )";
diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx
index 9388e7c..8e3217f 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.cxx
+++ b/Source/cmSetSourceFilesPropertiesCommand.cxx
@@ -4,7 +4,7 @@
#include "cmMakefile.h"
#include "cmSourceFile.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
class cmExecutionStatus;
@@ -87,7 +87,7 @@ bool cmSetSourceFilesPropertiesCommand::RunCommand(
propertyPairs.push_back(*j);
if (*j == "GENERATED") {
++j;
- if (j != propend && cmSystemTools::IsOn(*j)) {
+ if (j != propend && cmIsOn(*j)) {
generated = true;
}
} else {
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 9f041bc..61ede29 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -6,6 +6,7 @@
#include "cmMakefile.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
@@ -50,7 +51,7 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args,
}
#else
// try to find the hostname for this computer
- if (!cmSystemTools::IsOff(hostname_cmd)) {
+ if (!cmIsOff(hostname_cmd)) {
std::string host;
cmSystemTools::RunSingleCommand(hostname_cmd, &host, nullptr, nullptr,
nullptr, cmSystemTools::OUTPUT_NONE);
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index d05fb68..3f52e64 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -11,6 +11,7 @@
#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmState.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -242,7 +243,7 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value)
// Update IsGenerated flag
if (prop == propGENERATED) {
- this->IsGenerated = cmSystemTools::IsOn(value);
+ this->IsGenerated = cmIsOn(value);
}
}
@@ -316,7 +317,7 @@ const char* cmSourceFile::GetSafeProperty(const std::string& prop) const
bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
{
- return cmSystemTools::IsOn(this->GetProperty(prop));
+ return cmIsOn(this->GetProperty(prop));
}
cmCustomCommand* cmSourceFile::GetCustomCommand()
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 1ea72e1..07f4dec 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -598,7 +598,7 @@ const char* cmState::GetGlobalProperty(const std::string& prop)
bool cmState::GetGlobalPropertyAsBool(const std::string& prop)
{
- return cmSystemTools::IsOn(this->GetGlobalProperty(prop));
+ return cmIsOn(this->GetGlobalProperty(prop));
}
void cmState::SetSourceDirectory(std::string const& sourceDirectory)
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 3f70ed3..df96bd3 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -662,7 +662,7 @@ const char* cmStateDirectory::GetProperty(const std::string& prop,
bool cmStateDirectory::GetPropertyAsBool(const std::string& prop) const
{
- return cmSystemTools::IsOn(this->GetProperty(prop));
+ return cmIsOn(this->GetProperty(prop));
}
std::vector<std::string> cmStateDirectory::GetPropertyKeys() const
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 110ec56..121923d 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -328,7 +328,7 @@ void cmStateSnapshot::SetDefaultDefinitions()
#if defined(__CYGWIN__)
std::string legacy;
if (cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32", legacy) &&
- cmSystemTools::IsOn(legacy.c_str())) {
+ cmIsOn(legacy.c_str())) {
this->SetDefinition("WIN32", "1");
this->SetDefinition("CMAKE_HOST_WIN32", "1");
}
diff --git a/Source/cmStringAlgorithms.cxx b/Source/cmStringAlgorithms.cxx
index 5867a44..c686aa0 100644
--- a/Source/cmStringAlgorithms.cxx
+++ b/Source/cmStringAlgorithms.cxx
@@ -4,6 +4,8 @@
#include <algorithm>
#include <cstdio>
+#include <errno.h>
+#include <stdlib.h>
std::string cmTrimWhitespace(cm::string_view str)
{
@@ -21,6 +23,20 @@ std::string cmTrimWhitespace(cm::string_view str)
return std::string(start, stop + 1);
}
+std::string cmRemoveQuotes(cm::string_view str)
+{
+ // We process only strings that have two quotes at least.
+ // Also front() and back() are only defined behavior on non empty strings.
+ if (str.size() >= 2 && //
+ str.front() == '"' && //
+ str.back() == '"') {
+ // Remove a quote from the front and back
+ str.remove_prefix(1);
+ str.remove_suffix(1);
+ }
+ return std::string(str);
+}
+
std::string cmEscapeQuotes(cm::string_view str)
{
std::string result;
@@ -58,6 +74,77 @@ std::vector<std::string> cmTokenize(cm::string_view str, cm::string_view sep)
return tokens;
}
+void cmExpandList(cm::string_view arg, std::vector<std::string>& argsOut,
+ bool emptyArgs)
+{
+ // If argument is empty, it is an empty list.
+ if (!emptyArgs && arg.empty()) {
+ return;
+ }
+
+ // if there are no ; in the name then just copy the current string
+ if (arg.find(';') == cm::string_view::npos) {
+ argsOut.emplace_back(arg);
+ return;
+ }
+
+ std::string newArg;
+ // Break the string at non-escaped semicolons not nested in [].
+ int squareNesting = 0;
+ cm::string_view::iterator last = arg.begin();
+ cm::string_view::iterator const cend = arg.end();
+ for (cm::string_view::iterator c = last; c != cend; ++c) {
+ switch (*c) {
+ case '\\': {
+ // We only want to allow escaping of semicolons. Other
+ // escapes should not be processed here.
+ cm::string_view::iterator cnext = c + 1;
+ if ((cnext != cend) && *cnext == ';') {
+ newArg.append(last, c);
+ // Skip over the escape character
+ last = cnext;
+ c = cnext;
+ }
+ } break;
+ case '[': {
+ ++squareNesting;
+ } break;
+ case ']': {
+ --squareNesting;
+ } break;
+ case ';': {
+ // Break the string here if we are not nested inside square
+ // brackets.
+ if (squareNesting == 0) {
+ newArg.append(last, c);
+ // Skip over the semicolon
+ last = c + 1;
+ if (!newArg.empty() || emptyArgs) {
+ // Add the last argument if the string is not empty.
+ argsOut.push_back(newArg);
+ newArg.clear();
+ }
+ }
+ } break;
+ default: {
+ // Just append this character.
+ } break;
+ }
+ }
+ newArg.append(last, cend);
+ if (!newArg.empty() || emptyArgs) {
+ // Add the last argument if the string is not empty.
+ argsOut.push_back(std::move(newArg));
+ }
+}
+
+std::vector<std::string> cmExpandedList(cm::string_view arg, bool emptyArgs)
+{
+ std::vector<std::string> argsOut;
+ cmExpandList(arg, argsOut, emptyArgs);
+ return argsOut;
+}
+
namespace {
template <std::size_t N, typename T>
inline void MakeDigits(cm::string_view& view, char (&digits)[N],
@@ -124,3 +211,114 @@ std::string cmCatViews(std::initializer_list<cm::string_view> views)
}
return result;
}
+
+bool cmIsInternallyOn(cm::string_view val)
+{
+ return (val.size() == 4) && //
+ (val[0] == 'I' || val[0] == 'i') && //
+ (val[1] == '_') && //
+ (val[2] == 'O' || val[2] == 'o') && //
+ (val[3] == 'N' || val[3] == 'n');
+}
+
+bool cmIsNOTFOUND(cm::string_view val)
+{
+ return (val == "NOTFOUND") || cmHasLiteralSuffix(val, "-NOTFOUND");
+}
+
+bool cmIsOn(cm::string_view val)
+{
+ switch (val.size()) {
+ case 1:
+ return val[0] == '1' || val[0] == 'Y' || val[0] == 'y';
+ case 2:
+ return //
+ (val[0] == 'O' || val[0] == 'o') && //
+ (val[1] == 'N' || val[1] == 'n');
+ case 3:
+ return //
+ (val[0] == 'Y' || val[0] == 'y') && //
+ (val[1] == 'E' || val[1] == 'e') && //
+ (val[2] == 'S' || val[2] == 's');
+ case 4:
+ return //
+ (val[0] == 'T' || val[0] == 't') && //
+ (val[1] == 'R' || val[1] == 'r') && //
+ (val[2] == 'U' || val[2] == 'u') && //
+ (val[3] == 'E' || val[3] == 'e');
+ default:
+ break;
+ }
+
+ return false;
+}
+
+bool cmIsOff(cm::string_view val)
+{
+ switch (val.size()) {
+ case 0:
+ return true;
+ case 1:
+ return val[0] == '0' || val[0] == 'N' || val[0] == 'n';
+ case 2:
+ return //
+ (val[0] == 'N' || val[0] == 'n') && //
+ (val[1] == 'O' || val[1] == 'o');
+ case 3:
+ return //
+ (val[0] == 'O' || val[0] == 'o') && //
+ (val[1] == 'F' || val[1] == 'f') && //
+ (val[2] == 'F' || val[2] == 'f');
+ case 5:
+ return //
+ (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');
+ case 6:
+ return //
+ (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');
+ default:
+ break;
+ }
+
+ return cmIsNOTFOUND(val);
+}
+
+bool cmStrToLong(const char* str, long* value)
+{
+ errno = 0;
+ char* endp;
+ *value = strtol(str, &endp, 10);
+ return (*endp == '\0') && (endp != str) && (errno == 0);
+}
+
+bool cmStrToLong(std::string const& str, long* value)
+{
+ return cmStrToLong(str.c_str(), value);
+}
+
+bool cmStrToULong(const char* str, unsigned long* value)
+{
+ errno = 0;
+ char* endp;
+ while (cmIsSpace(*str)) {
+ ++str;
+ }
+ if (*str == '-') {
+ return false;
+ }
+ *value = strtoul(str, &endp, 10);
+ return (*endp == '\0') && (endp != str) && (errno == 0);
+}
+
+bool cmStrToULong(std::string const& str, unsigned long* value)
+{
+ return cmStrToULong(str.c_str(), value);
+}
diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h
index 1898649..5b8b878 100644
--- a/Source/cmStringAlgorithms.h
+++ b/Source/cmStringAlgorithms.h
@@ -41,6 +41,9 @@ inline bool cmIsSpace(char ch)
/** Returns a string that has whitespace removed from the start and the end. */
std::string cmTrimWhitespace(cm::string_view str);
+/** Returns a string that has quotes removed from the start and the end. */
+std::string cmRemoveQuotes(cm::string_view str);
+
/** Escape quotes in a string. */
std::string cmEscapeQuotes(cm::string_view str);
@@ -65,6 +68,48 @@ std::string cmJoin(Range const& rng, cm::string_view separator)
/** Extract tokens that are separated by any of the characters in @a sep. */
std::vector<std::string> cmTokenize(cm::string_view str, cm::string_view sep);
+/**
+ * Expand the ; separated string @a arg into multiple arguments.
+ * All found arguments are appended to @a argsOut.
+ */
+void cmExpandList(cm::string_view arg, std::vector<std::string>& argsOut,
+ bool emptyArgs = false);
+
+/**
+ * Expand out any arguments in the string range [@a first, @a last) that have
+ * ; separated strings into multiple arguments. All found arguments are
+ * appended to @a argsOut.
+ */
+template <class InputIt>
+void cmExpandLists(InputIt first, InputIt last,
+ std::vector<std::string>& argsOut)
+{
+ for (; first != last; ++first) {
+ ExpandList(*first, argsOut);
+ }
+}
+
+/**
+ * Same as cmExpandList but a new vector is created containing
+ * the expanded arguments from the string @a arg.
+ */
+std::vector<std::string> cmExpandedList(cm::string_view arg,
+ bool emptyArgs = false);
+
+/**
+ * Same as cmExpandList but a new vector is created containing the expanded
+ * versions of all arguments in the string range [@a first, @a last).
+ */
+template <class InputIt>
+std::vector<std::string> cmExpandedLists(InputIt first, InputIt last)
+{
+ std::vector<std::string> argsOut;
+ for (; first != last; ++first) {
+ cmExpandList(*first, argsOut);
+ }
+ return argsOut;
+}
+
/** Concatenate string pieces into a single string. */
std::string cmCatViews(std::initializer_list<cm::string_view> views);
@@ -135,6 +180,51 @@ std::string cmWrap(char prefix, Range const& rng, char suffix,
sep);
}
+/**
+ * Does a string indicates that CMake/CPack/CTest internally
+ * forced this value. This is not the same as On, but this
+ * may be considered as "internally switched on".
+ */
+bool cmIsInternallyOn(cm::string_view val);
+inline bool cmIsInternallyOn(const char* val)
+{
+ if (!val) {
+ return false;
+ }
+ return cmIsInternallyOn(cm::string_view(val));
+}
+
+/** Return true if value is NOTFOUND or ends in -NOTFOUND. */
+bool cmIsNOTFOUND(cm::string_view val);
+
+/**
+ * Does a string indicate a true or ON value? This is not the same as ifdef.
+ */
+bool cmIsOn(cm::string_view val);
+inline bool cmIsOn(const char* val)
+{
+ if (!val) {
+ return false;
+ }
+ return cmIsOn(cm::string_view(val));
+}
+
+/**
+ * Does a string indicate a false or off value ? Note that this is
+ * not the same as !IsOn(...) because there are a number of
+ * ambiguous values such as "/usr/local/bin" a path will result in
+ * IsON and IsOff both returning false. Note that the special path
+ * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true.
+ */
+bool cmIsOff(cm::string_view val);
+inline bool cmIsOff(const char* val)
+{
+ if (!val) {
+ return true;
+ }
+ return cmIsOff(cm::string_view(val));
+}
+
/** Returns true if string @a str starts with the character @a prefix. */
inline bool cmHasPrefix(cm::string_view str, char prefix)
{
@@ -190,4 +280,13 @@ inline void cmStripSuffixIfExists(std::string& str, cm::string_view suffix)
}
}
+/** Converts a string to long. Expects that the whole string is an integer. */
+bool cmStrToLong(const char* str, long* value);
+bool cmStrToLong(std::string const& str, long* value);
+
+/** Converts a string to unsigned long. Expects that the whole string is an
+ * integer */
+bool cmStrToULong(const char* str, unsigned long* value);
+bool cmStrToULong(std::string const& str, unsigned long* value);
+
#endif
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 8b3b1e3..5bff0e5 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -113,7 +113,7 @@ bool cmStringCommand::InitialPass(std::vector<std::string> const& args,
bool cmStringCommand::HandleHashCommand(std::vector<std::string> const& args)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
if (args.size() != 3) {
std::ostringstream e;
e << args[0] << " requires an output variable and an input string";
@@ -121,7 +121,7 @@ bool cmStringCommand::HandleHashCommand(std::vector<std::string> const& args)
return false;
}
- std::unique_ptr<cmCryptoHash> hash(cmCryptoHash::New(args[0].c_str()));
+ std::unique_ptr<cmCryptoHash> hash(cmCryptoHash::New(args[0]));
if (hash) {
std::string out = hash->HashString(args[2]);
this->Makefile->AddDefinition(args[1], out);
@@ -736,7 +736,7 @@ bool cmStringCommand::HandleRepeatCommand(std::vector<std::string> const& args)
}
unsigned long times;
- if (!cmSystemTools::StringToULong(args[ArgPos::TIMES].c_str(), &times)) {
+ if (!cmStrToULong(args[ArgPos::TIMES], &times)) {
this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"repeat count is not a positive number.");
return true;
@@ -878,7 +878,7 @@ bool cmStringCommand::HandleTimestampCommand(
bool cmStringCommand::HandleUuidCommand(std::vector<std::string> const& args)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
unsigned int argsIndex = 1;
if (args.size() < 2) {
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 7baf5ed..3461e67 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -9,7 +9,7 @@
#include "cmStringAlgorithms.h"
#include "cm_uv.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmArchiveWrite.h"
# include "cmLocale.h"
# include "cm_libarchive.h"
@@ -21,7 +21,7 @@
# endif
#endif
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmCryptoHash.h"
#endif
@@ -93,7 +93,7 @@ extern char** environ;
# endif
#endif
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
static std::string cm_archive_entry_pathname(struct archive_entry* entry)
{
# if cmsys_STL_HAS_WSTRING
@@ -250,85 +250,6 @@ void cmSystemTools::ReportLastSystemError(const char* msg)
cmSystemTools::Error(m);
}
-bool cmSystemTools::IsInternallyOn(cm::string_view val)
-{
- return (val.size() == 4) && //
- (val[0] == 'I' || val[0] == 'i') && //
- (val[1] == '_') && //
- (val[2] == 'O' || val[2] == 'o') && //
- (val[3] == 'N' || val[3] == 'n');
-}
-
-bool cmSystemTools::IsOn(cm::string_view val)
-{
- switch (val.size()) {
- case 1:
- return val[0] == '1' || val[0] == 'Y' || val[0] == 'y';
- case 2:
- return //
- (val[0] == 'O' || val[0] == 'o') && //
- (val[1] == 'N' || val[1] == 'n');
- case 3:
- return //
- (val[0] == 'Y' || val[0] == 'y') && //
- (val[1] == 'E' || val[1] == 'e') && //
- (val[2] == 'S' || val[2] == 's');
- case 4:
- return //
- (val[0] == 'T' || val[0] == 't') && //
- (val[1] == 'R' || val[1] == 'r') && //
- (val[2] == 'U' || val[2] == 'u') && //
- (val[3] == 'E' || val[3] == 'e');
- default:
- break;
- }
-
- return false;
-}
-
-bool cmSystemTools::IsNOTFOUND(cm::string_view val)
-{
- return (val == "NOTFOUND") || cmHasLiteralSuffix(val, "-NOTFOUND");
-}
-
-bool cmSystemTools::IsOff(cm::string_view val)
-{
- switch (val.size()) {
- case 0:
- return true;
- case 1:
- return val[0] == '0' || val[0] == 'N' || val[0] == 'n';
- case 2:
- return //
- (val[0] == 'N' || val[0] == 'n') && //
- (val[1] == 'O' || val[1] == 'o');
- case 3:
- return //
- (val[0] == 'O' || val[0] == 'o') && //
- (val[1] == 'F' || val[1] == 'f') && //
- (val[2] == 'F' || val[2] == 'f');
- case 5:
- return //
- (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');
- case 6:
- return //
- (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');
- default:
- break;
- }
-
- return cmSystemTools::IsNOTFOUND(val);
-}
-
void cmSystemTools::ParseWindowsCommandLine(const char* command,
std::vector<std::string>& args)
{
@@ -944,7 +865,7 @@ bool cmSystemTools::RenameFile(const std::string& oldname,
std::string cmSystemTools::ComputeFileHash(const std::string& source,
cmCryptoHash::Algo algo)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
cmCryptoHash hash(algo);
return hash.HashFile(source);
#else
@@ -957,7 +878,7 @@ std::string cmSystemTools::ComputeFileHash(const std::string& source,
std::string cmSystemTools::ComputeStringMD5(const std::string& input)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
cmCryptoHash md5(cmCryptoHash::AlgoMD5);
return md5.HashString(input);
#else
@@ -973,7 +894,7 @@ std::string cmSystemTools::ComputeCertificateThumbprint(
{
std::string thumbprint;
-#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32)
+#if !defined(CMAKE_BOOTSTRAP) && defined(_WIN32)
BYTE* certData = NULL;
CRYPT_INTEGER_BLOB cryptBlob;
HCERTSTORE certStore = NULL;
@@ -1089,79 +1010,6 @@ void cmSystemTools::GlobDirs(const std::string& path,
}
}
-void cmSystemTools::ExpandListArgument(cm::string_view arg,
- std::vector<std::string>& argsOut,
- bool emptyArgs)
-{
- // If argument is empty, it is an empty list.
- if (!emptyArgs && arg.empty()) {
- return;
- }
-
- // if there are no ; in the name then just copy the current string
- if (arg.find(';') == cm::string_view::npos) {
- argsOut.emplace_back(arg);
- return;
- }
-
- std::string newArg;
- // Break the string at non-escaped semicolons not nested in [].
- int squareNesting = 0;
- cm::string_view::iterator last = arg.begin();
- cm::string_view::iterator const cend = arg.end();
- for (cm::string_view::iterator c = last; c != cend; ++c) {
- switch (*c) {
- case '\\': {
- // We only want to allow escaping of semicolons. Other
- // escapes should not be processed here.
- cm::string_view::iterator cnext = c + 1;
- if ((cnext != cend) && *cnext == ';') {
- newArg.append(last, c);
- // Skip over the escape character
- last = cnext;
- c = cnext;
- }
- } break;
- case '[': {
- ++squareNesting;
- } break;
- case ']': {
- --squareNesting;
- } break;
- case ';': {
- // Break the string here if we are not nested inside square
- // brackets.
- if (squareNesting == 0) {
- newArg.append(last, c);
- // Skip over the semicolon
- last = c + 1;
- if (!newArg.empty() || emptyArgs) {
- // Add the last argument if the string is not empty.
- argsOut.push_back(newArg);
- newArg.clear();
- }
- }
- } break;
- default: {
- // Just append this character.
- } break;
- }
- }
- newArg.append(last, cend);
- if (!newArg.empty() || emptyArgs) {
- // Add the last argument if the string is not empty.
- argsOut.push_back(std::move(newArg));
- }
-}
-
-std::vector<std::string> cmSystemTools::ExpandedListArgument(
- cm::string_view arg, bool emptyArgs)
-{
- std::vector<std::string> argsOut;
- ExpandListArgument(arg, argsOut, emptyArgs);
- return argsOut;
-}
-
bool cmSystemTools::SimpleGlob(const std::string& glob,
std::vector<std::string>& files,
int type /* = 0 */)
@@ -1331,7 +1179,7 @@ std::string cmSystemTools::ForceToRelativePath(std::string const& local_path,
return relative;
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
bool cmSystemTools::UnsetEnv(const char* value)
{
# if !defined(HAVE_UNSETENV)
@@ -1396,7 +1244,7 @@ void cmSystemTools::EnableVSConsoleOutput()
// output and allow it to be captured on the fly.
cmSystemTools::PutEnv("vsconsoleoutput=1");
-# ifdef CMAKE_BUILD_WITH_CMAKE
+# ifndef CMAKE_BOOTSTRAP
// VS sets an environment variable to tell MS tools like "cl" to report
// output through a backdoor pipe instead of stdout/stderr. Unset the
// environment variable to close this backdoor for any path of process
@@ -1418,7 +1266,7 @@ bool cmSystemTools::CreateTar(const std::string& outFileName,
std::string const& mtime,
std::string const& format)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmsys::ofstream fout(outFileName.c_str(), std::ios::out | std::ios::binary);
if (!fout) {
@@ -1472,7 +1320,7 @@ bool cmSystemTools::CreateTar(const std::string& outFileName,
#endif
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
namespace {
# define BSDTAR_FILESIZE_PRINTF "%lu"
# define BSDTAR_FILESIZE_TYPE unsigned long
@@ -1768,7 +1616,7 @@ bool cmSystemTools::ExtractTar(const std::string& outFileName,
const std::vector<std::string>& files,
bool verbose)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
return extract_tar(outFileName, files, verbose, true);
#else
(void)outFileName;
@@ -1782,7 +1630,7 @@ bool cmSystemTools::ListTar(const std::string& outFileName,
const std::vector<std::string>& files,
bool verbose)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
return extract_tar(outFileName, files, verbose, false);
#else
(void)outFileName;
@@ -2111,7 +1959,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
cmSystemToolsCMakeCommand = exe_dir;
cmSystemToolsCMakeCommand += "/cmake";
cmSystemToolsCMakeCommand += cmSystemTools::GetExecutableExtension();
-#ifndef CMAKE_BUILD_WITH_CMAKE
+#ifdef CMAKE_BOOTSTRAP
// The bootstrap cmake does not provide the other tools,
// so use the directory where they are about to be built.
exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin";
@@ -2141,7 +1989,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
cmSystemToolsCMClDepsCommand.clear();
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
// Install tree has
// - "<prefix><CMAKE_BIN_DIR>/cmake"
// - "<prefix><CMAKE_DATA_DIR>"
@@ -2838,36 +2686,20 @@ bool cmSystemTools::CheckRPath(std::string const& file,
bool cmSystemTools::RepeatedRemoveDirectory(const std::string& dir)
{
+#ifdef _WIN32
// Windows sometimes locks files temporarily so try a few times.
- for (int i = 0; i < 10; ++i) {
+ WindowsFileRetry retry = cmSystemTools::GetWindowsFileRetry();
+
+ for (unsigned int i = 0; i < retry.Count; ++i) {
if (cmSystemTools::RemoveADirectory(dir)) {
return true;
}
- cmSystemTools::Delay(100);
+ cmSystemTools::Delay(retry.Delay);
}
return false;
-}
-
-bool cmSystemTools::StringToLong(const char* str, long* value)
-{
- errno = 0;
- char* endp;
- *value = strtol(str, &endp, 10);
- return (*endp == '\0') && (endp != str) && (errno == 0);
-}
-
-bool cmSystemTools::StringToULong(const char* str, unsigned long* value)
-{
- errno = 0;
- char* endp;
- while (isspace(*str)) {
- ++str;
- }
- if (*str == '-') {
- return false;
- }
- *value = strtoul(str, &endp, 10);
- return (*endp == '\0') && (endp != str) && (errno == 0);
+#else
+ return cmSystemTools::RemoveADirectory(dir);
+#endif
}
std::string cmSystemTools::EncodeURL(std::string const& in, bool escapeSlashes)
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index d3fcb64..953a358 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -29,49 +29,6 @@ public:
typedef cmProcessOutput::Encoding Encoding;
/**
- * Expand the ; separated string @a arg into multiple arguments.
- * All found arguments are appended to @a argsOut.
- */
- static void ExpandListArgument(cm::string_view arg,
- std::vector<std::string>& argsOut,
- bool emptyArgs = false);
-
- /**
- * Expand out any arguments in the string range [@a first, @a last) that have
- * ; separated strings into multiple arguments. All found arguments are
- * appended to @a argsOut.
- */
- template <class InputIt>
- static void ExpandLists(InputIt first, InputIt last,
- std::vector<std::string>& argsOut)
- {
- for (; first != last; ++first) {
- cmSystemTools::ExpandListArgument(*first, argsOut);
- }
- }
-
- /**
- * Same as ExpandListArgument but a new vector is created containing
- * the expanded arguments from the string @a arg.
- */
- static std::vector<std::string> ExpandedListArgument(cm::string_view arg,
- bool emptyArgs = false);
-
- /**
- * Same as ExpandList but a new vector is created containing the expanded
- * versions of all arguments in the string range [@a first, @a last).
- */
- template <class InputIt>
- static std::vector<std::string> ExpandedLists(InputIt first, InputIt last)
- {
- std::vector<std::string> argsOut;
- for (; first != last; ++first) {
- cmSystemTools::ExpandListArgument(*first, argsOut);
- }
- return argsOut;
- }
-
- /**
* Look for and replace registry values in a string
*/
static void ExpandRegistryValues(std::string& source,
@@ -137,50 +94,6 @@ public:
cmSystemTools::s_ErrorOccured = false;
}
- /**
- * Does a string indicates that CMake/CPack/CTest internally
- * forced this value. This is not the same as On, but this
- * may be considered as "internally switched on".
- */
- static bool IsInternallyOn(cm::string_view val);
- static inline bool IsInternallyOn(const char* val)
- {
- if (!val) {
- return false;
- }
- return IsInternallyOn(cm::string_view(val));
- }
-
- /**
- * Does a string indicate a true or on value? This is not the same as ifdef.
- */
- static bool IsOn(cm::string_view val);
- inline static bool IsOn(const char* val)
- {
- if (!val) {
- return false;
- }
- return IsOn(cm::string_view(val));
- }
-
- /**
- * Does a string indicate a false or off value ? Note that this is
- * not the same as !IsOn(...) because there are a number of
- * ambiguous values such as "/usr/local/bin" a path will result in
- * IsON and IsOff both returning false. Note that the special path
- * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true.
- */
- static bool IsOff(cm::string_view val);
- inline static bool IsOff(const char* val)
- {
- if (!val) {
- return true;
- }
- return IsOff(cm::string_view(val));
- }
-
- //! Return true if value is NOTFOUND or ends in -NOTFOUND.
- static bool IsNOTFOUND(cm::string_view val);
//! Return true if the path is a framework
static bool IsPathToFramework(const std::string& value);
@@ -387,7 +300,7 @@ public:
static std::string ForceToRelativePath(std::string const& local_path,
std::string const& remote_path);
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
/** Remove an environment variable */
static bool UnsetEnv(const char* value);
@@ -500,10 +413,6 @@ public:
/** Remove a directory; repeat a few times in case of locked files. */
static bool RepeatedRemoveDirectory(const std::string& dir);
- /** Convert string to long. Expected that the whole string is an integer */
- static bool StringToLong(const char* str, long* value);
- static bool StringToULong(const char* str, unsigned long* value);
-
/** Encode a string as a URL. */
static std::string EncodeURL(std::string const& in,
bool escapeSlashes = true);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 7ca2391..9b002ee 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -89,7 +89,7 @@ const char* cmTargetPropertyComputer::GetSources<cmTarget>(
const char* sep = "";
for (std::string const& entry : entries) {
std::vector<std::string> files;
- cmSystemTools::ExpandListArgument(entry, files);
+ cmExpandList(entry, files);
for (std::string const& file : files) {
if (cmHasLiteralPrefix(file, "$<TARGET_OBJECTS:") &&
file.back() == '>') {
@@ -343,6 +343,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initProp("CUDA_EXTENSIONS");
initProp("CUDA_COMPILER_LAUNCHER");
initProp("CUDA_SEPARABLE_COMPILATION");
+ initProp("CUDA_RESOLVE_DEVICE_SYMBOLS");
initProp("LINK_SEARCH_START_STATIC");
initProp("LINK_SEARCH_END_STATIC");
initProp("FOLDER");
@@ -500,7 +501,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
const std::string genName = mf->GetGlobalGenerator()->GetName();
if (cmHasLiteralPrefix(genName, "Visual Studio")) {
std::vector<std::string> props;
- cmSystemTools::ExpandListArgument(globals, props);
+ cmExpandList(globals, props);
const std::string vsGlobal = "VS_GLOBAL_";
for (const std::string& i : props) {
// split NAME=VALUE
@@ -743,7 +744,7 @@ public:
bool operator()(std::string const& entry)
{
std::vector<std::string> files;
- cmSystemTools::ExpandListArgument(entry, files);
+ cmExpandList(entry, files);
std::vector<cmSourceFileLocation> locations;
locations.reserve(files.size());
std::transform(files.begin(), files.end(), std::back_inserter(locations),
@@ -1190,7 +1191,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
impl->SourceBacktraces.push_back(lfbt);
}
} else if (prop == propIMPORTED_GLOBAL) {
- if (!cmSystemTools::IsOn(value)) {
+ if (!cmIsOn(value)) {
std::ostringstream e;
e << "IMPORTED_GLOBAL property can't be set to FALSE on targets (\""
<< impl->Name << "\")\n";
@@ -1670,7 +1671,7 @@ const char* cmTarget::GetSafeProperty(const std::string& prop) const
bool cmTarget::GetPropertyAsBool(const std::string& prop) const
{
- return cmSystemTools::IsOn(this->GetProperty(prop));
+ return cmIsOn(this->GetProperty(prop));
}
cmPropertyMap const& cmTarget::GetProperties() const
@@ -1898,7 +1899,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
std::string mapProp = "MAP_IMPORTED_CONFIG_";
mapProp += config_upper;
if (const char* mapValue = this->GetProperty(mapProp)) {
- cmSystemTools::ExpandListArgument(mapValue, mappedConfigs, true);
+ cmExpandList(mapValue, mappedConfigs, true);
}
}
@@ -1985,7 +1986,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
if (!*loc && !*imp) {
std::vector<std::string> availableConfigs;
if (const char* iconfigs = this->GetProperty("IMPORTED_CONFIGURATIONS")) {
- cmSystemTools::ExpandListArgument(iconfigs, availableConfigs);
+ cmExpandList(iconfigs, availableConfigs);
}
for (std::vector<std::string>::const_iterator aci =
availableConfigs.begin();
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 01f2b96..d5c61c1 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -5,7 +5,7 @@
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
-#include "cmSystemTools.h"
+#include "cmStringAlgorithms.h"
cmTest::cmTest(cmMakefile* mf)
: CommandExpandLists(false)
@@ -47,7 +47,7 @@ const char* cmTest::GetProperty(const std::string& prop) const
bool cmTest::GetPropertyAsBool(const std::string& prop) const
{
- return cmSystemTools::IsOn(this->GetProperty(prop));
+ return cmIsOn(this->GetProperty(prop));
}
void cmTest::SetProperty(const std::string& prop, const char* value)
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 916784c..75cb413 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -15,6 +15,7 @@
#include "cmPropertyMap.h"
#include "cmRange.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTest.h"
@@ -83,7 +84,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Expand arguments if COMMAND_EXPAND_LISTS is set
if (this->Test->GetCommandExpandLists()) {
- argv = cmSystemTools::ExpandedLists(argv.begin(), argv.end());
+ argv = cmExpandedLists(argv.begin(), argv.end());
// Expanding lists on an empty command may have left it empty
if (argv.empty()) {
argv.emplace_back();
@@ -102,7 +103,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR");
if (emulator != nullptr && *emulator) {
std::vector<std::string> emulatorWithArgs;
- cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs);
+ cmExpandList(emulator, emulatorWithArgs);
std::string emulatorExe(emulatorWithArgs[0]);
cmSystemTools::ConvertToUnixSlashes(emulatorExe);
os << cmOutputConverter::EscapeForCMake(emulatorExe) << " ";
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index da5d21e..0915986 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -109,7 +109,7 @@ time_t cmTimestamp::CreateUtcTimeTFromTm(struct tm& tm) const
time_t result = mktime(&tm);
-# ifdef CMAKE_BUILD_WITH_CMAKE
+# ifndef CMAKE_BOOTSTRAP
if (tz_was_set) {
cmSystemTools::PutEnv(tz_old);
} else {
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index ed944ac..0847b9b 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -11,6 +11,7 @@
#include "cmRange.h"
#include "cmState.h"
#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -170,7 +171,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
this->Makefile->GetSafeDefinition("CMAKE_CROSSCOMPILING_EMULATOR");
if (!emulator.empty()) {
std::vector<std::string> emulatorWithArgs;
- cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs);
+ cmExpandList(emulator, emulatorWithArgs);
finalCommand +=
cmSystemTools::ConvertToRunCommandPath(emulatorWithArgs[0]);
finalCommand += " ";
@@ -214,8 +215,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
// removed at the end of TRY_RUN and the user can run it manually
// on the target platform.
std::string copyDest = this->Makefile->GetHomeOutputDirectory();
- copyDest += "/CMakeFiles";
- copyDest += "/";
+ copyDest += "/CMakeFiles/";
copyDest += cmSystemTools::GetFilenameWithoutExtension(this->OutputFile);
copyDest += "-";
copyDest += this->RunResultVariable;
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index db67463..97c27cb 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -122,7 +122,7 @@ uv_handle_ptr_<T>::operator T*() const
return this->handle.get();
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
template <>
struct uv_handle_deleter<uv_async_t>
{
@@ -230,7 +230,7 @@ int uv_timer_ptr::start(uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
return uv_timer_start(*this, cb, timeout, repeat);
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
uv_tty_ptr::operator uv_stream_t*() const
{
return reinterpret_cast<uv_stream_t*>(handle.get());
@@ -259,7 +259,7 @@ UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(process)
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(timer)
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(async)
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(tty)
diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx
index 0e903c7..3eb293a 100644
--- a/Source/cmUnsetCommand.cxx
+++ b/Source/cmUnsetCommand.cxx
@@ -24,7 +24,7 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
// what is the variable name
auto const& envVarName = variable.substr(4, variable.size() - 5);
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmSystemTools::UnsetEnv(envVarName.c_str());
#endif
return true;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ed6e4d9..08378eb 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -750,7 +750,7 @@ void cmVisualStudio10TargetGenerator::WritePackageReferences(Elem& e0)
std::vector<std::string> packageReferences;
if (const char* vsPackageReferences =
this->GeneratorTarget->GetProperty("VS_PACKAGE_REFERENCES")) {
- cmSystemTools::ExpandListArgument(vsPackageReferences, packageReferences);
+ cmExpandList(vsPackageReferences, packageReferences);
}
if (!packageReferences.empty()) {
Elem e1(e0, "ItemGroup");
@@ -777,7 +777,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0)
std::vector<std::string> references;
if (const char* vsDotNetReferences =
this->GeneratorTarget->GetProperty("VS_DOTNET_REFERENCES")) {
- cmSystemTools::ExpandListArgument(vsDotNetReferences, references);
+ cmExpandList(vsDotNetReferences, references);
}
cmPropertyMap const& props = this->GeneratorTarget->Target->GetProperties();
for (auto const& i : props.GetList()) {
@@ -838,7 +838,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference(
const char* privateReference = "True";
if (const char* value = this->GeneratorTarget->GetProperty(
"VS_DOTNET_REFERENCES_COPY_LOCAL")) {
- if (cmSystemTools::IsOff(value)) {
+ if (cmIsOff(value)) {
privateReference = "False";
}
}
@@ -854,7 +854,7 @@ void cmVisualStudio10TargetGenerator::WriteImports(Elem& e0)
this->GeneratorTarget->Target->GetProperty("VS_PROJECT_IMPORT");
if (imports) {
std::vector<std::string> argsSplit;
- cmSystemTools::ExpandListArgument(std::string(imports), argsSplit, false);
+ cmExpandList(std::string(imports), argsSplit, false);
for (auto& path : argsSplit) {
if (!cmsys::SystemTools::FileIsFullPath(path)) {
path = this->Makefile->GetCurrentSourceDirectory() + "/" + path;
@@ -1074,7 +1074,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTReferences(Elem& e0)
std::vector<std::string> references;
if (const char* vsWinRTReferences =
this->GeneratorTarget->GetProperty("VS_WINRT_REFERENCES")) {
- cmSystemTools::ExpandListArgument(vsWinRTReferences, references);
+ cmExpandList(vsWinRTReferences, references);
}
if (this->GlobalGenerator->TargetsWindowsPhone() &&
@@ -1948,11 +1948,11 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
const std::string& enableDebug =
cge->Evaluate(this->LocalGenerator, this->Configurations[i]);
if (!enableDebug.empty()) {
- e2.WritePlatformConfigTag(
- "EnableDebuggingInformation",
- "'$(Configuration)|$(Platform)'=='" + this->Configurations[i] +
- "|" + this->Platform + "'",
- cmSystemTools::IsOn(enableDebug) ? "true" : "false");
+ e2.WritePlatformConfigTag("EnableDebuggingInformation",
+ "'$(Configuration)|$(Platform)'=='" +
+ this->Configurations[i] + "|" +
+ this->Platform + "'",
+ cmIsOn(enableDebug) ? "true" : "false");
}
}
}
@@ -1969,7 +1969,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
"DisableOptimizations",
"'$(Configuration)|$(Platform)'=='" + this->Configurations[i] +
"|" + this->Platform + "'",
- (cmSystemTools::IsOn(disableOptimizations) ? "true" : "false"));
+ (cmIsOn(disableOptimizations) ? "true" : "false"));
}
}
}
@@ -2743,7 +2743,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
}
}
if (const char* winRT = clOptions.GetFlag("CompileAsWinRT")) {
- if (cmSystemTools::IsOn(winRT)) {
+ if (cmIsOn(winRT)) {
this->TargetCompileAsWinRT = true;
}
}
@@ -3273,9 +3273,9 @@ void cmVisualStudio10TargetGenerator::WriteManifestOptions(
if (dpiAware) {
if (!strcmp(dpiAware, "PerMonitor")) {
e2.Element("EnableDpiAwareness", "PerMonitorHighDPIAware");
- } else if (cmSystemTools::IsOn(dpiAware)) {
+ } else if (cmIsOn(dpiAware)) {
e2.Element("EnableDpiAwareness", "true");
- } else if (cmSystemTools::IsOff(dpiAware)) {
+ } else if (cmIsOff(dpiAware)) {
e2.Element("EnableDpiAwareness", "false");
} else {
cmSystemTools::Error("Bad parameter for VS_DPI_AWARE: " +
@@ -4027,7 +4027,7 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0)
std::unique_ptr<Elem> spe1;
if (const char* vsSDKReferences =
this->GeneratorTarget->GetProperty("VS_SDK_REFERENCES")) {
- cmSystemTools::ExpandListArgument(vsSDKReferences, sdkReferences);
+ cmExpandList(vsSDKReferences, sdkReferences);
spe1 = cm::make_unique<Elem>(e0, "ItemGroup");
for (std::string const& ri : sdkReferences) {
Elem(*spe1, "SDKReference").Attribute("Include", ri);
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index c33bb7e..a565a9c 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -218,7 +218,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
if (const char* argList =
this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ARGUMENTS")) {
std::vector<std::string> arguments;
- cmSystemTools::ExpandListArgument(argList, arguments);
+ cmExpandList(argList, arguments);
if (!arguments.empty()) {
xout.StartElement("CommandLineArguments");
@@ -239,7 +239,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
if (const char* envList =
this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ENVIRONMENT")) {
std::vector<std::string> envs;
- cmSystemTools::ExpandListArgument(envList, envs);
+ cmExpandList(envList, envs);
if (!envs.empty()) {
xout.StartElement("EnvironmentVariables");
diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx
index 2df3961..2060584 100644
--- a/Source/cm_codecvt.hxx
+++ b/Source/cm_codecvt.hxx
@@ -18,7 +18,7 @@ public:
ANSI
};
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
codecvt(Encoding e);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 3cc6776..1625931 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -31,7 +31,7 @@
#include "cm_string_view.hxx"
#include "cm_sys_stat.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cm_jsoncpp_writer.h"
# include "cmFileAPI.h"
@@ -40,11 +40,11 @@
# include <unordered_map>
#endif
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# define CMAKE_USE_ECLIPSE
#endif
-#if defined(__MINGW32__) && !defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(__MINGW32__) && defined(CMAKE_BOOTSTRAP)
# define CMAKE_BOOT_MINGW
#endif
@@ -72,7 +72,7 @@
# include "cmGlobalWatcomWMakeGenerator.h"
#endif
#include "cmGlobalUnixMakefileGenerator3.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmGlobalNinjaGenerator.h"
#endif
#include "cmExtraCodeLiteGenerator.h"
@@ -92,7 +92,7 @@
#endif
#if defined(__APPLE__)
-# if defined(CMAKE_BUILD_WITH_CMAKE)
+# if !defined(CMAKE_BOOTSTRAP)
# include "cmGlobalXCodeGenerator.h"
# define CMAKE_USE_XCODE 1
@@ -115,7 +115,7 @@
namespace {
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
typedef std::unordered_map<std::string, Json::Value> JsonValueMapType;
#endif
@@ -134,7 +134,7 @@ static void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/,
cmake::cmake(Role role, cmState::Mode mode)
: FileTimeCache(cm::make_unique<cmFileTimeCache>())
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
, VariableWatch(cm::make_unique<cmVariableWatch>())
#endif
, State(cm::make_unique<cmState>())
@@ -203,7 +203,7 @@ cmake::~cmake()
cmDeleteAll(this->Generators);
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
Json::Value cmake::ReportVersionJson() const
{
Json::Value version = Json::objectValue;
@@ -262,7 +262,7 @@ Json::Value cmake::ReportCapabilitiesJson() const
std::string cmake::ReportCapabilities() const
{
std::string result;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
Json::FastWriter writer;
result = writer.write(this->ReportCapabilitiesJson());
#else
@@ -530,7 +530,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
} else if (mode == "COMPILE") {
std::string includes = mf->GetSafeDefinition("PACKAGE_INCLUDE_DIRS");
std::vector<std::string> includeDirs;
- cmSystemTools::ExpandListArgument(includes, includeDirs);
+ cmExpandList(includes, includeDirs);
gg->CreateGenerationObjects();
cmLocalGenerator* lg = gg->LocalGenerators[0];
@@ -547,7 +547,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
std::string libs = mf->GetSafeDefinition("PACKAGE_LIBRARIES");
std::vector<std::string> libList;
- cmSystemTools::ExpandListArgument(libs, libList);
+ cmExpandList(libs, libList);
for (std::string const& lib : libList) {
tgt->AddLinkLibrary(*mf, lib, GENERAL_LibraryType);
}
@@ -968,7 +968,7 @@ int cmake::AddCMakePaths()
this->AddCacheEntry("CMAKE_COMMAND",
cmSystemTools::GetCMakeCommand().c_str(),
"Path to CMake executable.", cmStateEnums::INTERNAL);
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
this->AddCacheEntry(
"CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(),
"Path to ctest program executable.", cmStateEnums::INTERNAL);
@@ -994,7 +994,7 @@ int cmake::AddCMakePaths()
void cmake::AddDefaultExtraGenerators()
{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->ExtraGenerators.push_back(cmExtraCodeBlocksGenerator::GetFactory());
this->ExtraGenerators.push_back(cmExtraCodeLiteGenerator::GetFactory());
this->ExtraGenerators.push_back(cmExtraSublimeTextGenerator::GetFactory());
@@ -1251,7 +1251,7 @@ struct SaveCacheEntry
int cmake::HandleDeleteCacheVariables(const std::string& var)
{
std::vector<std::string> argsSplit;
- cmSystemTools::ExpandListArgument(std::string(var), argsSplit, true);
+ cmExpandList(std::string(var), argsSplit, true);
// erase the property to avoid infinite recursion
this->State->SetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", "");
if (this->State->GetIsInTryCompile()) {
@@ -1365,18 +1365,16 @@ int cmake::Configure()
// so we cannot rely on command line options alone. Always ensure our
// messenger is in sync with the cache.
const char* value = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED");
- this->Messenger->SetSuppressDeprecatedWarnings(value &&
- cmSystemTools::IsOff(value));
+ this->Messenger->SetSuppressDeprecatedWarnings(value && cmIsOff(value));
value = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED");
- this->Messenger->SetDeprecatedWarningsAsErrors(cmSystemTools::IsOn(value));
+ this->Messenger->SetDeprecatedWarningsAsErrors(cmIsOn(value));
value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
- this->Messenger->SetSuppressDevWarnings(cmSystemTools::IsOn(value));
+ this->Messenger->SetSuppressDevWarnings(cmIsOn(value));
value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS");
- this->Messenger->SetDevWarningsAsErrors(value &&
- cmSystemTools::IsOff(value));
+ this->Messenger->SetDevWarningsAsErrors(value && cmIsOff(value));
int ret = this->ActualConfigure();
const char* delCacheVars =
@@ -1521,7 +1519,7 @@ int cmake::ActualConfigure()
this->TruncateOutputLog("CMakeError.log");
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->FileAPI = cm::make_unique<cmFileAPI>(this);
this->FileAPI->ReadQueries();
#endif
@@ -1789,7 +1787,7 @@ int cmake::Generate()
// for the Visual Studio and Xcode generators.)
this->SaveCache(this->GetHomeOutputDirectory());
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
this->FileAPI->WriteReplies();
#endif
@@ -1804,15 +1802,13 @@ void cmake::AddCacheEntry(const std::string& key, const char* value,
this->UnwatchUnusedCli(key);
if (key == "CMAKE_WARN_DEPRECATED") {
- this->Messenger->SetSuppressDeprecatedWarnings(
- value && cmSystemTools::IsOff(value));
+ this->Messenger->SetSuppressDeprecatedWarnings(value && cmIsOff(value));
} else if (key == "CMAKE_ERROR_DEPRECATED") {
- this->Messenger->SetDeprecatedWarningsAsErrors(cmSystemTools::IsOn(value));
+ this->Messenger->SetDeprecatedWarningsAsErrors(cmIsOn(value));
} else if (key == "CMAKE_SUPPRESS_DEVELOPER_WARNINGS") {
- this->Messenger->SetSuppressDevWarnings(cmSystemTools::IsOn(value));
+ this->Messenger->SetSuppressDevWarnings(cmIsOn(value));
} else if (key == "CMAKE_SUPPRESS_DEVELOPER_ERRORS") {
- this->Messenger->SetDevWarningsAsErrors(value &&
- cmSystemTools::IsOff(value));
+ this->Messenger->SetDevWarningsAsErrors(value && cmIsOff(value));
}
}
@@ -1895,7 +1891,7 @@ void cmake::AddDefaultGenerators()
this->Generators.push_back(cmGlobalMinGWMakefileGenerator::NewFactory());
#endif
this->Generators.push_back(cmGlobalUnixMakefileGenerator3::NewFactory());
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# if defined(__linux__) || defined(_WIN32)
this->Generators.push_back(cmGlobalGhsMultiGenerator::NewFactory());
# endif
@@ -2054,7 +2050,7 @@ std::vector<cmDocumentationEntry> cmake::GetGeneratorsDocumentation()
void cmake::PrintGeneratorList()
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmDocumentation doc;
auto generators = this->GetGeneratorsDocumentation();
doc.AppendSection("Generators", generators);
@@ -2159,7 +2155,7 @@ int cmake::CheckBuildSystem()
// If any byproduct of makefile generation is missing we must re-run.
std::vector<std::string> products;
if (const char* productStr = mf.GetDefinition("CMAKE_MAKEFILE_PRODUCTS")) {
- cmSystemTools::ExpandListArgument(productStr, products);
+ cmExpandList(productStr, products);
}
for (std::string const& p : products) {
if (!(cmSystemTools::FileExists(p) || cmSystemTools::FileIsSymlink(p))) {
@@ -2178,8 +2174,8 @@ int cmake::CheckBuildSystem()
const char* dependsStr = mf.GetDefinition("CMAKE_MAKEFILE_DEPENDS");
const char* outputsStr = mf.GetDefinition("CMAKE_MAKEFILE_OUTPUTS");
if (dependsStr && outputsStr) {
- cmSystemTools::ExpandListArgument(dependsStr, depends);
- cmSystemTools::ExpandListArgument(outputsStr, outputs);
+ cmExpandList(dependsStr, depends);
+ cmExpandList(outputsStr, outputs);
}
if (depends.empty() || outputs.empty()) {
// Not enough information was provided to do the test. Just rerun.
@@ -2270,14 +2266,6 @@ void cmake::TruncateOutputLog(const char* fname)
}
}
-inline std::string removeQuotes(const std::string& s)
-{
- if (s.front() == '\"' && s.back() == '\"') {
- return s.substr(1, s.size() - 2);
- }
- return s;
-}
-
void cmake::MarkCliAsUsed(const std::string& variable)
{
this->UsedCliVariables[variable] = true;
@@ -2285,7 +2273,7 @@ void cmake::MarkCliAsUsed(const std::string& variable)
void cmake::GenerateGraphViz(const std::string& fileName) const
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmGraphVizWriter gvWriter(this->GetGlobalGenerator());
std::string settingsFile = this->GetHomeOutputDirectory();
@@ -2563,7 +2551,7 @@ std::vector<std::string> cmake::GetDebugConfigs()
if (const char* config_list =
this->State->GetGlobalProperty("DEBUG_CONFIGURATIONS")) {
// Expand the specified list and convert to upper-case.
- cmSystemTools::ExpandListArgument(config_list, configs);
+ cmExpandList(config_list, configs);
std::transform(configs.begin(), configs.end(), configs.begin(),
cmSystemTools::UpperCase);
}
@@ -2634,7 +2622,7 @@ int cmake::Build(int jobs, const std::string& dir,
const char* cachedVerbose =
this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE");
- if (cmSystemTools::IsOn(cachedVerbose)) {
+ if (cmIsOn(cachedVerbose)) {
verbose = true;
}
@@ -2744,7 +2732,7 @@ bool cmake::Open(const std::string& dir, bool dryRun)
void cmake::WatchUnusedCli(const std::string& var)
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this);
if (this->UsedCliVariables.find(var) == this->UsedCliVariables.end()) {
this->UsedCliVariables[var] = false;
@@ -2754,7 +2742,7 @@ void cmake::WatchUnusedCli(const std::string& var)
void cmake::UnwatchUnusedCli(const std::string& var)
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
this->VariableWatch->RemoveWatch(var, cmWarnUnusedCliWarning);
this->UsedCliVariables.erase(var);
#endif
@@ -2762,7 +2750,7 @@ void cmake::UnwatchUnusedCli(const std::string& var)
void cmake::RunCheckForUnusedVariables()
{
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
bool haveUnused = false;
std::ostringstream msg;
msg << "Manually-specified variables were not used by the project:";
diff --git a/Source/cmake.h b/Source/cmake.h
index 92494ae..4c73519 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -20,7 +20,7 @@
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cm_jsoncpp_value.h"
#endif
@@ -145,7 +145,7 @@ public:
cmake(cmake const&) = delete;
cmake& operator=(cmake const&) = delete;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
Json::Value ReportVersionJson() const;
Json::Value ReportCapabilitiesJson() const;
#endif
@@ -334,7 +334,7 @@ public:
//! this is called by generators to update the progress
void UpdateProgress(const std::string& msg, float prog);
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
//! Get the variable watch object
cmVariableWatch* GetVariableWatch() { return this->VariableWatch.get(); }
#endif
@@ -570,7 +570,7 @@ private:
std::string GraphVizFile;
InstalledFilesMap InstalledFiles;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
std::unique_ptr<cmVariableWatch> VariableWatch;
std::unique_ptr<cmFileAPI> FileAPI;
#endif
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 10a6825..74c0d0f 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -12,7 +12,7 @@
#include "cmake.h"
#include "cmcmd.h"
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
# include "cmDocumentation.h"
# include "cmDynamicLoader.h"
#endif
@@ -20,7 +20,7 @@
#include "cm_uv.h"
#include "cmsys/Encoding.hxx"
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
# include "cmsys/ConsoleBuf.hxx"
#endif
@@ -33,7 +33,7 @@
#include <vector>
namespace {
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
const char* cmDocumentationName[][2] = {
{ nullptr, " cmake - Cross-Platform Makefile Generator." },
{ nullptr, nullptr }
@@ -156,7 +156,7 @@ int do_cmake(int ac, char const* const* av)
return 1;
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmDocumentation doc;
doc.addCMakeStandardDocSections();
if (doc.CheckOptions(ac, av)) {
@@ -321,7 +321,7 @@ int extract_job_number(int& index, char const* current, char const* next,
unsigned long numJobs = 0;
if (jobString.empty()) {
jobs = cmake::DEFAULT_BUILD_PARALLEL_LEVEL;
- } else if (cmSystemTools::StringToULong(jobString.c_str(), &numJobs)) {
+ } else if (cmStrToULong(jobString, &numJobs)) {
if (numJobs == 0) {
std::cerr
<< "The <jobs> value requires a positive integer argument.\n\n";
@@ -339,7 +339,7 @@ int extract_job_number(int& index, char const* current, char const* next,
int do_build(int ac, char const* const* av)
{
-#ifndef CMAKE_BUILD_WITH_CMAKE
+#ifdef CMAKE_BOOTSTRAP
std::cerr << "This cmake does not support --build\n";
return -1;
#else
@@ -439,7 +439,7 @@ int do_build(int ac, char const* const* av)
jobs = cmake::DEFAULT_BUILD_PARALLEL_LEVEL;
} else {
unsigned long numJobs = 0;
- if (cmSystemTools::StringToULong(parallel.c_str(), &numJobs)) {
+ if (cmStrToULong(parallel, &numJobs)) {
if (numJobs == 0) {
std::cerr << "The CMAKE_BUILD_PARALLEL_LEVEL environment variable "
"requires a positive integer argument.\n\n";
@@ -503,7 +503,7 @@ int do_build(int ac, char const* const* av)
int do_install(int ac, char const* const* av)
{
-#ifndef CMAKE_BUILD_WITH_CMAKE
+#ifdef CMAKE_BOOTSTRAP
std::cerr << "This cmake does not support --install\n";
return -1;
#else
@@ -624,7 +624,7 @@ int do_install(int ac, char const* const* av)
int do_open(int ac, char const* const* av)
{
-#ifndef CMAKE_BUILD_WITH_CMAKE
+#ifdef CMAKE_BOOTSTRAP
std::cerr << "This cmake does not support --open\n";
return -1;
#else
@@ -669,7 +669,7 @@ int do_open(int ac, char const* const* av)
int main(int ac, char const* const* av)
{
cmSystemTools::EnsureStdPipes();
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
// Replace streambuf so we can output Unicode to console
cmsys::ConsoleBuf::Manager consoleOut(std::cout);
consoleOut.SetUTF8Pipes();
@@ -699,7 +699,7 @@ int main(int ac, char const* const* av)
}
}
int ret = do_cmake(ac, av);
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
cmDynamicLoader::FlushCache();
#endif
uv_loop_close(uv_default_loop());
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index aecc978..9b8689f 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -19,18 +19,18 @@
#include "cmVersion.h"
#include "cmake.h"
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback.
# include "cmServer.h"
# include "cmServerConnection.h"
#endif
-#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32)
+#if !defined(CMAKE_BOOTSTRAP) && defined(_WIN32)
# include "bindexplib.h"
# include "cmsys/ConsoleBuf.hxx"
#endif
-#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32) && !defined(__CYGWIN__)
+#if !defined(CMAKE_BOOTSTRAP) && defined(_WIN32) && !defined(__CYGWIN__)
# include "cmVisualStudioWCEPlatformParser.h"
#endif
@@ -61,7 +61,7 @@ void CMakeCommandUsage(const char* program)
{
std::ostringstream errorStream;
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
/* clang-format off */
errorStream
<< "cmake version " << cmVersion::GetCMakeVersion() << "\n";
@@ -175,7 +175,7 @@ static int HandleIWYU(const std::string& runCmd,
// Construct the iwyu command line by taking what was given
// and adding all the arguments we give to the compiler.
std::vector<std::string> iwyu_cmd;
- cmSystemTools::ExpandListArgument(runCmd, iwyu_cmd, true);
+ cmExpandList(runCmd, iwyu_cmd, true);
cmAppend(iwyu_cmd, orig_cmd.begin() + 1, orig_cmd.end());
// Run the iwyu command line. Capture its stderr and hide its stdout.
// Ignore its return code because the tool always returns non-zero.
@@ -204,8 +204,7 @@ static int HandleTidy(const std::string& runCmd, const std::string& sourceFile,
// automatically skip over the compiler itself and extract the
// options.
int ret;
- std::vector<std::string> tidy_cmd =
- cmSystemTools::ExpandedListArgument(runCmd, true);
+ std::vector<std::string> tidy_cmd = cmExpandedList(runCmd, true);
tidy_cmd.push_back(sourceFile);
tidy_cmd.emplace_back("--");
cmAppend(tidy_cmd, orig_cmd);
@@ -266,7 +265,7 @@ static int HandleCppLint(const std::string& runCmd,
{
// Construct the cpplint command line.
std::vector<std::string> cpplint_cmd;
- cmSystemTools::ExpandListArgument(runCmd, cpplint_cmd, true);
+ cmExpandList(runCmd, cpplint_cmd, true);
cpplint_cmd.push_back(sourceFile);
// Run the cpplint command line. Capture its output.
@@ -295,7 +294,7 @@ static int HandleCppCheck(const std::string& runCmd,
{
// Construct the cpplint command line.
std::vector<std::string> cppcheck_cmd;
- cmSystemTools::ExpandListArgument(runCmd, cppcheck_cmd, true);
+ cmExpandList(runCmd, cppcheck_cmd, true);
// extract all the -D, -U, and -I options from the compile line
for (auto const& opt : orig_cmd) {
if (opt.size() > 2) {
@@ -408,7 +407,7 @@ int cmcmd::HandleCoCompileCommands(std::vector<std::string> const& args)
if (cmHasLiteralPrefix(arg, "--source=")) {
sourceFile = arg.substr(9);
} else if (cmHasLiteralPrefix(arg, "--launcher=")) {
- cmSystemTools::ExpandListArgument(arg.substr(11), launchers, true);
+ cmExpandList(arg.substr(11), launchers, true);
} else {
// if it was not a co-compiler or --source/--launcher then error
std::cerr << "__run_co_compile given unknown argument: " << arg
@@ -561,7 +560,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 0;
}
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
else if (args[1] == "__create_def") {
if (args.size() < 4) {
std::cerr
@@ -654,7 +653,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 1;
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
if (args[1] == "environment") {
for (auto const& env : cmSystemTools::GetEnvironmentVariables()) {
std::cout << env << std::endl;
@@ -946,8 +945,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& 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)));
+ color = (args[8].size() == 8 || cmIsOn(args[8].substr(8)));
}
} else {
// Support older signature for existing makefiles:
@@ -994,7 +992,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return cmcmd::ExecuteLinkScript(args);
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
// Internal CMake ninja dependency scanning support.
if (args[1] == "cmake_ninja_depends") {
return cmcmd_cmake_ninja_depends(args.begin() + 2, args.end());
@@ -1029,7 +1027,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return cmcmd::ExecuteEchoColor(args);
}
-#ifdef CMAKE_BUILD_WITH_CMAKE
+#ifndef CMAKE_BOOTSTRAP
if ((args[1] == "cmake_autogen") && (args.size() >= 4)) {
cmQtAutoMocUic autoGen;
std::string const& infoDir = args[2];
@@ -1210,7 +1208,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 1;
}
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
cmConnection* conn;
if (isDebug) {
conn = new cmServerStdIoConnection;
@@ -1231,7 +1229,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 1;
}
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+#if !defined(CMAKE_BOOTSTRAP)
// Internal CMake Fortran module support.
if (args[1] == "cmake_copy_f90_mod" && args.size() >= 4) {
return cmDependsFortran::CopyModule(args) ? 0 : 1;
@@ -1412,7 +1410,7 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string> const& args)
// Enable or disable color based on the switch value.
std::string value = arg.substr(9);
if (!value.empty()) {
- enabled = cmSystemTools::IsOn(value);
+ enabled = cmIsOn(value);
}
} else if (cmHasLiteralPrefix(arg, "--progress-dir=")) {
progressDir = arg.substr(15);
@@ -1464,7 +1462,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string> const& args)
bool verbose = false;
if (args.size() >= 4) {
if (args[3].find("--verbose=") == 0) {
- if (!cmSystemTools::IsOff(args[3].substr(10))) {
+ if (!cmIsOff(args[3].substr(10))) {
verbose = true;
}
}
@@ -1547,7 +1545,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string> const& args)
int cmcmd::WindowsCEEnvironment(const char* version, const std::string& name)
{
-#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32) && !defined(__CYGWIN__)
+#if !defined(CMAKE_BOOTSTRAP) && defined(_WIN32) && !defined(__CYGWIN__)
cmVisualStudioWCEPlatformParser parser(name.c_str());
parser.ParseVersion(version);
if (parser.Found()) {
@@ -1605,7 +1603,7 @@ private:
// still works.
int cmcmd::VisualStudioLink(std::vector<std::string> const& args, int type)
{
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
// Replace streambuf so we output in the system codepage. CMake is set up
// to output in Unicode (see SetUTF8Pipes) but the Visual Studio linker
// outputs using the system codepage so we need to change behavior when
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 3b3630f..77a84fd 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -8,7 +8,7 @@
#include "cmSystemTools.h"
#include "cmsys/Encoding.hxx"
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
# include "cmsys/ConsoleBuf.hxx"
#endif
#include <iostream>
@@ -144,7 +144,7 @@ static const char* cmDocumentationOptions[][2] = {
int main(int argc, char const* const* argv)
{
cmSystemTools::EnsureStdPipes();
-#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
// Replace streambuf so we can output Unicode to console
cmsys::ConsoleBuf::Manager consoleOut(std::cout);
consoleOut.SetUTF8Pipes();
diff --git a/Tests/CMakeLib/testStringAlgorithms.cxx b/Tests/CMakeLib/testStringAlgorithms.cxx
index 55d2a8f..a92a910 100644
--- a/Tests/CMakeLib/testStringAlgorithms.cxx
+++ b/Tests/CMakeLib/testStringAlgorithms.cxx
@@ -51,6 +51,29 @@ int testStringAlgorithms(int /*unused*/, char* /*unused*/ [])
}
// ----------------------------------------------------------------------
+ // Test cmRemoveQuotes
+ {
+ auto test = [&assert_string](cm::string_view source,
+ cm::string_view expected,
+ cm::string_view title) {
+ assert_string(cmRemoveQuotes(source), expected, title);
+ };
+
+ test("", "", "cmRemoveQuotes empty");
+ test("\"", "\"", "cmRemoveQuotes single quote");
+ test("\"\"", "", "cmRemoveQuotes double quote");
+ test("\"a", "\"a", "cmRemoveQuotes quote char");
+ test("\"ab", "\"ab", "cmRemoveQuotes quote char char");
+ test("a\"", "a\"", "cmRemoveQuotes char quote");
+ test("ab\"", "ab\"", "cmRemoveQuotes char char quote");
+ test("a", "a", "cmRemoveQuotes single char");
+ test("ab", "ab", "cmRemoveQuotes two chars");
+ test("abc", "abc", "cmRemoveQuotes three chars");
+ test("\"abc\"", "abc", "cmRemoveQuotes quoted chars");
+ test("\"\"abc\"\"", "\"abc\"", "cmRemoveQuotes quoted quoted chars");
+ }
+
+ // ----------------------------------------------------------------------
// Test cmEscapeQuotes
{
assert_string(cmEscapeQuotes("plain"), "plain", "cmEscapeQuotes plain");
@@ -167,5 +190,40 @@ int testStringAlgorithms(int /*unused*/, char* /*unused*/ [])
assert_ok(!cmHasLiteralSuffix(str, "ab"), "cmHasLiteralPrefix string not");
}
+ // ----------------------------------------------------------------------
+ // Test cmStrToLong
+ {
+ long value;
+ assert_ok(cmStrToLong("1", &value) && value == 1,
+ "cmStrToLong parses a positive decimal integer.");
+ assert_ok(cmStrToLong(" 1", &value) && value == 1,
+ "cmStrToLong parses a decimal integer after whitespace.");
+
+ assert_ok(cmStrToLong("-1", &value) && value == -1,
+ "cmStrToLong parses a negative decimal integer.");
+ assert_ok(
+ cmStrToLong(" -1", &value) && value == -1,
+ "cmStrToLong parses a negative decimal integer after whitespace.");
+
+ assert_ok(!cmStrToLong("1x", &value),
+ "cmStrToLong rejects trailing content.");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmStrToULong
+ {
+ unsigned long value;
+ assert_ok(cmStrToULong("1", &value) && value == 1,
+ "cmStrToULong parses a decimal integer.");
+ assert_ok(cmStrToULong(" 1", &value) && value == 1,
+ "cmStrToULong parses a decimal integer after whitespace.");
+ assert_ok(!cmStrToULong("-1", &value),
+ "cmStrToULong rejects a negative number.");
+ assert_ok(!cmStrToULong(" -1", &value),
+ "cmStrToULong rejects a negative number after whitespace.");
+ assert_ok(!cmStrToULong("1x", &value),
+ "cmStrToULong rejects trailing content.");
+ }
+
return failed;
}
diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx
index 121e639..0a757df 100644
--- a/Tests/CMakeLib/testSystemTools.cxx
+++ b/Tests/CMakeLib/testSystemTools.cxx
@@ -94,21 +94,5 @@ int testSystemTools(int /*unused*/, char* /*unused*/ [])
cmPassed("cmSystemTools::strverscmp working");
}
- // ----------------------------------------------------------------------
- // Test cmSystemTools::StringToULong
- {
- unsigned long value;
- cmAssert(cmSystemTools::StringToULong("1", &value) && value == 1,
- "StringToULong parses a decimal integer.");
- cmAssert(cmSystemTools::StringToULong(" 1", &value) && value == 1,
- "StringToULong parses a decimal integer after whitespace.");
- cmAssert(!cmSystemTools::StringToULong("-1", &value),
- "StringToULong rejects a negative number.");
- cmAssert(!cmSystemTools::StringToULong(" -1", &value),
- "StringToULong rejects a negative number after whitespace.");
- cmAssert(!cmSystemTools::StringToULong("1x", &value),
- "StringToULong rejects trailing content.");
- }
-
return failed;
}
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
index 6190089..6e3697f 100644
--- a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
@@ -27,12 +27,12 @@ endif()
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
add_library(CUDANoDeviceResolve SHARED file1.cu)
set_target_properties(CUDANoDeviceResolve
PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
- CUDA_RESOLVE_DEVICE_SYMBOLS OFF
POSITION_INDEPENDENT_CODE ON)
if(MSVC)
target_link_options(CUDANoDeviceResolve PRIVATE "/FORCE:UNRESOLVED")
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 169ba07..27838a4 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -6,9 +6,17 @@ foreach(t MultiThreaded SingleThreaded)
foreach(dbg "" Debug)
foreach(dll "" DLL)
set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_${t}${dbg}${dll}")
- # ifort does not actually define these, so inject them
- string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
- string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+ if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+ # ifort does not actually define these, so inject them
+ string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
+ string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Flang")
+ # flang does not actually define these, so inject them
+ string(REPLACE ";--dependent-lib=libcmt;" ";--dependent-lib=libcmt;-D_MT;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=msvcrt;" ";--dependent-lib=msvcrt;-D_MT;-D_DLL;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=libcmtd;" ";--dependent-lib=libcmtd;-D_MT;-D_DEBUG;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=msvcrtd;" ";--dependent-lib=msvcrtd;-D_MT;-D_DEBUG;-D_DLL;" "${var}" ";${${var}};")
+ endif()
endforeach()
endforeach()
endforeach()
@@ -45,6 +53,6 @@ endfunction()
verify(Fortran verify.F90)
# Intel Fortran for Windows supports single-threaded RTL but it is
# not implemented by the Visual Studio integration.
-if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
verify_combinations(SingleThreaded Fortran verify.F90)
endif()
diff --git a/bootstrap b/bootstrap
index c97a5d4..4581239 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1362,7 +1362,6 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_
cmake_report cmConfigure.h${_tmp} "#define CMake_DEFAULT_RECURSION_LIMIT 400"
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
-cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
# Regenerate configured headers
@@ -1408,7 +1407,6 @@ if ${cmake_system_mingw}; then
uv_c_flags="${uv_c_flags} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
libs="${libs} -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -lole32 -loleaut32"
else
- uv_c_flags="${uv_c_flags} -DCMAKE_BOOTSTRAP"
case "${cmake_system}" in
*AIX*)
uv_c_flags="${uv_c_flags} -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT"
@@ -1469,11 +1467,13 @@ cmake_cxx_flags_SystemTools="
-DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
"
cmake_c_flags="${cmake_c_flags} \
+ -DCMAKE_BOOTSTRAP \
-I`cmake_escape \"${cmake_bootstrap_dir}\"` \
-I`cmake_escape \"${cmake_source_dir}/Source\"` \
-I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \
-I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
cmake_cxx_flags="${cmake_cxx_flags} \
+ -DCMAKE_BOOTSTRAP \
-I`cmake_escape \"${cmake_bootstrap_dir}\"` \
-I`cmake_escape \"${cmake_source_dir}/Source\"` \
-I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \