Update upstream source from tag 'upstream/3.23.3'

Update to upstream version '3.23.3'
with Debian dir 7f05aaed44
ci/unstable
Timo Röhling 2 years ago
commit 5357d00bbf

@ -9,17 +9,15 @@ tutorial assume that they are not common.
If the platform has ``log`` and ``exp`` then we will use them to compute the If the platform has ``log`` and ``exp`` then we will use them to compute the
square root in the ``mysqrt`` function. We first test for the availability of square root in the ``mysqrt`` function. We first test for the availability of
these functions using the :module:`CheckSymbolExists` module in these functions using the :module:`CheckCXXSourceCompiles` module in
``MathFunctions/CMakeLists.txt``. On some platforms, we will need to link to ``MathFunctions/CMakeLists.txt``.
the ``m`` library. If ``log`` and ``exp`` are not initially found, require the
``m`` library and try again.
Add the checks for ``log`` and ``exp`` to ``MathFunctions/CMakeLists.txt``, Add the checks for ``log`` and ``exp`` to ``MathFunctions/CMakeLists.txt``,
after the call to :command:`target_include_directories`: after the call to :command:`target_include_directories`:
.. literalinclude:: Step6/MathFunctions/CMakeLists.txt .. literalinclude:: Step6/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt :caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-check_symbol_exists :name: MathFunctions/CMakeLists.txt-check_cxx_source_compiles
:language: cmake :language: cmake
:start-after: # to find MathFunctions.h, while we don't. :start-after: # to find MathFunctions.h, while we don't.
:end-before: # add compile definitions :end-before: # add compile definitions

