Merge topic 'exe-check' 8d48d755f0 Tests: Add missing execute_process result checks a1b5c0da87 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL 6b4432bc10 FindGit: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !12011
diff --git a/.clang-tidy b/.clang-tidy index ae0dc23..3a0fd82 100644 --- a/.clang-tidy +++ b/.clang-tidy
@@ -90,4 +90,18 @@ value: '0' - key: modernize-use-auto.MinTypeNameLength value: '80' + - key: readability-identifier-naming.ClassCase + value: 'CamelCase' + - key: readability-identifier-naming.ClassIgnoredRegexp + value: 'cm[A-Z][A-Za-z]+|(const_)?iterator' + - key: readability-identifier-naming.ClassMemberCase + value: 'CamelCase' + - key: readability-identifier-naming.ClassMemberIgnoredRegexp + value: 'prop[A-Z_]+' + - key: readability-identifier-naming.PrivateMemberCase + value: 'CamelCase' + - key: readability-identifier-naming.ParameterCase + value: 'camelBack' + - key: readability-identifier-naming.LocalVariableCase + value: 'camelBack' ...
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst index 857d498..49b348f 100644 --- a/Help/manual/cmake-file-api.7.rst +++ b/Help/manual/cmake-file-api.7.rst
@@ -1017,6 +1017,9 @@ This field was added in codemodel version 2.4. + Since codemodel version 2.11, this field additionally accounts for + ``SOURCES`` file sets. + ``fileSetDirectories`` Optional member that is present when ``type`` is ``fileSet``. The value is a list of strings with the file set's base directories (determined by
diff --git a/Help/manual/file_api/schema_target.json b/Help/manual/file_api/schema_target.json index 68cb14e..925c259 100644 --- a/Help/manual/file_api/schema_target.json +++ b/Help/manual/file_api/schema_target.json
@@ -34,6 +34,9 @@ }, { "$ref": "#/definitions/codemodelV2_10" + }, + { + "$ref": "#/definitions/codemodelV2_11" } ], "definitions": { @@ -68,7 +71,25 @@ }, "minor": { "type": "integer", - "minimum": 10 + "const": 10 + } + }, + "additionalProperties": false + }, + "codemodelVersionV2_11": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "const": 2 + }, + "minor": { + "type": "integer", + "minimum": 11 } }, "additionalProperties": false @@ -81,7 +102,22 @@ "type": "string", "description": "Unique identifier for the target. The format is unspecified and should not be interpreted by clients." }, - "typeV2_0": { + "fileset-typeV2_5": { + "type": "string", + "enum": [ + "HEADERS", + "CXX_MODULES" + ] + }, + "fileset-typeV2_11": { + "type": "string", + "enum": [ + "HEADERS", + "CXX_MODULES", + "SOURCES" + ] + }, + "target-typeV2_0": { "type": "string", "enum": [ "EXECUTABLE", @@ -93,7 +129,7 @@ "UTILITY" ] }, - "typeV2_9": { + "target-typeV2_9": { "type": "string", "enum": [ "EXECUTABLE", @@ -530,12 +566,45 @@ "type": "string" }, "type": { + "$ref": "#/definitions/fileset-typeV2_5" + }, + "visibility": { "type": "string", "enum": [ - "HEADERS", - "CXX_MODULES" + "PUBLIC", + "PRIVATE", + "INTERFACE" ] }, + "baseDirectories": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + }, + "description": "Base directories containing the file set's files. If a directory is inside the top level source directory, its path is specified relative to that directory. Otherwise, its path is absolute." + } + }, + "additionalProperties": false + } + }, + "fileSetsV2_11": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "type", + "visibility", + "baseDirectories" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/fileset-typeV2_11" + }, "visibility": { "type": "string", "enum": [ @@ -1094,7 +1163,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_0" + "$ref": "#/definitions/target-typeV2_0" }, "backtrace": { "$ref": "#/definitions/backtrace" @@ -1158,7 +1227,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_0" + "$ref": "#/definitions/target-typeV2_0" }, "backtrace": { "$ref": "#/definitions/backtrace" @@ -1222,7 +1291,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_0" + "$ref": "#/definitions/target-typeV2_0" }, "backtrace": { "$ref": "#/definitions/backtrace" @@ -1286,7 +1355,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_0" + "$ref": "#/definitions/target-typeV2_0" }, "backtrace": { "$ref": "#/definitions/backtrace" @@ -1353,7 +1422,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_0" + "$ref": "#/definitions/target-typeV2_0" }, "backtrace": { "$ref": "#/definitions/backtrace" @@ -1420,7 +1489,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_0" + "$ref": "#/definitions/target-typeV2_0" }, "backtrace": { "$ref": "#/definitions/backtrace" @@ -1490,7 +1559,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_0" + "$ref": "#/definitions/target-typeV2_0" }, "backtrace": { "$ref": "#/definitions/backtrace" @@ -1567,7 +1636,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_9" + "$ref": "#/definitions/target-typeV2_9" }, "imported": { "$ref": "#/definitions/importedV2_9" @@ -1674,7 +1743,7 @@ "$ref": "#/definitions/id" }, "type": { - "$ref": "#/definitions/typeV2_9" + "$ref": "#/definitions/target-typeV2_9" }, "imported": { "$ref": "#/definitions/importedV2_9" @@ -1762,6 +1831,116 @@ } }, "additionalProperties": false + }, + "codemodelV2_11": { + "required": [ + "codemodelVersion", + "name", + "id", + "type", + "paths", + "sources", + "backtraceGraph" + ], + "properties": { + "codemodelVersion": { + "$ref": "#/definitions/codemodelVersionV2_11" + }, + "name": { + "$ref": "#/definitions/name" + }, + "id": { + "$ref": "#/definitions/id" + }, + "type": { + "$ref": "#/definitions/target-typeV2_9" + }, + "imported": { + "$ref": "#/definitions/importedV2_9" + }, + "local": { + "$ref": "#/definitions/localV2_9" + }, + "abstract": { + "$ref": "#/definitions/abstractV2_9" + }, + "backtrace": { + "$ref": "#/definitions/backtrace" + }, + "folder": { + "$ref": "#/definitions/folder" + }, + "paths": { + "$ref": "#/definitions/paths" + }, + "nameOnDisk": { + "$ref": "#/definitions/nameOnDisk" + }, + "artifacts": { + "$ref": "#/definitions/artifacts" + }, + "isGeneratorProvided": { + "$ref": "#/definitions/isGeneratorProvided" + }, + "install": { + "$ref": "#/definitions/install" + }, + "launchers": { + "$ref": "#/definitions/launchersV2_7" + }, + "link": { + "$ref": "#/definitions/link" + }, + "archive": { + "$ref": "#/definitions/archive" + }, + "debugger": { + "$ref": "#/definitions/debuggerV2_8" + }, + "dependencies": { + "$ref": "#/definitions/dependencies" + }, + "linkLibraries": { + "$ref": "#/definitions/linkLibrariesV2_9" + }, + "interfaceLinkLibraries": { + "$ref": "#/definitions/interfaceLinkLibrariesV2_9" + }, + "compileDependencies": { + "$ref": "#/definitions/compileDependenciesV2_9" + }, + "interfaceCompileDependencies": { + "$ref": "#/definitions/interfaceCompileDependenciesV2_9" + }, + "objectDependencies": { + "$ref": "#/definitions/onlyTargetDependenciesArrayV2_9" + }, + "orderDependencies": { + "$ref": "#/definitions/onlyTargetDependenciesArrayV2_9" + }, + "fileSets": { + "$ref": "#/definitions/fileSetsV2_11" + }, + "sources": { + "$ref": "#/definitions/sourcesV2_5" + }, + "interfaceSources": { + "$ref": "#/definitions/interfaceSourcesV2_10" + }, + "symbolic": { + "$ref": "#/definitions/symbolicV2_9" + }, + "sourceGroups": { + "$ref": "#/definitions/sourceGroupsV2_10" + }, + "compileGroups": { + "$ref": "#/definitions/compileGroupsV2_6" + }, + "backtraceGraph": { + "$ref": "#/definitions/backtraceGraph" + } + }, + "additionalProperties": false } } }
diff --git a/Help/release/dev/OpenWatcom-linker-id.rst b/Help/release/dev/OpenWatcom-linker-id.rst new file mode 100644 index 0000000..6bc05bd --- /dev/null +++ b/Help/release/dev/OpenWatcom-linker-id.rst
@@ -0,0 +1,5 @@ +openwatcom-linker-id +-------------------- + +* The :variable:`CMAKE_<LANG>_COMPILER_LINKER_ID` variable learned to detect + the OpenWatcom ``wlink`` linker.
diff --git a/Help/release/dev/file-api-FILE_SET-SOURCES.rst b/Help/release/dev/file-api-FILE_SET-SOURCES.rst new file mode 100644 index 0000000..e121c65 --- /dev/null +++ b/Help/release/dev/file-api-FILE_SET-SOURCES.rst
@@ -0,0 +1,8 @@ +file-api-FILE_SET-SOURCES +------------------------- + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 object has been + updated to 2.11. +* The :manual:`cmake-file-api(7)` "codemodel" version 2 "installers" object's + optional ``fileSetType`` field gained a new ``SOURCES`` value to incorporate + the new :ref:`file set <file sets>` ``SOURCES`` type in codemodel replies.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_LINKER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_LINKER_ID.rst index 5a70a94..21b31c4 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_LINKER_ID.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_LINKER_ID.rst
@@ -22,6 +22,7 @@ `sold`_ linker ``Solaris`` SunOS system linker ``WILD`` `wild`_ linker +``OpenWatcom`` `OpenWatcom wlink`_ linker =============================== =============================================== This variable is not guaranteed to be defined for all linkers or languages. @@ -33,3 +34,4 @@ .. _mold\: A Modern Linker: https://github.com/rui314/mold .. _sold: https://github.com/bluewhalesystems/sold .. _wild: https://github.com/wild-linker/wild +.. _OpenWatcom wlink: https://www.openwatcom.com/
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake index 04c790b..2a22ff2 100644 --- a/Modules/CMakeTestFortranCompiler.cmake +++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -65,7 +65,7 @@ # Test for Fortran 90 support by using an f90-specific construct. if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90) message(CHECK_START "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90") - set(__TestCompiler_testFortranCompilerSource " + set(__TestCompiler_testFortranCompilerF90Source " PROGRAM TESTFortran90 integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do END PROGRAM TESTFortran90
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake index 0be24c7..9d12677 100644 --- a/Modules/Compiler/NAG-Fortran.cmake +++ b/Modules/Compiler/NAG-Fortran.cmake
@@ -45,7 +45,13 @@ set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free") set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-PIC") set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "-PIC") -set(CMAKE_Fortran_RESPONSE_FILE_LINK_FLAG "-Wl,@") +if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 6.2) + set(CMAKE_Fortran_RESPONSE_FILE_LINK_FLAG "-xldarg @") + set(CMAKE_Fortran_RESPONSE_FILE_ARCHIVE_FLAG "@") + set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_LIBRARIES 0) +else() + set(CMAKE_Fortran_RESPONSE_FILE_LINK_FLAG "@") +endif() set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp") set(CMAKE_Fortran_LINK_MODE DRIVER)
diff --git a/Modules/Internal/CMakeDetermineLinkerId.cmake b/Modules/Internal/CMakeDetermineLinkerId.cmake index 478123d..7e2e433 100644 --- a/Modules/Internal/CMakeDetermineLinkerId.cmake +++ b/Modules/Internal/CMakeDetermineLinkerId.cmake
@@ -86,6 +86,11 @@ set(linker_frontend "MSVC") set(linker_version "${CMAKE_MATCH_1}") break() + elseif(linker_desc MATCHES "Open Watcom Linker Version ([0-9.]+)") + set(linker_id "OpenWatcom") + set(linker_frontend "OpenWatcom") + set(linker_version "${CMAKE_MATCH_1}") + break() elseif (CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND linker_desc MATCHES "Solaris Link Editors: ([0-9.-]+)") set(linker_id "Solaris") set(linker_version "${CMAKE_MATCH_1}")
diff --git a/Modules/Platform/Windows-PellesC.cmake b/Modules/Platform/Windows-PellesC.cmake index d29cc4a..c378c23 100644 --- a/Modules/Platform/Windows-PellesC.cmake +++ b/Modules/Platform/Windows-PellesC.cmake
@@ -12,12 +12,13 @@ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> <LINK_FLAGS> -out:<TARGET> <OBJECTS>") set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "<CMAKE_LINKER> <OBJECTS> -out:<TARGET> -implib:<TARGET_IMPLIB> -dll -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES>") + "<CMAKE_LINKER> <OBJECTS> ${CMAKE_START_TEMP_FILE} -out:<TARGET> -implib:<TARGET_IMPLIB> -dll -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "") + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) set(CMAKE_${lang}_LINK_EXECUTABLE - "<CMAKE_LINKER> <OBJECTS> -out:<TARGET> -implib:<TARGET_IMPLIB> -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES>") + "<CMAKE_LINKER> <OBJECTS> ${CMAKE_START_TEMP_FILE} -out:<TARGET> -implib:<TARGET_IMPLIB> -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_LINK_DEF_FILE_FLAG "${CMAKE_LINK_DEF_FILE_FLAG}")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index d931fa3..4558c81 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 4) set(CMake_VERSION_MINOR 3) -set(CMake_VERSION_PATCH 20260506) +set(CMake_VERSION_PATCH 20260507) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index be816d5..ff31855 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx
@@ -823,7 +823,7 @@ // Update the following files as well when updating this constant: // Help/manual/cmake-file-api.7.rst // Tests/RunCMake/FileAPI/codemodel-v2-check.py (check_objects()) -static unsigned int const CodeModelV2Minor = 10; +static unsigned int const CodeModelV2Minor = 11; void cmFileAPI::BuildClientRequestCodeModel( ClientRequest& r, std::vector<RequestVersion> const& versions)
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 8b214b6..3627cb9 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx
@@ -1495,6 +1495,9 @@ cmGeneratorExpressionInterpreter genexInterpreter(lg, this->Config, this->GT, fd.Language); + cmGeneratorFileSet const* fileSet = + GT->GetFileSetForSource(this->Config, sf); + std::string const COMPILE_FLAGS("COMPILE_FLAGS"); if (cmValue cflags = sf->GetProperty(COMPILE_FLAGS)) { std::string flags = genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS); @@ -1511,6 +1514,19 @@ BT<std::string> opt(tmp, tmpOpt.Backtrace); fd.Flags.emplace_back(this->ToJBT(opt)); } + // File set compile options, if any + if (fileSet) { + for (BT<std::string> const& tmpOpt : fileSet->BelongsTo(this->GT) + ? fileSet->GetCompileOptions(this->Config, fd.Language) + : fileSet->GetInterfaceCompileOptions(this->Config, fd.Language)) { + // We need to use the AppendCompileOptions method so we handle situations + // where backtrace entries have list and properly escape flags. + std::string tmp; + lg->AppendCompileOptions(tmp, tmpOpt.Value); + BT<std::string> opt(tmp, tmpOpt.Backtrace); + fd.Flags.emplace_back(this->ToJBT(opt)); + } + } // Add precompile headers compile options. std::vector<std::string> pchArchs = @@ -1548,9 +1564,31 @@ fd.Flags.emplace_back(this->ToJBT(opt)); } + std::string const INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES"); + // Add include directories from file set properties. + if (fileSet) { + for (BT<std::string> const& tmpInclude : fileSet->BelongsTo(this->GT) + ? fileSet->GetIncludeDirectories(this->Config, fd.Language) + : fileSet->GetInterfaceIncludeDirectories(this->Config, + fd.Language)) { + // We need to use the AppendIncludeDirectories method so we handle + // situations where backtrace entries have lists. + std::vector<std::string> tmp; + lg->AppendIncludeDirectories(tmp, tmpInclude.Value, *sf); + for (std::string& i : tmp) { + bool const isSystemInclude = + this->GT->IsSystemIncludeDirectory(i, this->Config, fd.Language); + BT<std::string> include(i, tmpInclude.Backtrace); + if (this->GT->IsApple() && cmSystemTools::IsPathToFramework(i)) { + fd.Frameworks.emplace_back(this->ToJBT(include), isSystemInclude); + } else { + fd.Includes.emplace_back(this->ToJBT(include), isSystemInclude); + } + } + } + } // Add include directories from source file properties. { - std::string const INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES"); for (BT<std::string> tmpInclude : sf->GetIncludeDirectories()) { tmpInclude.Value = genexInterpreter.Evaluate(tmpInclude.Value, INCLUDE_DIRECTORIES); @@ -1597,7 +1635,25 @@ genexInterpreter.Evaluate(*config_defs, COMPILE_DEFINITIONS)); } - fd.Defines.reserve(fileDefines.size() + configFileDefines.size()); + std::set<BT<std::string>> fileSetDefines; + if (fileSet) { + for (BT<std::string> const& tmpDef : fileSet->BelongsTo(this->GT) + ? fileSet->GetCompileDefinitions(this->Config, fd.Language) + : fileSet->GetInterfaceCompileDefinitions(this->Config, + fd.Language)) { + // We need to use the AppendDefines method so we handle situations where + // backtrace entries have lists. + std::set<std::string> tmp; + lg->AppendDefines(tmp, tmpDef.Value); + for (std::string const& i : tmp) { + BT<std::string> def(i, tmpDef.Backtrace); + fileSetDefines.insert(def); + } + } + } + + fd.Defines.reserve(fileDefines.size() + configFileDefines.size() + + fileSetDefines.size()); for (BT<std::string> const& def : fileDefines) { fd.Defines.emplace_back(this->ToJBT(def)); @@ -1607,6 +1663,10 @@ fd.Defines.emplace_back(d, JBTIndex()); } + for (BT<std::string> const& def : fileSetDefines) { + fd.Defines.emplace_back(this->ToJBT(def)); + } + return fd; }
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 8137d69..5a3c72d 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx
@@ -306,10 +306,10 @@ std::string component = helper.DefaultComponentName; int componentCount = 0; - bool doing_script = false; - bool doing_code = false; - bool exclude_from_all = false; - bool all_components = false; + bool doingScript = false; + bool doingCode = false; + bool excludeFromAll = false; + bool allComponents = false; // Scan the args once for COMPONENT. Only allow one. // @@ -320,9 +320,9 @@ component = args[i]; } if (args[i] == "EXCLUDE_FROM_ALL") { - exclude_from_all = true; + excludeFromAll = true; } else if (args[i] == "ALL_COMPONENTS") { - all_components = true; + allComponents = true; } } @@ -333,7 +333,7 @@ return false; } - if (all_components && componentCount == 1) { + if (allComponents && componentCount == 1) { status.SetError("ALL_COMPONENTS and COMPONENT are mutually exclusive"); return false; } @@ -343,16 +343,16 @@ // for (std::string const& arg : args) { if (arg == "SCRIPT") { - doing_script = true; - doing_code = false; + doingScript = true; + doingCode = false; } else if (arg == "CODE") { - doing_script = false; - doing_code = true; + doingScript = false; + doingCode = true; } else if (arg == "COMPONENT") { - doing_script = false; - doing_code = false; - } else if (doing_script) { - doing_script = false; + doingScript = false; + doingCode = false; + } else if (doingScript) { + doingScript = false; std::string script = arg; if (!cmHasLiteralPrefix(script, "$<INSTALL_PREFIX>")) { if (!cmSystemTools::FileIsFullPath(script)) { @@ -366,23 +366,23 @@ } helper.Makefile->AddInstallGenerator( cm::make_unique<cmInstallScriptGenerator>( - script, false, component, exclude_from_all, all_components, + script, false, component, excludeFromAll, allComponents, helper.Makefile->GetBacktrace())); - } else if (doing_code) { - doing_code = false; + } else if (doingCode) { + doingCode = false; std::string const& code = arg; helper.Makefile->AddInstallGenerator( cm::make_unique<cmInstallScriptGenerator>( - code, true, component, exclude_from_all, all_components, + code, true, component, excludeFromAll, allComponents, helper.Makefile->GetBacktrace())); } } - if (doing_script) { + if (doingScript) { status.SetError("given no value for SCRIPT argument."); return false; } - if (doing_code) { + if (doingCode) { status.SetError("given no value for CODE argument."); return false; } @@ -699,11 +699,11 @@ cmTarget* target = helper.Makefile->FindLocalNonAliasTarget(tgt); if (!target) { // If no local target has been found, find it in the global scope. - cmTarget* const global_target = + cmTarget* const globalTarget = helper.Makefile->GetGlobalGenerator()->FindTarget( tgt, { cmStateEnums::TargetDomain::NATIVE }); - if (global_target && !global_target->IsImported()) { - target = global_target; + if (globalTarget && !globalTarget->IsImported()) { + target = globalTarget; } } if (target) { @@ -1364,11 +1364,11 @@ cmTarget* target = helper.Makefile->FindTargetToUse(tgt); if (!target || !target->IsImported()) { // If no local target has been found, find it in the global scope. - cmTarget* const global_target = + cmTarget* const globalTarget = helper.Makefile->GetGlobalGenerator()->FindTarget( tgt, { cmStateEnums::TargetDomain::NATIVE }); - if (global_target && global_target->IsImported()) { - target = global_target; + if (globalTarget && globalTarget->IsImported()) { + target = globalTarget; } } if (target) { @@ -1634,21 +1634,21 @@ DoingType }; Doing doing = DoingDirs; - bool in_match_mode = false; + bool inMatchMode = false; bool optional = false; - bool exclude_from_all = false; - bool message_never = false; + bool excludeFromAll = false; + bool messageNever = false; std::vector<std::string> dirs; cm::optional<std::string> destination; - std::string permissions_file; - std::string permissions_dir; + std::string permissionsFile; + std::string permissionsDir; std::vector<std::string> configurations; std::string component = helper.DefaultComponentName; - std::string literal_args; + std::string literalArgs; std::string type; for (unsigned int i = 1; i < args.size(); ++i) { if (args[i] == "DESTINATION") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1657,7 +1657,7 @@ // Switch to setting the destination property. doing = DoingDestination; } else if (args[i] == "TYPE") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1666,7 +1666,7 @@ // Switch to setting the type. doing = DoingType; } else if (args[i] == "OPTIONAL") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1676,44 +1676,44 @@ optional = true; doing = DoingNone; } else if (args[i] == "MESSAGE_NEVER") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; } // Mark the rule as quiet. - message_never = true; + messageNever = true; doing = DoingNone; } else if (args[i] == "PATTERN") { // Switch to a new pattern match rule. doing = DoingPattern; - in_match_mode = true; + inMatchMode = true; } else if (args[i] == "REGEX") { // Switch to a new regex match rule. doing = DoingRegex; - in_match_mode = true; + inMatchMode = true; } else if (args[i] == "EXCLUDE") { // Add this property to the current match rule. - if (!in_match_mode || doing == DoingPattern || doing == DoingRegex) { + if (!inMatchMode || doing == DoingPattern || doing == DoingRegex) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" before a PATTERN or REGEX is given.")); return false; } - literal_args += " EXCLUDE"; + literalArgs += " EXCLUDE"; doing = DoingNone; } else if (args[i] == "PERMISSIONS") { - if (!in_match_mode) { + if (!inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" before a PATTERN or REGEX is given.")); return false; } // Switch to setting the current match permissions property. - literal_args += " PERMISSIONS"; + literalArgs += " PERMISSIONS"; doing = DoingPermsMatch; } else if (args[i] == "FILE_PERMISSIONS") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1722,7 +1722,7 @@ // Switch to setting the file permissions property. doing = DoingPermsFile; } else if (args[i] == "DIRECTORY_PERMISSIONS") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1731,27 +1731,27 @@ // Switch to setting the directory permissions property. doing = DoingPermsDir; } else if (args[i] == "USE_SOURCE_PERMISSIONS") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; } // Add this option literally. - literal_args += " USE_SOURCE_PERMISSIONS"; + literalArgs += " USE_SOURCE_PERMISSIONS"; doing = DoingNone; } else if (args[i] == "FILES_MATCHING") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; } // Add this option literally. - literal_args += " FILES_MATCHING"; + literalArgs += " FILES_MATCHING"; doing = DoingNone; } else if (args[i] == "CONFIGURATIONS") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1760,7 +1760,7 @@ // Switch to setting the configurations property. doing = DoingConfigurations; } else if (args[i] == "COMPONENT") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1769,12 +1769,12 @@ // Switch to setting the component property. doing = DoingComponent; } else if (args[i] == "EXCLUDE_FROM_ALL") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; } - exclude_from_all = true; + excludeFromAll = true; doing = DoingNone; } else if (doing == DoingDirs) { // If the given directory is not a full path, convert it to one by @@ -1833,14 +1833,14 @@ // leading slash and trailing end-of-string in the matched // string to make sure the pattern matches only whole file // names. - literal_args += " REGEX \"/"; + literalArgs += " REGEX \"/"; std::string regex = cmsys::Glob::PatternToRegex(args[i], false); cmSystemTools::ReplaceString(regex, "\\", "\\\\"); - literal_args += regex; - literal_args += "$\""; + literalArgs += regex; + literalArgs += "$\""; doing = DoingNone; } else if (doing == DoingRegex) { - literal_args += " REGEX \""; + literalArgs += " REGEX \""; // Match rules are case-insensitive on some platforms. #if defined(_WIN32) || defined(__APPLE__) std::string regex = cmSystemTools::LowerCase(args[i]); @@ -1848,8 +1848,8 @@ std::string regex = args[i]; #endif cmSystemTools::ReplaceString(regex, "\\", "\\\\"); - literal_args += regex; - literal_args += "\""; + literalArgs += regex; + literalArgs += "\""; doing = DoingNone; } else if (doing == DoingComponent) { component = args[i]; @@ -1857,7 +1857,7 @@ } else if (doing == DoingPermsFile) { // Check the requested permission. if (!cmInstallCommandArguments::CheckPermissions(args[i], - permissions_file)) { + permissionsFile)) { status.SetError(cmStrCat(args[0], " given invalid file permission \"", args[i], "\".")); return false; @@ -1865,15 +1865,14 @@ } else if (doing == DoingPermsDir) { // Check the requested permission. if (!cmInstallCommandArguments::CheckPermissions(args[i], - permissions_dir)) { + permissionsDir)) { status.SetError(cmStrCat( args[0], " given invalid directory permission \"", args[i], "\".")); return false; } } else if (doing == DoingPermsMatch) { // Check the requested permission. - if (!cmInstallCommandArguments::CheckPermissions(args[i], - literal_args)) { + if (!cmInstallCommandArguments::CheckPermissions(args[i], literalArgs)) { status.SetError( cmStrCat(args[0], " given invalid permission \"", args[i], "\".")); return false; @@ -1910,7 +1909,7 @@ } cmInstallGenerator::MessageLevel message = - cmInstallGenerator::SelectMessageLevel(helper.Makefile, message_never); + cmInstallGenerator::SelectMessageLevel(helper.Makefile, messageNever); // Check for an absolute destination. if (cmGeneratorExpression::Find(*destination) == std::string::npos && @@ -1924,8 +1923,8 @@ // Create the directory install generator. helper.Makefile->AddInstallGenerator( cm::make_unique<cmInstallDirectoryGenerator>( - dirs, *destination, permissions_file, permissions_dir, configurations, - component, message, exclude_from_all, literal_args, optional, + dirs, *destination, permissionsFile, permissionsDir, configurations, + component, message, excludeFromAll, literalArgs, optional, helper.Makefile->GetBacktrace())); // Tell the global generator about any installation component names @@ -1945,12 +1944,12 @@ cmInstallCommandArguments ica(helper.DefaultComponentName, *helper.Makefile); std::string exp; - std::string name_space; + std::string exportNamespace; bool exportOld = false; std::string filename; ica.Bind("EXPORT_ANDROID_MK"_s, exp); - ica.Bind("NAMESPACE"_s, name_space); + ica.Bind("NAMESPACE"_s, exportNamespace); ica.Bind("EXPORT_LINK_INTERFACE_LIBRARIES"_s, exportOld); ica.Bind("FILE"_s, filename); @@ -2022,7 +2021,7 @@ cm::make_unique<cmInstallAndroidMKExportGenerator>( &exportSet, ica.GetDestination(), ica.GetPermissions(), ica.GetConfigurations(), ica.GetComponent(), message, - ica.GetExcludeFromAll(), std::move(fname), std::move(name_space), + ica.GetExcludeFromAll(), std::move(fname), std::move(exportNamespace), helper.Makefile->GetBacktrace())); return true; @@ -2188,17 +2187,17 @@ cmInstallCommandArguments ica(helper.DefaultComponentName, *helper.Makefile); std::string exp; - std::string name_space; + std::string exportNamespace; bool exportOld = false; std::string filename; - std::string cxx_modules_directory; + std::string cxxModulesDirectory; bool exportPackageDependencies = false; ica.Bind("EXPORT"_s, exp); - ica.Bind("NAMESPACE"_s, name_space); + ica.Bind("NAMESPACE"_s, exportNamespace); ica.Bind("EXPORT_LINK_INTERFACE_LIBRARIES"_s, exportOld); ica.Bind("FILE"_s, filename); - ica.Bind("CXX_MODULES_DIRECTORY"_s, cxx_modules_directory); + ica.Bind("CXX_MODULES_DIRECTORY"_s, cxxModulesDirectory); if (cmExperimental::HasSupportEnabled( status.GetMakefile(), @@ -2288,8 +2287,7 @@ cm::optional<cm::string_view> const directive = MatchExport(pie, exp); if (directive) { if (!HandleMappedPackageInfo(exportSet, *directive, helper, ica, - status, message, - cxx_modules_directory)) { + status, message, cxxModulesDirectory)) { return false; } } @@ -2303,8 +2301,8 @@ cm::make_unique<cmInstallCMakeConfigExportGenerator>( &exportSet, ica.GetDestination(), ica.GetPermissions(), ica.GetConfigurations(), ica.GetComponent(), message, - ica.GetExcludeFromAll(), std::move(fname), std::move(name_space), - std::move(cxx_modules_directory), exportOld, exportPackageDependencies, + ica.GetExcludeFromAll(), std::move(fname), std::move(exportNamespace), + std::move(cxxModulesDirectory), exportOld, exportPackageDependencies, helper.Makefile->GetBacktrace())); return true;
diff --git a/Source/cmInstallCxxModuleBmiGenerator.cxx b/Source/cmInstallCxxModuleBmiGenerator.cxx index 66f39a4..99e32cb 100644 --- a/Source/cmInstallCxxModuleBmiGenerator.cxx +++ b/Source/cmInstallCxxModuleBmiGenerator.cxx
@@ -14,14 +14,14 @@ #include "cmStringAlgorithms.h" cmInstallCxxModuleBmiGenerator::cmInstallCxxModuleBmiGenerator( - std::string target, std::string const& dest, std::string file_permissions, + std::string target, std::string const& dest, std::string filePermissions, std::vector<std::string> const& configurations, std::string const& component, - MessageLevel message, bool exclude_from_all, bool optional, + MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , TargetName(std::move(target)) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , Optional(optional) { this->ActionsPerConfig = true; @@ -46,12 +46,12 @@ std::string cmInstallCxxModuleBmiGenerator::GetScriptLocation( std::string const& config) const { - char const* config_name = config.c_str(); + char const* configName = config.c_str(); if (config.empty()) { - config_name = "noconfig"; + configName = "noconfig"; } return cmStrCat(this->Target->GetCMFSupportDirectory(), - "/install-cxx-module-bmi-", config_name, ".cmake"); + "/install-cxx-module-bmi-", configName, ".cmake"); } std::string cmInstallCxxModuleBmiGenerator::GetDestination(
diff --git a/Source/cmInstallCxxModuleBmiGenerator.h b/Source/cmInstallCxxModuleBmiGenerator.h index b3b5d37..28ed2b5 100644 --- a/Source/cmInstallCxxModuleBmiGenerator.h +++ b/Source/cmInstallCxxModuleBmiGenerator.h
@@ -21,9 +21,9 @@ { public: cmInstallCxxModuleBmiGenerator( - std::string target, std::string const& dest, std::string file_permissions, + std::string target, std::string const& dest, std::string filePermissions, std::vector<std::string> const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace); ~cmInstallCxxModuleBmiGenerator() override;
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index bd62dd3..96d32ba 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -16,16 +16,16 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( std::vector<std::string> const& dirs, std::string const& dest, - std::string file_permissions, std::string dir_permissions, + std::string filePermissions, std::string dirPermissions, std::vector<std::string> const& configurations, std::string const& component, - MessageLevel message, bool exclude_from_all, std::string literal_args, + MessageLevel message, bool excludeFromAll, std::string literalArgs, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , Directories(dirs) - , FilePermissions(std::move(file_permissions)) - , DirPermissions(std::move(dir_permissions)) - , LiteralArguments(std::move(literal_args)) + , FilePermissions(std::move(filePermissions)) + , DirPermissions(std::move(dirPermissions)) + , LiteralArguments(std::move(literalArgs)) , Optional(optional) { // We need per-config actions if destination have generator expressions. @@ -107,11 +107,11 @@ std::vector<std::string> const& dirs) { // Write code to install the directories. - char const* no_rename = nullptr; + char const* noRename = nullptr; this->AddInstallRule(os, this->GetDestination(config), cmInstallType_DIRECTORY, dirs, this->Optional, this->FilePermissions.c_str(), - this->DirPermissions.c_str(), no_rename, + this->DirPermissions.c_str(), noRename, this->LiteralArguments.c_str(), indent); }
diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h index b02824a..d228f9b 100644 --- a/Source/cmInstallDirectoryGenerator.h +++ b/Source/cmInstallDirectoryGenerator.h
@@ -21,10 +21,10 @@ public: cmInstallDirectoryGenerator( std::vector<std::string> const& dirs, std::string const& dest, - std::string file_permissions, std::string dir_permissions, + std::string filePermissions, std::string dirPermissions, std::vector<std::string> const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, - std::string literal_args, bool optional, cmListFileBacktrace backtrace); + std::string const& component, MessageLevel message, bool excludeFromAll, + std::string literalArgs, bool optional, cmListFileBacktrace backtrace); ~cmInstallDirectoryGenerator() override; bool Compute(cmLocalGenerator* lg) override;
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 8886439..7f2474d 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx
@@ -122,8 +122,8 @@ std::vector<std::string> files; for (auto const& i : this->EFGen->GetConfigImportFiles()) { files.push_back(i.second); - std::string config_test = this->CreateConfigTest(i.first); - os << indent << "if(" << config_test << ")\n"; + std::string configTest = this->CreateConfigTest(i.first); + os << indent << "if(" << configTest << ")\n"; this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, false, this->FilePermissions.c_str(), nullptr, nullptr, nullptr, indent.Next()); @@ -182,8 +182,8 @@ } for (auto const& i : this->EFGen->GetConfigCxxModuleFiles()) { files.push_back(i.second); - std::string config_test = this->CreateConfigTest(i.first); - os << indent << "if(" << config_test << ")\n"; + std::string configTest = this->CreateConfigTest(i.first); + os << indent << "if(" << configTest << ")\n"; this->AddInstallRule(os, cxxModuleDestination, cmInstallType_FILES, files, false, this->FilePermissions.c_str(), nullptr, nullptr, nullptr, indent.Next()); @@ -191,8 +191,8 @@ files.clear(); } for (auto const& i : this->EFGen->GetConfigCxxModuleTargetFiles()) { - std::string config_test = this->CreateConfigTest(i.first); - os << indent << "if(" << config_test << ")\n"; + std::string configTest = this->CreateConfigTest(i.first); + os << indent << "if(" << configTest << ")\n"; this->AddInstallRule(os, cxxModuleDestination, cmInstallType_FILES, i.second, false, this->FilePermissions.c_str(), nullptr, nullptr, nullptr, indent.Next());
diff --git a/Source/cmInstallFileSetGenerator.cxx b/Source/cmInstallFileSetGenerator.cxx index e6e9f03..60bacc9 100644 --- a/Source/cmInstallFileSetGenerator.cxx +++ b/Source/cmInstallFileSetGenerator.cxx
@@ -29,14 +29,14 @@ cmInstallFileSetGenerator::cmInstallFileSetGenerator( std::string targetName, std::string fileSetName, std::string destination, - std::string file_permissions, std::vector<std::string> const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string filePermissions, std::vector<std::string> const& configurations, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(std::move(destination), configurations, component, - message, exclude_from_all, false, std::move(backtrace)) + message, excludeFromAll, false, std::move(backtrace)) , TargetName(std::move(targetName)) , FileSetName(std::move(fileSetName)) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , Optional(optional) { this->ActionsPerConfig = true;
diff --git a/Source/cmInstallFileSetGenerator.h b/Source/cmInstallFileSetGenerator.h index b0488fb..8586692 100644 --- a/Source/cmInstallFileSetGenerator.h +++ b/Source/cmInstallFileSetGenerator.h
@@ -20,10 +20,10 @@ public: cmInstallFileSetGenerator(std::string targetName, std::string fileSetName, std::string destination, - std::string file_permissions, + std::string filePermissions, std::vector<std::string> const& configurations, std::string const& component, MessageLevel message, - bool exclude_from_all, bool optional, + bool excludeFromAll, bool optional, cmListFileBacktrace backtrace); ~cmInstallFileSetGenerator() override;
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index f5613fa..bc9517a 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx
@@ -11,14 +11,14 @@ cmInstallFilesGenerator::cmInstallFilesGenerator( std::vector<std::string> const& files, std::string const& dest, - bool programs, std::string file_permissions, + bool programs, std::string filePermissions, std::vector<std::string> const& configurations, std::string const& component, - MessageLevel message, bool exclude_from_all, std::string rename, - bool optional, cmListFileBacktrace backtrace) + MessageLevel message, bool excludeFromAll, std::string rename, bool optional, + cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , Files(files) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , Rename(std::move(rename)) , Programs(programs) , Optional(optional) @@ -86,11 +86,11 @@ std::vector<std::string> const& files) { // Write code to install the files. - char const* no_dir_permissions = nullptr; + char const* noDirPermissions = nullptr; this->AddInstallRule( os, this->GetDestination(config), (this->Programs ? cmInstallType_PROGRAMS : cmInstallType_FILES), files, - this->Optional, this->FilePermissions.c_str(), no_dir_permissions, + this->Optional, this->FilePermissions.c_str(), noDirPermissions, this->GetRename(config).c_str(), nullptr, indent); }
diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index 5ab2f50..c8f4842 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h
@@ -21,10 +21,10 @@ public: cmInstallFilesGenerator(std::vector<std::string> const& files, std::string const& dest, bool programs, - std::string file_permissions, + std::string filePermissions, std::vector<std::string> const& configurations, std::string const& component, MessageLevel message, - bool exclude_from_all, std::string rename, + bool excludeFromAll, std::string rename, bool optional, cmListFileBacktrace backtrace); ~cmInstallFilesGenerator() override;
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index 9317f94..585bf80 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx
@@ -16,14 +16,14 @@ cmInstallGenerator::cmInstallGenerator( std::string destination, std::vector<std::string> const& configurations, - std::string component, MessageLevel message, bool exclude_from_all, - bool all_components, cmListFileBacktrace backtrace) + std::string component, MessageLevel message, bool excludeFromAll, + bool allComponents, cmListFileBacktrace backtrace) : cmScriptGenerator("CMAKE_INSTALL_CONFIG_NAME", configurations) , Destination(std::move(destination)) , Component(std::move(component)) , Message(message) - , ExcludeFromAll(exclude_from_all) - , AllComponents(all_components) + , ExcludeFromAll(excludeFromAll) + , AllComponents(allComponents) , Backtrace(std::move(backtrace)) { } @@ -46,10 +46,10 @@ void cmInstallGenerator::AddInstallRule( std::ostream& os, std::string const& dest, cmInstallType type, std::vector<std::string> const& files, bool optional /* = false */, - char const* permissions_file /* = nullptr */, - char const* permissions_dir /* = nullptr */, - char const* rename /* = nullptr */, char const* literal_args /* = nullptr */, - Indent indent, char const* files_var /* = nullptr */) + char const* permissionsFile /* = nullptr */, + char const* permissionsDir /* = nullptr */, + char const* rename /* = nullptr */, char const* literalArgs /* = nullptr */, + Indent indent, char const* filesVar /* = nullptr */) { // Use the FILE command to install the file. std::string stype; @@ -95,9 +95,8 @@ } os << "\")\n"; } - if (files_var) { - os << indent << "foreach(_cmake_abs_file IN LISTS " << files_var - << ")\n"; + if (filesVar) { + os << indent << "foreach(_cmake_abs_file IN LISTS " << filesVar << ")\n"; os << indent.Next() << "get_filename_component(_cmake_abs_file_name " "\"${_cmake_abs_file}\" NAME)\n"; @@ -139,11 +138,11 @@ os << " MESSAGE_NEVER"; break; } - if (permissions_file && *permissions_file) { - os << " PERMISSIONS" << permissions_file; + if (permissionsFile && *permissionsFile) { + os << " PERMISSIONS" << permissionsFile; } - if (permissions_dir && *permissions_dir) { - os << " DIR_PERMISSIONS" << permissions_dir; + if (permissionsDir && *permissionsDir) { + os << " DIR_PERMISSIONS" << permissionsDir; } if (rename && *rename) { os << " RENAME \"" << rename << "\""; @@ -155,25 +154,25 @@ for (std::string const& f : files) { os << "\n" << indent << " \"" << f << "\""; } - if (files_var) { - os << " ${" << files_var << "}"; + if (filesVar) { + os << " ${" << filesVar << "}"; } os << "\n" << indent << " "; - if (!(literal_args && *literal_args)) { + if (!(literalArgs && *literalArgs)) { os << " "; } } - if (literal_args && *literal_args) { - os << literal_args; + if (literalArgs && *literalArgs) { + os << literalArgs; } os << ")\n"; } std::string cmInstallGenerator::CreateComponentTest( - std::string const& component, bool exclude_from_all, bool all_components) + std::string const& component, bool excludeFromAll, bool allComponents) { - if (all_components) { - if (exclude_from_all) { + if (allComponents) { + if (excludeFromAll) { return "CMAKE_INSTALL_COMPONENT"; } return {}; @@ -182,7 +181,7 @@ std::string result = "CMAKE_INSTALL_COMPONENT STREQUAL \""; result += component; result += "\""; - if (!exclude_from_all) { + if (!excludeFromAll) { result += " OR NOT CMAKE_INSTALL_COMPONENT"; } @@ -194,12 +193,12 @@ // Track indentation. Indent indent; - std::string component_test = this->CreateComponentTest( + std::string componentTest = this->CreateComponentTest( this->Component, this->ExcludeFromAll, this->AllComponents); // Begin this block of installation. - if (!component_test.empty()) { - os << indent << "if(" << component_test << ")\n"; + if (!componentTest.empty()) { + os << indent << "if(" << componentTest << ")\n"; } // Generate the script possibly with per-configuration code. @@ -207,7 +206,7 @@ this->AllComponents ? indent : indent.Next()); // End this block of installation. - if (!component_test.empty()) { + if (!componentTest.empty()) { os << indent << "endif()\n\n"; } }
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index d35a4b6..9a4b68b 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h
@@ -34,7 +34,7 @@ cmInstallGenerator(std::string destination, std::vector<std::string> const& configurations, std::string component, MessageLevel message, - bool exclude_from_all, bool all_components, + bool excludeFromAll, bool allComponents, cmListFileBacktrace backtrace); ~cmInstallGenerator() override; @@ -48,10 +48,10 @@ void AddInstallRule( std::ostream& os, std::string const& dest, cmInstallType type, std::vector<std::string> const& files, bool optional = false, - char const* permissions_file = nullptr, - char const* permissions_dir = nullptr, char const* rename = nullptr, - char const* literal_args = nullptr, Indent indent = Indent(), - char const* files_var = nullptr); + char const* permissionsFile = nullptr, + char const* permissionsDir = nullptr, char const* rename = nullptr, + char const* literalArgs = nullptr, Indent indent = Indent(), + char const* filesVar = nullptr); /** Get the install destination as it should appear in the installation script. */ @@ -81,8 +81,8 @@ void GenerateScript(std::ostream& os) override; std::string CreateComponentTest(std::string const& component, - bool exclude_from_all, - bool all_components = false); + bool excludeFromAll, + bool allComponents = false); using TweakMethod = std::function<void(std::ostream& os, Indent indent,
diff --git a/Source/cmInstallGetRuntimeDependenciesGenerator.cxx b/Source/cmInstallGetRuntimeDependenciesGenerator.cxx index 4292f8f..6e27498 100644 --- a/Source/cmInstallGetRuntimeDependenciesGenerator.cxx +++ b/Source/cmInstallGetRuntimeDependenciesGenerator.cxx
@@ -84,10 +84,10 @@ std::vector<std::string> postExcludeFiles, std::string libraryComponent, std::string frameworkComponent, bool noInstallRPath, char const* depsVar, char const* rpathPrefix, std::vector<std::string> const& configurations, - MessageLevel message, bool exclude_from_all, cmListFileBacktrace backtrace, + MessageLevel message, bool excludeFromAll, cmListFileBacktrace backtrace, cmPolicies::PolicyStatus policyStatusCMP0207) - : cmInstallGenerator("", configurations, "", message, exclude_from_all, - false, std::move(backtrace)) + : cmInstallGenerator("", configurations, "", message, excludeFromAll, false, + std::move(backtrace)) , RuntimeDependencySet(runtimeDependencySet) , Directories(std::move(directories)) , PreIncludeRegexes(std::move(preIncludeRegexes))
diff --git a/Source/cmInstallGetRuntimeDependenciesGenerator.h b/Source/cmInstallGetRuntimeDependenciesGenerator.h index 9670dcf..413d2b8 100644 --- a/Source/cmInstallGetRuntimeDependenciesGenerator.h +++ b/Source/cmInstallGetRuntimeDependenciesGenerator.h
@@ -27,7 +27,7 @@ std::vector<std::string> postExcludeFiles, std::string libraryComponent, std::string frameworkComponent, bool noInstallRPath, char const* depsVar, char const* rpathPrefix, std::vector<std::string> const& configurations, - MessageLevel message, bool exclude_from_all, cmListFileBacktrace backtrace, + MessageLevel message, bool excludeFromAll, cmListFileBacktrace backtrace, cmPolicies::PolicyStatus policyStatusCMP0207); bool Compute(cmLocalGenerator* lg) override;
diff --git a/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx b/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx index 9552748..a2ae0ff 100644 --- a/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx +++ b/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx
@@ -32,14 +32,14 @@ cmInstallImportedRuntimeArtifactsGenerator:: cmInstallImportedRuntimeArtifactsGenerator( std::string targetName, std::string const& dest, - std::string file_permissions, + std::string filePermissions, std::vector<std::string> const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , TargetName(std::move(targetName)) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , Optional(optional) { this->ActionsPerConfig = true;
diff --git a/Source/cmInstallImportedRuntimeArtifactsGenerator.h b/Source/cmInstallImportedRuntimeArtifactsGenerator.h index 90c13a8..411d472 100644 --- a/Source/cmInstallImportedRuntimeArtifactsGenerator.h +++ b/Source/cmInstallImportedRuntimeArtifactsGenerator.h
@@ -16,9 +16,9 @@ public: cmInstallImportedRuntimeArtifactsGenerator( std::string targetName, std::string const& dest, - std::string file_permissions, + std::string filePermissions, std::vector<std::string> const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace = cmListFileBacktrace()); ~cmInstallImportedRuntimeArtifactsGenerator() override = default;
diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 63f40e2..0a808b7 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx
@@ -48,18 +48,18 @@ static void FinalAction(cmMakefile& makefile, std::string const& dest, std::vector<std::string> const& args) { - bool files_mode = false; + bool filesMode = false; if (!args.empty() && args[0] == "FILES") { - files_mode = true; + filesMode = true; } std::vector<std::string> files; // two different options - if (args.size() > 1 || files_mode) { + if (args.size() > 1 || filesMode) { // for each argument, get the programs auto s = args.begin(); - if (files_mode) { + if (filesMode) { // Skip the FILES argument in files mode. ++s; }
diff --git a/Source/cmInstallRuntimeDependencySetGenerator.cxx b/Source/cmInstallRuntimeDependencySetGenerator.cxx index ec46045..53c3429 100644 --- a/Source/cmInstallRuntimeDependencySetGenerator.cxx +++ b/Source/cmInstallRuntimeDependencySetGenerator.cxx
@@ -24,10 +24,10 @@ std::string installNameDir, bool noInstallName, char const* depsVar, char const* rpathPrefix, char const* tmpVarPrefix, std::string destination, std::vector<std::string> const& configurations, std::string component, - std::string permissions, MessageLevel message, bool exclude_from_all, + std::string permissions, MessageLevel message, bool excludeFromAll, cmListFileBacktrace backtrace) : cmInstallGenerator(std::move(destination), configurations, - std::move(component), message, exclude_from_all, false, + std::move(component), message, excludeFromAll, false, std::move(backtrace)) , Type(type) , DependencySet(dependencySet)
diff --git a/Source/cmInstallRuntimeDependencySetGenerator.h b/Source/cmInstallRuntimeDependencySetGenerator.h index f8a7a4f..80f4cc3 100644 --- a/Source/cmInstallRuntimeDependencySetGenerator.h +++ b/Source/cmInstallRuntimeDependencySetGenerator.h
@@ -27,7 +27,7 @@ std::string installNameDir, bool noInstallName, char const* depsVar, char const* rpathPrefix, char const* tmpVarPrefix, std::string destination, std::vector<std::string> const& configurations, std::string component, - std::string permissions, MessageLevel message, bool exclude_from_all, + std::string permissions, MessageLevel message, bool excludeFromAll, cmListFileBacktrace backtrace); bool Compute(cmLocalGenerator* lg) override;
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index a75e924..0070b60 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx
@@ -14,9 +14,9 @@ cmInstallScriptGenerator::cmInstallScriptGenerator( std::string script, bool code, std::string const& component, - bool exclude_from_all, bool all_components, cmListFileBacktrace backtrace) + bool excludeFromAll, bool allComponents, cmListFileBacktrace backtrace) : cmInstallGenerator("", std::vector<std::string>(), component, - MessageDefault, exclude_from_all, all_components, + MessageDefault, excludeFromAll, allComponents, std::move(backtrace)) , Script(std::move(script)) , Code(code)
diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h index 104d432..fe7ca8f 100644 --- a/Source/cmInstallScriptGenerator.h +++ b/Source/cmInstallScriptGenerator.h
@@ -20,7 +20,7 @@ public: cmInstallScriptGenerator( std::string script, bool code, std::string const& component, - bool exclude_from_all, bool all_components, + bool excludeFromAll, bool allComponents, cmListFileBacktrace backtrace = cmListFileBacktrace()); ~cmInstallScriptGenerator() override;
diff --git a/Source/cmInstallScriptHandler.cxx b/Source/cmInstallScriptHandler.cxx index 6a268f9..99a0694 100644 --- a/Source/cmInstallScriptHandler.cxx +++ b/Source/cmInstallScriptHandler.cxx
@@ -34,86 +34,86 @@ using InstallScriptRunner = cmInstallScriptHandler::InstallScriptRunner; cmInstallScriptHandler::cmInstallScriptHandler( - std::string _binaryDir, std::vector<std::string> _components, - std::string _config, std::vector<std::string>& args) - : components(std::move(_components)) - , binaryDir(std::move(_binaryDir)) + std::string binaryDir, std::vector<std::string> components, + std::string installConfig, std::vector<std::string>& args) + : Components(std::move(components)) + , BinaryDir(std::move(binaryDir)) { - if (this->components.empty()) { - this->components.emplace_back(std::string{}); + if (this->Components.empty()) { + this->Components.emplace_back(std::string{}); } std::string const& file = - cmStrCat(this->binaryDir, "/CMakeFiles/InstallScripts.json"); - this->parallel = false; + cmStrCat(this->BinaryDir, "/CMakeFiles/InstallScripts.json"); + this->Parallel = false; auto addScript = [this, &args](std::string script, std::string component, std::string config) -> void { - this->scripts.push_back({ script, config, args }); + this->Scripts.push_back({ script, config, args }); if (!component.empty()) { - this->scripts.back().command.insert( - this->scripts.back().command.end() - 1, + this->Scripts.back().command.insert( + this->Scripts.back().command.end() - 1, cmStrCat("-DCMAKE_INSTALL_COMPONENT=", component)); } if (!config.empty()) { - this->scripts.back().command.insert( - this->scripts.back().command.end() - 1, + this->Scripts.back().command.insert( + this->Scripts.back().command.end() - 1, cmStrCat("-DCMAKE_INSTALL_CONFIG_NAME=", config)); } - this->scripts.back().command.emplace_back(script); - this->directories.push_back(cmSystemTools::GetFilenamePath(script)); + this->Scripts.back().command.emplace_back(script); + this->Directories.push_back(cmSystemTools::GetFilenamePath(script)); }; int compare = 1; if (cmSystemTools::FileExists(file)) { cmSystemTools::FileTimeCompare( - cmStrCat(this->binaryDir, "/CMakeFiles/cmake.check_cache"), file, + cmStrCat(this->BinaryDir, "/CMakeFiles/cmake.check_cache"), file, &compare); } if (compare < 1) { Json::CharReaderBuilder rbuilder; - auto JsonReader = + auto jsonReader = std::unique_ptr<Json::CharReader>(rbuilder.newCharReader()); std::vector<char> content; Json::Value value; cmJSONState state(file, &value); - this->parallel = value["Parallel"].asBool(); - if (this->parallel) { + this->Parallel = value["Parallel"].asBool(); + if (this->Parallel) { args.insert(args.end() - 1, "-DCMAKE_INSTALL_LOCAL_ONLY=1"); } - if (_config.empty() && value.isMember("Configs")) { + if (installConfig.empty() && value.isMember("Configs")) { for (auto const& config : value["Configs"]) { - this->configs.push_back(config.asCString()); + this->Configs.push_back(config.asCString()); } } else { - this->configs.push_back(_config); + this->Configs.push_back(installConfig); } for (auto const& script : value["InstallScripts"]) { - for (auto const& component : components) { - for (auto const& config : configs) { + for (auto const& component : Components) { + for (auto const& config : Configs) { addScript(script.asCString(), component, config); } } - if (!this->parallel) { + if (!this->Parallel) { break; } } } else { - for (auto const& component : components) { - addScript(cmStrCat(this->binaryDir, "/cmake_install.cmake"), component, - _config); + for (auto const& component : Components) { + addScript(cmStrCat(this->BinaryDir, "/cmake_install.cmake"), component, + installConfig); } } } bool cmInstallScriptHandler::IsParallel() { - return this->parallel; + return this->Parallel; } std::vector<InstallScript> cmInstallScriptHandler::GetScripts() const { - return this->scripts; + return this->Scripts; } int cmInstallScriptHandler::Install(unsigned int j, @@ -122,27 +122,27 @@ cm::uv_loop_ptr loop; loop.init(); std::vector<InstallScriptRunner> runners; - runners.reserve(this->scripts.size()); + runners.reserve(this->Scripts.size()); - std::vector<std::string> instrument_arg; + std::vector<std::string> instrumentArg; if (instrumentation.HasQuery()) { - instrument_arg = { cmSystemTools::GetCTestCommand(), - "--instrument", - "--command-type", - "install", - "--build-dir", - this->binaryDir, - "--config", - "", - "--" }; + instrumentArg = { cmSystemTools::GetCTestCommand(), + "--instrument", + "--command-type", + "install", + "--build-dir", + this->BinaryDir, + "--config", + "", + "--" }; } - for (auto& script : this->scripts) { - if (!instrument_arg.empty()) { - instrument_arg[7] = script.config; // --config <script.config> + for (auto& script : this->Scripts) { + if (!instrumentArg.empty()) { + instrumentArg[7] = script.config; // --config <script.config> } - script.command.insert(script.command.begin(), instrument_arg.begin(), - instrument_arg.end()); + script.command.insert(script.command.begin(), instrumentArg.begin(), + instrumentArg.end()); runners.emplace_back(script); } std::size_t working = 0; @@ -168,28 +168,28 @@ uv_run(loop, UV_RUN_DEFAULT); // Write install manifest - std::string install_manifest; - for (auto const& component : this->components) { + std::string installManifest; + for (auto const& component : this->Components) { if (component.empty()) { - install_manifest = "install_manifest.txt"; + installManifest = "install_manifest.txt"; } else { cmsys::RegularExpression regEntry; if (regEntry.compile("^[a-zA-Z0-9_.+-]+$") && regEntry.find(component)) { - install_manifest = cmStrCat("install_manifest_", component, ".txt"); + installManifest = cmStrCat("install_manifest_", component, ".txt"); } else { cmCryptoHash md5(cmCryptoHash::AlgoMD5); md5.Initialize(); - install_manifest = + installManifest = cmStrCat("install_manifest_", md5.HashString(component), ".txt"); } } cmGeneratedFileStream fout( - cmStrCat(this->binaryDir, '/', install_manifest)); + cmStrCat(this->BinaryDir, '/', installManifest)); fout.SetCopyIfDifferent(true); - for (auto const& dir : this->directories) { - auto local_manifest = cmStrCat(dir, "/install_local_manifest.txt"); - if (cmSystemTools::FileExists(local_manifest)) { - cmsys::ifstream fin(local_manifest.c_str()); + for (auto const& dir : this->Directories) { + auto localManifest = cmStrCat(dir, "/install_local_manifest.txt"); + if (cmSystemTools::FileExists(localManifest)) { + cmsys::ifstream fin(localManifest.c_str()); std::string line; while (std::getline(fin, line)) { fout << line << "\n"; @@ -202,34 +202,34 @@ InstallScriptRunner::InstallScriptRunner(InstallScript const& script) { - this->name = cmSystemTools::RelativePath( + this->Name = cmSystemTools::RelativePath( cmSystemTools::GetLogicalWorkingDirectory(), script.path); - this->command = script.command; + this->Command = script.command; } void InstallScriptRunner::start(cm::uv_loop_ptr& loop, std::function<void()> callback) { cmUVProcessChainBuilder builder; - builder.AddCommand(this->command) + builder.AddCommand(this->Command) .SetExternalLoop(*loop) .SetMergedBuiltinStreams(); - this->chain = cm::make_unique<cmUVProcessChain>(builder.Start()); - this->streamHandler = cmUVStreamRead( - this->chain->OutputStream(), + this->Chain = cm::make_unique<cmUVProcessChain>(builder.Start()); + this->StreamHandler = cmUVStreamRead( + this->Chain->OutputStream(), [this](std::vector<char> data) { std::string strdata; cmProcessOutput(cmProcessOutput::Auto) .DecodeText(data.data(), data.size(), strdata); - this->output.push_back(strdata); + this->Output.push_back(strdata); }, std::move(callback)); } void InstallScriptRunner::printResult(std::size_t n, std::size_t total) { - cmSystemTools::Stdout(cmStrCat('[', n, '/', total, "] ", this->name, '\n')); - for (auto const& line : this->output) { + cmSystemTools::Stdout(cmStrCat('[', n, '/', total, "] ", this->Name, '\n')); + for (auto const& line : this->Output) { cmSystemTools::Stdout(line); } }
diff --git a/Source/cmInstallScriptHandler.h b/Source/cmInstallScriptHandler.h index 3fcfac0..9ab8f8e 100644 --- a/Source/cmInstallScriptHandler.h +++ b/Source/cmInstallScriptHandler.h
@@ -40,18 +40,18 @@ void printResult(std::size_t n, std::size_t total); private: - std::vector<std::string> command; - std::vector<std::string> output; - std::string name; - std::unique_ptr<cmUVProcessChain> chain; - std::unique_ptr<cmUVStreamReadHandle> streamHandler; + std::vector<std::string> Command; + std::vector<std::string> Output; + std::string Name; + std::unique_ptr<cmUVProcessChain> Chain; + std::unique_ptr<cmUVStreamReadHandle> StreamHandler; }; private: - std::vector<InstallScript> scripts; - std::vector<std::string> configs; - std::vector<std::string> directories; - std::vector<std::string> components; - std::string binaryDir; - bool parallel; + std::vector<InstallScript> Scripts; + std::vector<std::string> Configs; + std::vector<std::string> Directories; + std::vector<std::string> Components; + std::string BinaryDir; + bool Parallel; };
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index e2e7924..e38b296 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx
@@ -128,13 +128,13 @@ cmInstallTargetGenerator::cmInstallTargetGenerator( std::string targetName, std::string const& dest, bool implib, - std::string file_permissions, std::vector<std::string> const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string filePermissions, std::vector<std::string> const& configurations, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , TargetName(std::move(targetName)) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , ImportLibrary(implib) , Optional(optional) { @@ -177,9 +177,9 @@ // Write code to install the target file. char const* no_dir_permissions = nullptr; bool optional = this->Optional || this->ImportLibrary; - std::string literal_args; + std::string literalArgs; if (files.UseSourcePermissions) { - literal_args += " USE_SOURCE_PERMISSIONS"; + literalArgs += " USE_SOURCE_PERMISSIONS"; } if (files.Rename) { if (files.From.size() != files.To.size()) { @@ -199,16 +199,16 @@ } this->AddInstallRule(os, dest, files.Type, FileNames, optional, this->FilePermissions.c_str(), no_dir_permissions, - files.To[i].c_str(), literal_args.c_str(), indent); + files.To[i].c_str(), literalArgs.c_str(), indent); } } else { char const* no_rename = nullptr; if (!files.FromDir.empty()) { - literal_args += " FILES_FROM_DIR \"" + files.FromDir + "\""; + literalArgs += " FILES_FROM_DIR \"" + files.FromDir + "\""; } this->AddInstallRule(os, dest, files.Type, files.From, optional, this->FilePermissions.c_str(), no_dir_permissions, - no_rename, literal_args.c_str(), indent); + no_rename, literalArgs.c_str(), indent); } // Add post-installation tweaks.
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index 7421d0d..dd1a596 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h
@@ -22,9 +22,9 @@ public: cmInstallTargetGenerator( std::string targetName, std::string const& dest, bool implib, - std::string file_permissions, + std::string filePermissions, std::vector<std::string> const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace = cmListFileBacktrace()); ~cmInstallTargetGenerator() override;
diff --git a/Source/cmInstallTargetsCommand.cxx b/Source/cmInstallTargetsCommand.cxx index 66d40b0..6b18410 100644 --- a/Source/cmInstallTargetsCommand.cxx +++ b/Source/cmInstallTargetsCommand.cxx
@@ -26,7 +26,7 @@ cmMakefile::cmTargetMap& tgts = mf.GetTargets(); auto s = args.begin(); ++s; - std::string runtime_dir = "/bin"; + std::string runtimeDir = "/bin"; for (; s != args.end(); ++s) { if (*s == "RUNTIME_DIRECTORY") { ++s; @@ -36,12 +36,12 @@ return false; } - runtime_dir = *s; + runtimeDir = *s; } else { auto ti = tgts.find(*s); if (ti != tgts.end()) { ti->second.SetInstallPath(args[0]); - ti->second.SetRuntimeInstallPath(runtime_dir); + ti->second.SetRuntimeInstallPath(runtimeDir); ti->second.SetHaveInstallRule(true); } else { std::string str = "Cannot find target: \"" + *s + "\" to install.";
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 09026ca..c046e11 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -755,9 +755,13 @@ // Construct object file lists that may be needed to expand the // rule. std::string buildObjs; + cmMakefileTargetGenerator::ResponseFlagFor responseMode = + this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY + ? cmMakefileTargetGenerator::ResponseFlagFor::Archive + : cmMakefileTargetGenerator::ResponseFlagFor::Link; this->CreateObjectLists(useLinkScript, useArchiveRules, useResponseFileForObjects, buildObjs, depends, - useWatcomQuote, linkLanguage); + useWatcomQuote, linkLanguage, responseMode); if (!this->DeviceLinkObject.empty()) { buildObjs += " " + this->LocalGenerator->ConvertToOutputFormat(
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 31300f4..59c0519 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx
@@ -2260,9 +2260,9 @@ // Create this response file. std::string const responseFileName = - (responseMode == Link) ? "linkLibs.rsp" : "deviceLinkLibs.rsp"; + (responseMode == DeviceLink) ? "deviceLinkLibs.rsp" : "linkLibs.rsp"; std::string const responseLang = - (responseMode == Link) ? linkLanguage : "CUDA"; + (responseMode == DeviceLink) ? "CUDA" : linkLanguage; std::string link_rsp = this->CreateResponseFile( responseFileName, linkLibs, makefile_depends, responseLang); @@ -2299,8 +2299,9 @@ char const* sep = ""; for (unsigned int i = 0; i < object_strings.size(); ++i) { // Number the response files. - std::string responseFileName = cmStrCat( - (responseMode == Link) ? "objects" : "deviceObjects", i + 1, ".rsp"); + std::string responseFileName = + cmStrCat((responseMode == DeviceLink) ? "deviceObjects" : "objects", + i + 1, ".rsp"); // Create this response file. std::string objects_rsp = this->CreateResponseFile( @@ -2423,10 +2424,17 @@ responseFlagVar = cmStrCat("CMAKE_", lang, "_RESPONSE_FILE_LINK_FLAG"); } else if (mode == cmMakefileTargetGenerator::ResponseFlagFor::DeviceLink) { responseFlagVar = "CMAKE_CUDA_RESPONSE_FILE_DEVICE_LINK_FLAG"; + } else if (mode == cmMakefileTargetGenerator::ResponseFlagFor::Archive) { + responseFlagVar = cmStrCat("CMAKE_", lang, "_RESPONSE_FILE_ARCHIVE_FLAG"); } if (cmValue const p = this->Makefile->GetDefinition(responseFlagVar)) { responseFlag = *p; + } else if (mode == cmMakefileTargetGenerator::ResponseFlagFor::Archive) { + responseFlagVar = cmStrCat("CMAKE_", lang, "_RESPONSE_FILE_LINK_FLAG"); + if (cmValue const q = this->Makefile->GetDefinition(responseFlagVar)) { + responseFlag = *q; + } } return responseFlag; }
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index fe255f4..bcb5f26 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h
@@ -174,8 +174,9 @@ enum ResponseFlagFor { + Archive, Link, - DeviceLink + DeviceLink, }; /** Create list of flags for link libraries. */
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 556d713..7ff9bb2 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -498,8 +498,15 @@ } // build response file name - std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; - cmValue flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + cmValue flag; + if (targetType == cmStateEnums::STATIC_LIBRARY) { + std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_ARCHIVE_FLAG"; + flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + } + if (!flag) { + std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; + flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + } if (flag) { responseFlag = *flag; @@ -1590,9 +1597,15 @@ cmStrCat("CMAKE_", this->TargetLinkLanguage(config)); // build response file name - std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; - - cmValue flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + cmValue flag; + if (targetType == cmStateEnums::STATIC_LIBRARY) { + std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_ARCHIVE_FLAG"; + flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + } + if (!flag) { + std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; + flag = this->GetMakefile()->GetDefinition(cmakeLinkVar); + } bool const lang_supports_response = !(this->TargetLinkLanguage(config) == "RC" ||
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt index 2b4587f..d90b345 100644 --- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt +++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
@@ -1 +1 @@ -^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":10}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":1}]},{"kind":"toolchains","version":\[{"major":1,"minor":1}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$ +^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":11}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":1}]},{"kind":"toolchains","version":\[{"major":1,"minor":1}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index 34d0e86..b3958e7 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -13,7 +13,7 @@ assert is_list(o) assert len(o) == 1 major = 2 - minor = 10 + minor = 11 check_index_object(o[0], "codemodel", major, minor, check_object_codemodel(g, major, minor)) def check_backtrace(t, b, backtrace): @@ -1077,6 +1077,8 @@ read_codemodel_json_data("targets/c_headers_1.json"), read_codemodel_json_data("targets/c_headers_2.json"), + read_codemodel_json_data("targets/c_sources_1.json"), + read_codemodel_json_data("targets/c_sources_2.json"), ] if sys.platform == "darwin":
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json index ea7a079..1e84bb9 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json
@@ -5,7 +5,9 @@ "childSources": null, "targetIds": [ "^c_headers_1::@6b8db101d64c125f29fe$", - "^c_headers_2::@6b8db101d64c125f29fe$" + "^c_headers_2::@6b8db101d64c125f29fe$", + "^c_sources_1::@6b8db101d64c125f29fe$", + "^c_sources_2::@6b8db101d64c125f29fe$" ], "abstractTargetIds": null, "projectName": "codemodel-v2",
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json index ad73de9..658d77b 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
@@ -32,7 +32,9 @@ "^c_static_exe::@6890427a1f51a3e7e1df$", "^c_subdir::@6890427a1f51a3e7e1df$", "^c_headers_1::@6b8db101d64c125f29fe$", - "^c_headers_2::@6b8db101d64c125f29fe$" + "^c_headers_2::@6b8db101d64c125f29fe$", + "^c_sources_1::@6b8db101d64c125f29fe$", + "^c_sources_2::@6b8db101d64c125f29fe$" ], "abstractTargetIds": [ "^interface_lib::@6890427a1f51a3e7e1df$"
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json index 1cad522..8df8133 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
@@ -230,6 +230,14 @@ "backtrace": null }, { + "id": "^c_sources_1::@6b8db101d64c125f29fe$", + "backtrace": null + }, + { + "id": "^c_sources_2::@6b8db101d64c125f29fe$", + "backtrace": null + }, + { "id": "^static_framework::@217a96c3a62328a73ef4$", "backtrace": null }, @@ -421,6 +429,14 @@ "backtrace": null }, { + "id": "^c_sources_1::@6b8db101d64c125f29fe$", + "backtrace": null + }, + { + "id": "^c_sources_2::@6b8db101d64c125f29fe$", + "backtrace": null + }, + { "id": "^static_framework::@217a96c3a62328a73ef4$", "backtrace": null },
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_sources_1.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_sources_1.json new file mode 100644 index 0000000..64adf2e --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_sources_1.json
@@ -0,0 +1,188 @@ +{ + "name": "c_sources_1", + "id": "^c_sources_1::@6b8db101d64c125f29fe$", + "directorySource": "^fileset$", + "projectName": "codemodel-v2", + "type": "STATIC_LIBRARY", + "imported": null, + "local": null, + "abstract": null, + "symbolic": null, + "isGeneratorProvided": null, + "fileSets": [ + { + "name": "SOURCES", + "type": "SOURCES", + "visibility": "PRIVATE", + "baseDirectories": [ + "^fileset$" + ] + }, + { + "name": "public_srcs", + "type": "SOURCES", + "visibility": "PUBLIC", + "baseDirectories": [ + "^fileset$" + ] + } + ], + "sources": [ + { + "path": "^fileset/empty\\.c$", + "isGenerated": null, + "fileSetName": "public_srcs", + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 40, + "command": "target_sources", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^fileset/other\\.c$", + "isGenerated": null, + "fileSetName": "SOURCES", + "sourceGroupName": "Source Files", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 35, + "command": "target_sources", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "interfaceSources": [ + { + "path": "^fileset/empty\\.c$", + "isGenerated": null, + "fileSetName": "SOURCES", + "sourceGroupName": "Source Files" + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^fileset/empty\\.c$", + "^fileset/other\\.c$" + ], + "interfaceSourcePaths": [ + "^fileset/empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^fileset/empty\\.c$" + ], + "includes": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/fileset/dir$", + "isSystem": null, + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 46, + "command": "set_property", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "frameworks": null, + "defines": [ + { + "define": "DEF2", + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 43, + "command": "set_property", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "define": "_MBCS", + "backtrace": null + } + ], + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 33, + "command": "add_library", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib)?c_sources_1\\.(a|lib|l)$", + "artifacts": [ + { + "path": "^fileset/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_sources_1\\.(a|lib|l)$", + "_dllExtra": false + } + ], + "build": "^fileset$", + "source": "^fileset$", + "install": null, + "link": null, + "archive": { + "lto": null + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + } + ], + "linkLibraries": null, + "interfaceLinkLibraries": null, + "compileDependencies": null, + "interfaceCompileDependencies": null, + "objectDependencies": null, + "orderDependencies": null +}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_sources_2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_sources_2.json new file mode 100644 index 0000000..65c7c77 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_sources_2.json
@@ -0,0 +1,218 @@ +{ + "name": "c_sources_2", + "id": "^c_sources_2::@6b8db101d64c125f29fe$", + "directorySource": "^fileset$", + "projectName": "codemodel-v2", + "type": "STATIC_LIBRARY", + "imported": null, + "local": null, + "abstract": null, + "symbolic": null, + "isGeneratorProvided": null, + "fileSets": null, + "sources": [ + { + "path": "^fileset/empty\\.c$", + "isGenerated": null, + "fileSetName": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 50, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "interfaceSources": null, + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^fileset/empty\\.c$" + ], + "interfaceSourcePaths": null + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^fileset/empty\\.c$" + ], + "includes": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/fileset/dir$", + "isSystem": null, + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 47, + "command": "set_property", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "frameworks": null, + "defines": [ + { + "define": "DEF3", + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 44, + "command": "set_property", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "define": "_MBCS", + "backtrace": null + } + ], + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 49, + "command": "add_library", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib)?c_sources_2\\.(a|lib|l)$", + "artifacts": [ + { + "path": "^fileset/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_sources_2\\.(a|lib|l)$", + "_dllExtra": false + } + ], + "build": "^fileset$", + "source": "^fileset$", + "install": null, + "link": null, + "archive": { + "lto": null + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^c_sources_1::@6b8db101d64c125f29fe$", + "fragment": null, + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 50, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "fromDependency": null + } + ], + "linkLibraries": [ + { + "id": "^c_sources_1::@6b8db101d64c125f29fe$", + "fragment": null, + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 50, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "fromDependency": null + } + ], + "interfaceLinkLibraries": [ + { + "id": "^c_sources_1::@6b8db101d64c125f29fe$", + "fragment": null, + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 50, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "compileDependencies": [ + { + "id": "^c_sources_1::@6b8db101d64c125f29fe$", + "fragment": null, + "backtrace": [ + { + "file": "^fileset/CMakeLists\\.txt$", + "line": 50, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^fileset/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "fromDependency": null + } + ], + "interfaceCompileDependencies": null, + "objectDependencies": null, + "orderDependencies": null +}
diff --git a/Tests/RunCMake/FileAPI/fileset/CMakeLists.txt b/Tests/RunCMake/FileAPI/fileset/CMakeLists.txt index c318b21..183d721 100644 --- a/Tests/RunCMake/FileAPI/fileset/CMakeLists.txt +++ b/Tests/RunCMake/FileAPI/fileset/CMakeLists.txt
@@ -26,3 +26,25 @@ FILE_SET d ) install(TARGETS c_headers_2) + +# +# SOURCES file set type +# +add_library(c_sources_1 STATIC) + +target_sources(c_sources_1 + PRIVATE FILE_SET SOURCES BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES other.c + ) +set_property(FILE_SET SOURCES TARGET c_sources_1 PROPERTY COMPILE_DEFINITIONS DEF1) + +target_sources(c_sources_1 + PUBLIC FILE_SET public_srcs TYPE SOURCES BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES empty.c + ) +set_property(FILE_SET public_srcs TARGET c_sources_1 PROPERTY COMPILE_DEFINITIONS DEF2) +set_property(FILE_SET public_srcs TARGET c_sources_1 PROPERTY INTERFACE_COMPILE_DEFINITIONS DEF3) + +set_property(FILE_SET public_srcs TARGET c_sources_1 PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/dir") +set_property(FILE_SET public_srcs TARGET c_sources_1 PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/dir") + +add_library(c_sources_2 STATIC) +target_link_libraries(c_sources_2 PRIVATE c_sources_1)