From 5d700abda49d16a866f1c6e130d1156f7954b9b3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 7 Apr 2025 19:13:52 -0400 Subject: Source: Simplify FindProgram calls Remove defaulted arguments. Remove unnecessary `.c_str()`. --- Source/CPack/cmCPackBundleGenerator.cxx | 3 +-- Source/CPack/cmCPackDragNDropGenerator.cxx | 7 +++---- Source/CPack/cmCPackInnoSetupGenerator.cxx | 4 ++-- Source/CPack/cmCPackNSISGenerator.cxx | 2 +- Source/CPack/cmCPackProductBuildGenerator.cxx | 6 ++---- Source/CTest/cmCTestTestHandler.cxx | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index 3a6f7f4..82a4935 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -27,8 +27,7 @@ int cmCPackBundleGenerator::InitializeInternal() } if (this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP")) { - std::string const codesign_path = cmSystemTools::FindProgram( - "codesign", std::vector(), false); + std::string const codesign_path = cmSystemTools::FindProgram("codesign"); if (codesign_path.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 8d2f516..4b26a63 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -75,8 +75,7 @@ int cmCPackDragNDropGenerator::InitializeInternal() paths.emplace_back("/Applications/Xcode.app/Contents/Developer/Tools"); paths.emplace_back("/Developer/Tools"); - std::string const hdiutil_path = - cmSystemTools::FindProgram("hdiutil", std::vector(), false); + std::string const hdiutil_path = cmSystemTools::FindProgram("hdiutil"); if (hdiutil_path.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate hdiutil command" << std::endl); @@ -85,7 +84,7 @@ int cmCPackDragNDropGenerator::InitializeInternal() this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path); std::string const setfile_path = - cmSystemTools::FindProgram("SetFile", paths, false); + cmSystemTools::FindProgram("SetFile", paths); if (setfile_path.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate SetFile command" << std::endl); @@ -93,7 +92,7 @@ int cmCPackDragNDropGenerator::InitializeInternal() } this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path); - std::string const rez_path = cmSystemTools::FindProgram("Rez", paths, false); + std::string const rez_path = cmSystemTools::FindProgram("Rez", paths); if (rez_path.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot locate Rez command" << std::endl); diff --git a/Source/CPack/cmCPackInnoSetupGenerator.cxx b/Source/CPack/cmCPackInnoSetupGenerator.cxx index f76deb2..ed0b2c4 100644 --- a/Source/CPack/cmCPackInnoSetupGenerator.cxx +++ b/Source/CPack/cmCPackInnoSetupGenerator.cxx @@ -46,8 +46,8 @@ int cmCPackInnoSetupGenerator::InitializeInternal() #endif SetOptionIfNotSet("CPACK_INNOSETUP_EXECUTABLE", "ISCC"); - std::string const& isccPath = cmSystemTools::FindProgram( - GetOption("CPACK_INNOSETUP_EXECUTABLE"), path, false); + std::string const& isccPath = + cmSystemTools::FindProgram(GetOption("CPACK_INNOSETUP_EXECUTABLE"), path); if (isccPath.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index bc18e82..fb8e81b 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -466,7 +466,7 @@ int cmCPackNSISGenerator::InitializeInternal() this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLE", "makensis"); nsisPath = cmSystemTools::FindProgram( - *this->GetOption("CPACK_NSIS_EXECUTABLE"), path, false); + *this->GetOption("CPACK_NSIS_EXECUTABLE"), path); if (nsisPath.empty()) { cmCPackLogger( diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 32f9a7c..4193f8c 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -127,9 +127,7 @@ int cmCPackProductBuildGenerator::InitializeInternal() { this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/Applications"); - std::vector no_paths; - std::string program = - cmSystemTools::FindProgram("pkgbuild", no_paths, false); + std::string program = cmSystemTools::FindProgram("pkgbuild"); if (program.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find pkgbuild executable" << std::endl); @@ -137,7 +135,7 @@ int cmCPackProductBuildGenerator::InitializeInternal() } this->SetOptionIfNotSet("CPACK_COMMAND_PKGBUILD", program); - program = cmSystemTools::FindProgram("productbuild", no_paths, false); + program = cmSystemTools::FindProgram("productbuild"); if (program.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find productbuild executable" << std::endl); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 69ab748..ef2359f 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1708,7 +1708,7 @@ std::string cmCTestTestHandler::FindExecutable( // if everything else failed, check the users path, but only if a full path // wasn't specified if (fullPath.empty() && filepath.empty()) { - std::string path = cmSystemTools::FindProgram(filename.c_str()); + std::string path = cmSystemTools::FindProgram(filename); if (!path.empty()) { resultingConfig.clear(); return path; -- cgit v0.12