@ -7,19 +7,21 @@ target_include_directories(MathFunctions
) )
# does this system provide the log and exp functions? # does this system provide the log and exp functions?
include(CheckSymbolExists) include(CheckCXXSourceCompiles)
check_symbol_exists(log "math.h" HAVE_LOG) check_cxx_source_compiles("
check_symbol_exists(exp "math.h" HAVE_EXP) #include <cmath>
if(NOT (HAVE_LOG AND HAVE_EXP)) int main() {
unset(HAVE_LOG CACHE) std::log(1.0);
unset(HAVE_EXP CACHE) return 0;
set(CMAKE_REQUIRED_LIBRARIES "m") }
check_symbol_exists(log "math.h" HAVE_LOG) " HAVE_LOG)
check_symbol_exists(exp "math.h" HAVE_EXP) check_cxx_source_compiles("
if(HAVE_LOG AND HAVE_EXP) #include <cmath>
target_link_libraries(MathFunctions PRIVATE m) int main() {
endif() std::exp(1.0);
endif() return 0;
}
" HAVE_EXP)
# add compile definitions # add compile definitions
if(HAVE_LOG AND HAVE_EXP) if(HAVE_LOG AND HAVE_EXP)

@ -12,7 +12,7 @@ double mysqrt(double x)
// if we have both log and exp then use them // if we have both log and exp then use them
#if defined(HAVE_LOG) && defined(HAVE_EXP) #if defined(HAVE_LOG) && defined(HAVE_EXP)
double result = exp(log(x) * 0.5); double result = std::exp(std::log(x) * 0.5);
std::cout << "Computing sqrt of " << x << " to be " << result std::cout << "Computing sqrt of " << x << " to be " << result
<< " using log and exp" << std::endl; << " using log and exp" << std::endl;
#else #else

@ -335,8 +335,8 @@ Changes made since CMake 3.21.0 include the following.
"Visual Studio 2022" release candidates. Previously it was based on "Visual Studio 2022" release candidates. Previously it was based on
preview versions. preview versions.
3.21.5, 3.21.6 3.21.5, 3.21.6, 3.21.7
-------------- ----------------------
These versions made no changes to documented features or interfaces. These versions made no changes to documented features or interfaces.
Some implementation updates were made to support ecosystem changes Some implementation updates were made to support ecosystem changes

@ -170,9 +170,9 @@ Changes made since CMake 3.22.0 include the following.
compatibility. The fix may be restored in a future version of CMake compatibility. The fix may be restored in a future version of CMake
via a policy. via a policy.
3.22.4 3.22.4, 3.22.5, 3.22.6
------ ----------------------
* This version made no changes to documented features or interfaces. * These versions made no changes to documented features or interfaces.
Some implementation updates were made to support ecosystem changes Some implementation updates were made to support ecosystem changes
and/or fix regressions. and/or fix regressions.

@ -309,3 +309,10 @@ Changes made since CMake 3.23.0 include the following.
expected the ``CPACK_PACKAGEMAKER_CHOICES`` variable to be defined. expected the ``CPACK_PACKAGEMAKER_CHOICES`` variable to be defined.
The old ``CPACK_PACKAGEMAKER_CHOICES`` variable is now also set to the The old ``CPACK_PACKAGEMAKER_CHOICES`` variable is now also set to the
same content as it was before, but it is formally deprecated. same content as it was before, but it is formally deprecated.
3.23.3
------
* This version made no changes to documented features or interfaces.
Some implementation updates were made to support ecosystem changes
and/or fix regressions.

@ -617,6 +617,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
endif() endif()
endif() endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT MATCHES "^$|[Mm][Aa][Cc][Oo][Ss]") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT MATCHES "^$|[Mm][Aa][Cc][Oo][Ss]")
set(id_code_sign_identity "-")
# When targeting macOS, use only the host architecture. # When targeting macOS, use only the host architecture.
if (_CMAKE_APPLE_ARCHS_DEFAULT) if (_CMAKE_APPLE_ARCHS_DEFAULT)
set(id_archs "ARCHS = \"${_CMAKE_APPLE_ARCHS_DEFAULT}\";") set(id_archs "ARCHS = \"${_CMAKE_APPLE_ARCHS_DEFAULT}\";")
@ -626,6 +627,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_arch_active "ONLY_ACTIVE_ARCH = YES;") set(id_arch_active "ONLY_ACTIVE_ARCH = YES;")
endif() endif()
else() else()
set(id_code_sign_identity "")
set(id_archs "") set(id_archs "")
set(id_arch_active "ONLY_ACTIVE_ARCH = YES;") set(id_arch_active "ONLY_ACTIVE_ARCH = YES;")
endif() endif()

@ -49,6 +49,7 @@
}; };
2C8FEB8E15DC1A1A00E56A5D = { 2C8FEB8E15DC1A1A00E56A5D = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
@ -72,7 +73,7 @@
1DEB928608733DD80010E9CD = { 1DEB928608733DD80010E9CD = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "@id_code_sign_identity@";
PRODUCT_NAME = CompilerId@id_lang@; PRODUCT_NAME = CompilerId@id_lang@;
}; };
name = Debug; name = Debug;

@ -1651,6 +1651,7 @@ function(_ep_set_directories name)
${script_filename} ${script_filename}
@ONLY @ONLY
) )
unset(cfgdir) # do not leak into mkdirs.cmake script
include(${script_filename}) include(${script_filename})
endfunction() endfunction()
@ -2419,11 +2420,12 @@ endfunction()
function(_ep_add_mkdir_command name) function(_ep_add_mkdir_command name)
ExternalProject_Get_Property(${name} tmp_dir) ExternalProject_Get_Property(${name} tmp_dir)
set(script_filename "${tmp_dir}/${name}-mkdirs.cmake") set(script_filename "${tmp_dir}/${name}-mkdirs.cmake")
_ep_get_configuration_subdir_suffix(cfgdir)
ExternalProject_Add_Step(${name} mkdir ExternalProject_Add_Step(${name} mkdir
INDEPENDENT TRUE INDEPENDENT TRUE
COMMENT "Creating directories for '${name}'" COMMENT "Creating directories for '${name}'"
COMMAND ${CMAKE_COMMAND} -P ${script_filename} COMMAND ${CMAKE_COMMAND} -Dcfgdir=${cfgdir} -P ${script_filename}
) )
endfunction() endfunction()

@ -17,3 +17,6 @@ set(configSubDirs @CMAKE_CONFIGURATION_TYPES@)
foreach(subDir IN LISTS configSubDirs) foreach(subDir IN LISTS configSubDirs)
file(MAKE_DIRECTORY "@stamp_dir@/${subDir}") file(MAKE_DIRECTORY "@stamp_dir@/${subDir}")
endforeach() endforeach()
if(cfgdir)
file(MAKE_DIRECTORY "@stamp_dir@${cfgdir}") # cfgdir has leading slash
endif()

@ -663,6 +663,10 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
elseif(_lapack_sizeof_integer EQUAL 4) elseif(_lapack_sizeof_integer EQUAL 4)
string(APPEND _lapack_nvhpc_lib "_lp64") string(APPEND _lapack_nvhpc_lib "_lp64")
endif() endif()
set(_lapack_nvhpc_flags)
if(";${CMAKE_C_COMPILER_ID};${CMAKE_CXX_COMPILER_ID};${CMAKE_Fortran_COMPILER_ID};" MATCHES ";(NVHPC|PGI);")
set(_lapack_nvhpc_flags "-fortranlibs")
endif()
check_lapack_libraries( check_lapack_libraries(
LAPACK_LIBRARIES LAPACK_LIBRARIES
@ -670,7 +674,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
cheev cheev
"" ""
"${_lapack_nvhpc_lib}" "${_lapack_nvhpc_lib}"
"-fortranlibs" "${_lapack_nvhpc_flags}"
"" ""
"" ""
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
@ -688,7 +692,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
cheev cheev
"" ""
"${_lapack_nvhpc_lib}" "${_lapack_nvhpc_lib}"
"-fortranlibs" "${_lapack_nvhpc_flags}"
"" ""
"" ""
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
@ -696,6 +700,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
endif() endif()
unset(_lapack_nvhpc_lib) unset(_lapack_nvhpc_lib)
unset(_lapack_nvhpc_flags)
endif() endif()
# Generic LAPACK library? # Generic LAPACK library?

@ -1,3 +1,7 @@
include(Platform/Linux-LCC) include(Platform/Linux-LCC)
__linux_compiler_lcc(Fortran) __linux_compiler_lcc(Fortran)
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-llfortran") if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "1.26.03")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-llfortran")
else()
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-lgfortran")
endif()

@ -1,7 +1,7 @@
# CMake version number components. # CMake version number components.
set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 23) set(CMake_VERSION_MINOR 23)
set(CMake_VERSION_PATCH 2) set(CMake_VERSION_PATCH 3)
#set(CMake_VERSION_RC 0) #set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0) set(CMake_VERSION_IS_DIRTY 0)
@ -21,7 +21,7 @@ endif()
if(NOT CMake_VERSION_NO_GIT) if(NOT CMake_VERSION_NO_GIT)
# If this source was exported by 'git archive', use its commit info. # If this source was exported by 'git archive', use its commit info.
set(git_info [==[a8bd06dfd4 CMake 3.23.2]==]) set(git_info [==[d566bd962d CMake 3.23.3]==])
# Otherwise, try to identify the current development source version. # Otherwise, try to identify the current development source version.
if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* " if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "

@ -10,6 +10,15 @@
#include <QTranslator> #include <QTranslator>
#include <QtPlugin> #include <QtPlugin>
// FIXME(#23565): Qt6 has QTextCodec in Core5Compat, but using its
// `setCodecForLocale` does not make cmake-gui support non-ASCII chars
// on Windows. For now we only support them with Qt5. How do we support
// them with Qt6, preferably without Core5Compat?
#if defined(Q_OS_WIN) && (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
# include <QTextCodec>
# define CMAKE_HAVE_QTEXTCODEC
#endif
#include "cmsys/CommandLineArguments.hxx" #include "cmsys/CommandLineArguments.hxx"
#include "cmsys/Encoding.hxx" #include "cmsys/Encoding.hxx"
#include "cmsys/SystemTools.hxx" #include "cmsys/SystemTools.hxx"
@ -124,6 +133,11 @@ int main(int argc, char** argv)
setlocale(LC_NUMERIC, "C"); setlocale(LC_NUMERIC, "C");
#ifdef CMAKE_HAVE_QTEXTCODEC
QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8");
QTextCodec::setCodecForLocale(utf8_codec);
#endif
// tell the cmake library where cmake is // tell the cmake library where cmake is
QDir cmExecDir(QApplication::applicationDirPath()); QDir cmExecDir(QApplication::applicationDirPath());
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)

@ -2,10 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */ file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExportSet.h" #include "cmExportSet.h"
#include <algorithm>
#include <tuple> #include <tuple>
#include <utility> #include <utility>
#include "cmGeneratorTarget.h"
#include "cmLocalGenerator.h" #include "cmLocalGenerator.h"
#include "cmMessageType.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
#include "cmTargetExport.h" #include "cmTargetExport.h"
cmExportSet::cmExportSet(std::string name) cmExportSet::cmExportSet(std::string name)
@ -15,11 +20,35 @@ cmExportSet::cmExportSet(std::string name)
cmExportSet::~cmExportSet() = default; cmExportSet::~cmExportSet() = default;
void cmExportSet::Compute(cmLocalGenerator* lg) bool cmExportSet::Compute(cmLocalGenerator* lg)
{ {
for (std::unique_ptr<cmTargetExport>& tgtExport : this->TargetExports) { for (std::unique_ptr<cmTargetExport>& tgtExport : this->TargetExports) {
tgtExport->Target = lg->FindGeneratorTargetToUse(tgtExport->TargetName); tgtExport->Target = lg->FindGeneratorTargetToUse(tgtExport->TargetName);
auto const interfaceFileSets =
tgtExport->Target->Target->GetAllInterfaceFileSets();
auto const fileSetInTargetExport =
[&tgtExport, lg](const std::string& fileSetName) -> bool {
auto* fileSet = tgtExport->Target->Target->GetFileSet(fileSetName);
if (!tgtExport->FileSetGenerators.count(fileSet)) {
lg->IssueMessage(MessageType::FATAL_ERROR,
cmStrCat("File set \"", fileSetName,
"\" is listed in interface file sets of ",
tgtExport->Target->GetName(),
" but has not been exported"));
return false;
}
return true;
};
if (!std::all_of(interfaceFileSets.begin(), interfaceFileSets.end(),
fileSetInTargetExport)) {
return false;
}
} }
return true;
} }
void cmExportSet::AddTargetExport(std::unique_ptr<cmTargetExport> te) void cmExportSet::AddTargetExport(std::unique_ptr<cmTargetExport> te)

@ -25,7 +25,7 @@ public:
cmExportSet(const cmExportSet&) = delete; cmExportSet(const cmExportSet&) = delete;
cmExportSet& operator=(const cmExportSet&) = delete; cmExportSet& operator=(const cmExportSet&) = delete;
void Compute(cmLocalGenerator* lg); bool Compute(cmLocalGenerator* lg);
void AddTargetExport(std::unique_ptr<cmTargetExport> tgt); void AddTargetExport(std::unique_ptr<cmTargetExport> tgt);

@ -1361,7 +1361,9 @@ void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
this->CheckTargetProperties(); this->CheckTargetProperties();
} }
this->CreateGeneratorTargets(targetTypes); this->CreateGeneratorTargets(targetTypes);
this->ComputeBuildFileGenerators(); if (targetTypes == TargetTypes::AllTargets) {
this->ComputeBuildFileGenerators();
}
} }
void cmGlobalGenerator::CreateImportedGenerationObjects( void cmGlobalGenerator::CreateImportedGenerationObjects(

@ -49,8 +49,7 @@ cmInstallExportGenerator::~cmInstallExportGenerator() = default;
bool cmInstallExportGenerator::Compute(cmLocalGenerator* lg) bool cmInstallExportGenerator::Compute(cmLocalGenerator* lg)
{ {
this->LocalGenerator = lg; this->LocalGenerator = lg;
this->ExportSet->Compute(lg); return this->ExportSet->Compute(lg);
return true;
} }
void cmInstallExportGenerator::ComputeTempDir() void cmInstallExportGenerator::ComputeTempDir()

@ -405,9 +405,6 @@ void cmake::PrintPresetEnvironment()
// Parse the args // Parse the args
bool cmake::SetCacheArgs(const std::vector<std::string>& args) bool cmake::SetCacheArgs(const std::vector<std::string>& args)
{ {
auto findPackageMode = false;
auto seenScriptOption = false;
auto DefineLambda = [](std::string const& entry, cmake* state) -> bool { auto DefineLambda = [](std::string const& entry, cmake* state) -> bool {
std::string var; std::string var;
std::string value; std::string value;
@ -498,10 +495,10 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
GetProjectCommandsInScriptMode(state->GetState()); GetProjectCommandsInScriptMode(state->GetState());
// Documented behavior of CMAKE{,_CURRENT}_{SOURCE,BINARY}_DIR is to be // Documented behavior of CMAKE{,_CURRENT}_{SOURCE,BINARY}_DIR is to be
// set to $PWD for -P mode. // set to $PWD for -P mode.
state->SetWorkingMode(SCRIPT_MODE);
state->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory()); state->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
state->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory()); state->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
state->ReadListFile(args, path); state->ReadListFile(args, path);
seenScriptOption = true;
return true; return true;
}; };
@ -565,15 +562,12 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
"No install directory specified for --install-prefix", "No install directory specified for --install-prefix",
CommandArgument::Values::One, PrefixLambda }, CommandArgument::Values::One, PrefixLambda },
CommandArgument{ "--find-package", CommandArgument::Values::Zero, CommandArgument{ "--find-package", CommandArgument::Values::Zero,
[&](std::string const&, cmake*) -> bool { IgnoreAndTrueLambda },
findPackageMode = true;
return true;
} },
}; };
for (decltype(args.size()) i = 1; i < args.size(); ++i) { for (decltype(args.size()) i = 1; i < args.size(); ++i) {
std::string const& arg = args[i]; std::string const& arg = args[i];
if (arg == "--" && seenScriptOption) { if (arg == "--" && this->GetWorkingMode() == SCRIPT_MODE) {
// Stop processing CMake args and avoid possible errors // Stop processing CMake args and avoid possible errors
// when arbitrary args are given to CMake script. // when arbitrary args are given to CMake script.
break; break;
@ -588,7 +582,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
} }
} }
if (findPackageMode) { if (this->GetWorkingMode() == FIND_PACKAGE_MODE) {
return this->FindPackage(args); return this->FindPackage(args);
} }
@ -793,7 +787,6 @@ void cmake::SetArgs(const std::vector<std::string>& args)
bool haveToolset = false; bool haveToolset = false;
bool havePlatform = false; bool havePlatform = false;
bool haveBArg = false; bool haveBArg = false;
bool scriptMode = false;
std::string possibleUnknownArg; std::string possibleUnknownArg;
std::string extraProvidedPath; std::string extraProvidedPath;
#if !defined(CMAKE_BOOTSTRAP) #if !defined(CMAKE_BOOTSTRAP)
@ -871,10 +864,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
CommandArgument{ "-P", "-P must be followed by a file name.", CommandArgument{ "-P", "-P must be followed by a file name.",
CommandArgument::Values::One, CommandArgument::Values::One,
CommandArgument::RequiresSeparator::No, CommandArgument::RequiresSeparator::No,
[&](std::string const&, cmake*) -> bool { IgnoreAndTrueLambda },
scriptMode = true;
return true;
} },
CommandArgument{ "-D", "-D must be followed with VAR=VALUE.", CommandArgument{ "-D", "-D must be followed with VAR=VALUE.",
CommandArgument::Values::One, CommandArgument::Values::One,
CommandArgument::RequiresSeparator::No, CommandArgument::RequiresSeparator::No,
@ -1198,12 +1188,12 @@ void cmake::SetArgs(const std::vector<std::string>& args)
} }
} }
if (!extraProvidedPath.empty() && !scriptMode) { if (!extraProvidedPath.empty() && this->GetWorkingMode() == NORMAL_MODE) {
this->IssueMessage(MessageType::WARNING, this->IssueMessage(MessageType::WARNING,
cmStrCat("Ignoring extra path from command line:\n \"", cmStrCat("Ignoring extra path from command line:\n \"",
extraProvidedPath, "\"")); extraProvidedPath, "\""));
} }
if (!possibleUnknownArg.empty() && !scriptMode) { if (!possibleUnknownArg.empty() && this->GetWorkingMode() != SCRIPT_MODE) {
cmSystemTools::Error(cmStrCat("Unknown argument ", possibleUnknownArg)); cmSystemTools::Error(cmStrCat("Unknown argument ", possibleUnknownArg));
cmSystemTools::Error("Run 'cmake --help' for all supported options."); cmSystemTools::Error("Run 'cmake --help' for all supported options.");
exit(1); exit(1);
@ -1787,7 +1777,8 @@ void cmake::SetHomeDirectoryViaCommandLine(std::string const& path)
} }
auto prev_path = this->GetHomeDirectory(); auto prev_path = this->GetHomeDirectory();
if (prev_path != path && !prev_path.empty()) { if (prev_path != path && !prev_path.empty() &&
this->GetWorkingMode() == NORMAL_MODE) {
this->IssueMessage(MessageType::WARNING, this->IssueMessage(MessageType::WARNING,
cmStrCat("Ignoring extra path from command line:\n \"", cmStrCat("Ignoring extra path from command line:\n \"",
prev_path, "\"")); prev_path, "\""));

@ -0,0 +1,6 @@
^-- CMAKE_ARGC='5'
-- CMAKE_ARGV1='-P'
-- CMAKE_ARGV2='[^']*/Tests/RunCMake/CommandLine/P_args.cmake'
-- CMAKE_ARGV3='relative/path'
-- CMAKE_ARGV4='[^']*/Tests/RunCMake/CommandLine'
-- CMAKE_ARGV5=''$

@ -0,0 +1,6 @@
message(STATUS "CMAKE_ARGC='${CMAKE_ARGC}'")
message(STATUS "CMAKE_ARGV1='${CMAKE_ARGV1}'")
message(STATUS "CMAKE_ARGV2='${CMAKE_ARGV2}'")
message(STATUS "CMAKE_ARGV3='${CMAKE_ARGV3}'")
message(STATUS "CMAKE_ARGV4='${CMAKE_ARGV4}'")
message(STATUS "CMAKE_ARGV5='${CMAKE_ARGV5}'")

@ -52,6 +52,7 @@ run_cmake_command(G_no-arg ${CMAKE_COMMAND} -B DummyBuildDir -G)
run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -B DummyBuildDir -G NoSuchGenerator) run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -B DummyBuildDir -G NoSuchGenerator)
run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P) run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake) run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
run_cmake_command(P_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_args.cmake" relative/path "${RunCMake_SOURCE_DIR}")
run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO) run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO)
run_cmake_command(build-no-dir run_cmake_command(build-no-dir

@ -164,7 +164,9 @@ function(run_cmake test)
"|[^\n]*install_name_tool: warning: changes being made to the file will invalidate the code signature in:" "|[^\n]*install_name_tool: warning: changes being made to the file will invalidate the code signature in:"
"|[^\n]*xcodebuild[^\n]*DVTPlugInManager" "|[^\n]*xcodebuild[^\n]*DVTPlugInManager"
"|[^\n]*xcodebuild[^\n]*DVTSDK: Warning: SDK path collision for path"
"|[^\n]*xcodebuild[^\n]*Requested but did not find extension point with identifier" "|[^\n]*xcodebuild[^\n]*Requested but did not find extension point with identifier"
"|[^\n]*xcodebuild[^\n]*nil host used in call to allows.*HTTPSCertificateForHost"
"|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type" "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
"|[^\n]*objc[^\n]*: Class [^\n]* One of the two will be used. Which one is undefined." "|[^\n]*objc[^\n]*: Class [^\n]* One of the two will be used. Which one is undefined."
"|[^\n]*is a member of multiple groups" "|[^\n]*is a member of multiple groups"

@ -18,3 +18,4 @@ run_cmake(DependOnDoubleExport)
run_cmake(UnknownExport) run_cmake(UnknownExport)
run_cmake(NamelinkOnlyExport) run_cmake(NamelinkOnlyExport)
run_cmake(SeparateNamelinkExport) run_cmake(SeparateNamelinkExport)
run_cmake(TryCompileExport)

@ -0,0 +1,9 @@
enable_language(CXX)
add_library(interface INTERFACE)
install(TARGETS interface EXPORT export)
export(EXPORT export)
add_library(imported IMPORTED INTERFACE)
try_compile(tc "${CMAKE_CURRENT_BINARY_DIR}/tc" "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" LINK_LIBRARIES imported)

@ -0,0 +1,6 @@
^CMake Error in CMakeLists\.txt:
File set "a" is listed in interface file sets of lib1 but has not been
exported
CMake Generate step failed\. Build files cannot be regenerated correctly\.$

@ -0,0 +1,6 @@
enable_language(C)
add_library(lib1 STATIC empty.c)
install(TARGETS lib1 EXPORT a)
target_sources(lib1 INTERFACE FILE_SET a TYPE HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} FILES h1.h)
export(EXPORT a)

@ -0,0 +1,6 @@
^CMake Error in CMakeLists\.txt:
File set "a" is listed in interface file sets of lib1 but has not been
exported
CMake Generate step failed\. Build files cannot be regenerated correctly\.$

@ -0,0 +1,6 @@
enable_language(C)
add_library(lib1 STATIC empty.c)
install(TARGETS lib1 EXPORT a)
target_sources(lib1 INTERFACE FILE_SET a TYPE HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} FILES h1.h)
install(EXPORT a DESTINATION lib/cmake/test)

@ -33,6 +33,8 @@ run_cmake(FileSetWrongBaseDirsRelative)
run_cmake(FileSetOverlappingBaseDirs) run_cmake(FileSetOverlappingBaseDirs)
run_cmake(FileSetInstallMissingSetsPrivate) run_cmake(FileSetInstallMissingSetsPrivate)
run_cmake(FileSetInstallMissingSetsInterface) run_cmake(FileSetInstallMissingSetsInterface)
run_cmake(FileSetInstallMissingSetsInterfacePostInstall)
run_cmake(FileSetExportMissingSetsInterfacePostExport)
run_cmake(FileSetReadOnlyPrivate) run_cmake(FileSetReadOnlyPrivate)
run_cmake(FileSetReadOnlyInterface) run_cmake(FileSetReadOnlyInterface)
run_cmake(FileSetNoExistInstall) run_cmake(FileSetNoExistInstall)

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
readonly usage='usage: sign-notarize.bash -i <id> -d <dev-acct> -k <key-item> [-p <provider>] [--] <package>.dmg readonly usage='usage: sign-notarize.bash -i <id> -k <keychain-profile> [--] <package>.dmg
Sign and notarize the "CMake.app" bundle inside the given "<package>.dmg" disk image. Sign and notarize the "CMake.app" bundle inside the given "<package>.dmg" disk image.
Also produce a "<package>.tar.gz" tarball containing the same "CMake.app". Also produce a "<package>.tar.gz" tarball containing the same "CMake.app".
@ -8,9 +8,22 @@ Also produce a "<package>.tar.gz" tarball containing the same "CMake.app".
Options: Options:
-i <id> Signing Identity -i <id> Signing Identity
-d <dev-acct> Developer account name -k <keychain-profile> Keychain profile containing stored credentials
-k <key-item> Keychain item containing account credentials
-p <provider> Provider short name Create the keychain profile ahead of time using
xcrun notarytool store-credentials <keychain-profile> \
--apple-id <dev-acct> --team-id <team-id> [--password <app-specific-password>]
where:
<dev-acct> is an Apple ID of a developer account
<team-id> is from https://developer.apple.com/account/#!/membership
<app-specific-password> is generated via https://support.apple.com/en-us/HT204397
If --password is omitted, notarytool will prompt for it.
This creates a keychain item called "com.apple.gke.notary.tool" with an
account name "com.apple.gke.notary.tool.saved-creds.<keychain-profile>".
' '
cleanup() { cleanup() {
@ -29,15 +42,11 @@ die() {
} }
id='' id=''
dev_acct='' keychain_profile=''
key_item=''
provider=''
while test "$#" != 0; do while test "$#" != 0; do
case "$1" in case "$1" in
-i) shift; id="$1" ;; -i) shift; id="$1" ;;
-d) shift; dev_acct="$1" ;; -k) shift; keychain_profile="$1" ;;
-k) shift; key_item="$1" ;;
-p) shift; provider="$1" ;;
--) shift ; break ;; --) shift ; break ;;
-*) die "$usage" ;; -*) die "$usage" ;;
*) break ;; *) break ;;
@ -51,18 +60,14 @@ esac
test "$#" = 0 || die "$usage" test "$#" = 0 || die "$usage"
# Verify arguments. # Verify arguments.
if test -z "$id" -o -z "$dev_acct" -o -z "$key_item"; then if test -z "$id" -o -z "$keychain_profile"; then
die "$usage" die "$usage"
fi fi
if test -n "$provider"; then
provider="--provider $provider"
fi
# Verify environment. # Verify environment.
if ! xcnotary="$(type -p xcnotary)"; then if ! xcrun --find notarytool 2>/dev/null; then
die "'xcnotary' not found in PATH" die "'xcrun notarytool' not found"
fi fi
readonly xcnotary
readonly tmpdir="$(mktemp -d)" readonly tmpdir="$(mktemp -d)"
@ -101,7 +106,9 @@ codesign --verify --timestamp --options=runtime --verbose --deep \
"$vol_path/CMake.app/Contents/bin/cpack" \ "$vol_path/CMake.app/Contents/bin/cpack" \
"$vol_path/CMake.app" "$vol_path/CMake.app"
xcnotary notarize "$vol_path/CMake.app" -d "$dev_acct" -k "$key_item" $provider ditto -c -k --keepParent "$vol_path/CMake.app" "$tmpdir/CMake.app.zip"
xcrun notarytool submit "$tmpdir/CMake.app.zip" --keychain-profile "$keychain_profile" --wait
xcrun stapler staple "$vol_path/CMake.app"
# Create a tarball of the volume next to the original disk image. # Create a tarball of the volume next to the original disk image.
readonly tar_gz="${dmg/%.dmg/.tar.gz}" readonly tar_gz="${dmg/%.dmg/.tar.gz}"

Loading…
Cancel
Save