New upstream version 3.23.3
This commit is contained in:
		
							parent
							
								
									cdf0d5c8c0
								
							
						
					
					
						commit
						9a372f80f7
					
				@ -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
 | 
			
		||||
square root in the ``mysqrt`` function. We first test for the availability of
 | 
			
		||||
these functions using the :module:`CheckSymbolExists` module in
 | 
			
		||||
``MathFunctions/CMakeLists.txt``. On some platforms, we will need to link to
 | 
			
		||||
the ``m`` library. If ``log`` and ``exp`` are not initially found, require the
 | 
			
		||||
``m`` library and try again.
 | 
			
		||||
these functions using the :module:`CheckCXXSourceCompiles` module in
 | 
			
		||||
``MathFunctions/CMakeLists.txt``.
 | 
			
		||||
 | 
			
		||||
Add the checks for ``log`` and ``exp`` to ``MathFunctions/CMakeLists.txt``,
 | 
			
		||||
after the call to :command:`target_include_directories`:
 | 
			
		||||
 | 
			
		||||
.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
 | 
			
		||||
  :caption: MathFunctions/CMakeLists.txt
 | 
			
		||||
  :name: MathFunctions/CMakeLists.txt-check_symbol_exists
 | 
			
		||||
  :name: MathFunctions/CMakeLists.txt-check_cxx_source_compiles
 | 
			
		||||
  :language: cmake
 | 
			
		||||
  :start-after: # to find MathFunctions.h, while we don't.
 | 
			
		||||
  :end-before: # add compile definitions
 | 
			
		||||
 | 
			
		||||
@ -7,19 +7,21 @@ target_include_directories(MathFunctions
 | 
			
		||||
          )
 | 
			
		||||
 | 
			
		||||
# does this system provide the log and exp functions?
 | 
			
		||||
include(CheckSymbolExists)
 | 
			
		||||
check_symbol_exists(log "math.h" HAVE_LOG)
 | 
			
		||||
check_symbol_exists(exp "math.h" HAVE_EXP)
 | 
			
		||||
if(NOT (HAVE_LOG AND HAVE_EXP))
 | 
			
		||||
  unset(HAVE_LOG CACHE)
 | 
			
		||||
  unset(HAVE_EXP CACHE)
 | 
			
		||||
  set(CMAKE_REQUIRED_LIBRARIES "m")
 | 
			
		||||
  check_symbol_exists(log "math.h" HAVE_LOG)
 | 
			
		||||
  check_symbol_exists(exp "math.h" HAVE_EXP)
 | 
			
		||||
  if(HAVE_LOG AND HAVE_EXP)
 | 
			
		||||
    target_link_libraries(MathFunctions PRIVATE m)
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
include(CheckCXXSourceCompiles)
 | 
			
		||||
check_cxx_source_compiles("
 | 
			
		||||
  #include <cmath>
 | 
			
		||||
  int main() {
 | 
			
		||||
    std::log(1.0);
 | 
			
		||||
    return 0;
 | 
			
		||||
  }
 | 
			
		||||
" HAVE_LOG)
 | 
			
		||||
check_cxx_source_compiles("
 | 
			
		||||
  #include <cmath>
 | 
			
		||||
  int main() {
 | 
			
		||||
    std::exp(1.0);
 | 
			
		||||
    return 0;
 | 
			
		||||
  }
 | 
			
		||||
" HAVE_EXP)
 | 
			
		||||
 | 
			
		||||
# add compile definitions
 | 
			
		||||
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 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
 | 
			
		||||
            << " using log and exp" << std::endl;
 | 
			
		||||
#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
 | 
			
		||||
  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.
 | 
			
		||||
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
 | 
			
		||||
  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
 | 
			
		||||
  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.
 | 
			
		||||
  The old ``CPACK_PACKAGEMAKER_CHOICES`` variable is now also set to the
 | 
			
		||||
  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()
 | 
			
		||||
    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.
 | 
			
		||||
      if (_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;")
 | 
			
		||||
      endif()
 | 
			
		||||
    else()
 | 
			
		||||
      set(id_code_sign_identity "")
 | 
			
		||||
      set(id_archs "")
 | 
			
		||||
      set(id_arch_active "ONLY_ACTIVE_ARCH = YES;")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
@ -49,6 +49,7 @@
 | 
			
		||||
		};
 | 
			
		||||
		2C8FEB8E15DC1A1A00E56A5D = {
 | 
			
		||||
			isa = PBXShellScriptBuildPhase;
 | 
			
		||||
			alwaysOutOfDate = 1;
 | 
			
		||||
			buildActionMask = 2147483647;
 | 
			
		||||
			files = (
 | 
			
		||||
			);
 | 
			
		||||
@ -72,7 +73,7 @@
 | 
			
		||||
		1DEB928608733DD80010E9CD = {
 | 
			
		||||
			isa = XCBuildConfiguration;
 | 
			
		||||
			buildSettings = {
 | 
			
		||||
				CODE_SIGN_IDENTITY = "";
 | 
			
		||||
				CODE_SIGN_IDENTITY = "@id_code_sign_identity@";
 | 
			
		||||
				PRODUCT_NAME = CompilerId@id_lang@;
 | 
			
		||||
			};
 | 
			
		||||
			name = Debug;
 | 
			
		||||
 | 
			
		||||
@ -1651,6 +1651,7 @@ function(_ep_set_directories name)
 | 
			
		||||
    ${script_filename}
 | 
			
		||||
    @ONLY
 | 
			
		||||
  )
 | 
			
		||||
  unset(cfgdir) # do not leak into mkdirs.cmake script
 | 
			
		||||
  include(${script_filename})
 | 
			
		||||
endfunction()
 | 
			
		||||
 | 
			
		||||
@ -2419,11 +2420,12 @@ endfunction()
 | 
			
		||||
function(_ep_add_mkdir_command name)
 | 
			
		||||
  ExternalProject_Get_Property(${name} tmp_dir)
 | 
			
		||||
  set(script_filename "${tmp_dir}/${name}-mkdirs.cmake")
 | 
			
		||||
  _ep_get_configuration_subdir_suffix(cfgdir)
 | 
			
		||||
 | 
			
		||||
  ExternalProject_Add_Step(${name} mkdir
 | 
			
		||||
    INDEPENDENT TRUE
 | 
			
		||||
    COMMENT "Creating directories for '${name}'"
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -P ${script_filename}
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -Dcfgdir=${cfgdir} -P ${script_filename}
 | 
			
		||||
  )
 | 
			
		||||
endfunction()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -17,3 +17,6 @@ set(configSubDirs @CMAKE_CONFIGURATION_TYPES@)
 | 
			
		||||
foreach(subDir IN LISTS configSubDirs)
 | 
			
		||||
    file(MAKE_DIRECTORY "@stamp_dir@/${subDir}")
 | 
			
		||||
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)
 | 
			
		||||
      string(APPEND _lapack_nvhpc_lib "_lp64")
 | 
			
		||||
    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(
 | 
			
		||||
      LAPACK_LIBRARIES
 | 
			
		||||
@ -670,7 +674,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
 | 
			
		||||
      cheev
 | 
			
		||||
      ""
 | 
			
		||||
      "${_lapack_nvhpc_lib}"
 | 
			
		||||
      "-fortranlibs"
 | 
			
		||||
      "${_lapack_nvhpc_flags}"
 | 
			
		||||
      ""
 | 
			
		||||
      ""
 | 
			
		||||
      "${BLAS_LIBRARIES}"
 | 
			
		||||
@ -688,7 +692,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
 | 
			
		||||
        cheev
 | 
			
		||||
        ""
 | 
			
		||||
        "${_lapack_nvhpc_lib}"
 | 
			
		||||
        "-fortranlibs"
 | 
			
		||||
        "${_lapack_nvhpc_flags}"
 | 
			
		||||
        ""
 | 
			
		||||
        ""
 | 
			
		||||
        "${BLAS_LIBRARIES}"
 | 
			
		||||
@ -696,6 +700,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    unset(_lapack_nvhpc_lib)
 | 
			
		||||
    unset(_lapack_nvhpc_flags)
 | 
			
		||||
  endif()
 | 
			
		||||
 | 
			
		||||
  # Generic LAPACK library?
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,7 @@
 | 
			
		||||
include(Platform/Linux-LCC)
 | 
			
		||||
__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.
 | 
			
		||||
set(CMake_VERSION_MAJOR 3)
 | 
			
		||||
set(CMake_VERSION_MINOR 23)
 | 
			
		||||
set(CMake_VERSION_PATCH 2)
 | 
			
		||||
set(CMake_VERSION_PATCH 3)
 | 
			
		||||
#set(CMake_VERSION_RC 0)
 | 
			
		||||
set(CMake_VERSION_IS_DIRTY 0)
 | 
			
		||||
 | 
			
		||||
@ -21,7 +21,7 @@ endif()
 | 
			
		||||
 | 
			
		||||
if(NOT CMake_VERSION_NO_GIT)
 | 
			
		||||
  # 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.
 | 
			
		||||
  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 <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/Encoding.hxx"
 | 
			
		||||
#include "cmsys/SystemTools.hxx"
 | 
			
		||||
@ -124,6 +133,11 @@ int main(int argc, char** argv)
 | 
			
		||||
 | 
			
		||||
  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
 | 
			
		||||
  QDir cmExecDir(QApplication::applicationDirPath());
 | 
			
		||||
#if defined(Q_OS_MAC)
 | 
			
		||||
 | 
			
		||||
@ -2,10 +2,15 @@
 | 
			
		||||
   file Copyright.txt or https://cmake.org/licensing for details.  */
 | 
			
		||||
#include "cmExportSet.h"
 | 
			
		||||
 | 
			
		||||
#include <algorithm>
 | 
			
		||||
#include <tuple>
 | 
			
		||||
#include <utility>
 | 
			
		||||
 | 
			
		||||
#include "cmGeneratorTarget.h"
 | 
			
		||||
#include "cmLocalGenerator.h"
 | 
			
		||||
#include "cmMessageType.h"
 | 
			
		||||
#include "cmStringAlgorithms.h"
 | 
			
		||||
#include "cmTarget.h"
 | 
			
		||||
#include "cmTargetExport.h"
 | 
			
		||||
 | 
			
		||||
cmExportSet::cmExportSet(std::string name)
 | 
			
		||||
@ -15,11 +20,35 @@ cmExportSet::cmExportSet(std::string name)
 | 
			
		||||
 | 
			
		||||
cmExportSet::~cmExportSet() = default;
 | 
			
		||||
 | 
			
		||||
void cmExportSet::Compute(cmLocalGenerator* lg)
 | 
			
		||||
bool cmExportSet::Compute(cmLocalGenerator* lg)
 | 
			
		||||
{
 | 
			
		||||
  for (std::unique_ptr<cmTargetExport>& tgtExport : this->TargetExports) {
 | 
			
		||||
    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)
 | 
			
		||||
 | 
			
		||||
@ -25,7 +25,7 @@ public:
 | 
			
		||||
  cmExportSet(const cmExportSet&) = delete;
 | 
			
		||||
  cmExportSet& operator=(const cmExportSet&) = delete;
 | 
			
		||||
 | 
			
		||||
  void Compute(cmLocalGenerator* lg);
 | 
			
		||||
  bool Compute(cmLocalGenerator* lg);
 | 
			
		||||
 | 
			
		||||
  void AddTargetExport(std::unique_ptr<cmTargetExport> tgt);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1361,7 +1361,9 @@ void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
 | 
			
		||||
    this->CheckTargetProperties();
 | 
			
		||||
  }
 | 
			
		||||
  this->CreateGeneratorTargets(targetTypes);
 | 
			
		||||
  this->ComputeBuildFileGenerators();
 | 
			
		||||
  if (targetTypes == TargetTypes::AllTargets) {
 | 
			
		||||
    this->ComputeBuildFileGenerators();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cmGlobalGenerator::CreateImportedGenerationObjects(
 | 
			
		||||
 | 
			
		||||
@ -49,8 +49,7 @@ cmInstallExportGenerator::~cmInstallExportGenerator() = default;
 | 
			
		||||
bool cmInstallExportGenerator::Compute(cmLocalGenerator* lg)
 | 
			
		||||
{
 | 
			
		||||
  this->LocalGenerator = lg;
 | 
			
		||||
  this->ExportSet->Compute(lg);
 | 
			
		||||
  return true;
 | 
			
		||||
  return this->ExportSet->Compute(lg);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cmInstallExportGenerator::ComputeTempDir()
 | 
			
		||||
 | 
			
		||||
@ -405,9 +405,6 @@ void cmake::PrintPresetEnvironment()
 | 
			
		||||
// Parse the 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 {
 | 
			
		||||
    std::string var;
 | 
			
		||||
    std::string value;
 | 
			
		||||
@ -498,10 +495,10 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
 | 
			
		||||
    GetProjectCommandsInScriptMode(state->GetState());
 | 
			
		||||
    // Documented behavior of CMAKE{,_CURRENT}_{SOURCE,BINARY}_DIR is to be
 | 
			
		||||
    // set to $PWD for -P mode.
 | 
			
		||||
    state->SetWorkingMode(SCRIPT_MODE);
 | 
			
		||||
    state->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
 | 
			
		||||
    state->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
 | 
			
		||||
    state->ReadListFile(args, path);
 | 
			
		||||
    seenScriptOption = true;
 | 
			
		||||
    return true;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
@ -565,15 +562,12 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
 | 
			
		||||
                     "No install directory specified for --install-prefix",
 | 
			
		||||
                     CommandArgument::Values::One, PrefixLambda },
 | 
			
		||||
    CommandArgument{ "--find-package", CommandArgument::Values::Zero,
 | 
			
		||||
                     [&](std::string const&, cmake*) -> bool {
 | 
			
		||||
                       findPackageMode = true;
 | 
			
		||||
                       return true;
 | 
			
		||||
                     } },
 | 
			
		||||
                     IgnoreAndTrueLambda },
 | 
			
		||||
  };
 | 
			
		||||
  for (decltype(args.size()) i = 1; i < args.size(); ++i) {
 | 
			
		||||
    std::string const& arg = args[i];
 | 
			
		||||
 | 
			
		||||
    if (arg == "--" && seenScriptOption) {
 | 
			
		||||
    if (arg == "--" && this->GetWorkingMode() == SCRIPT_MODE) {
 | 
			
		||||
      // Stop processing CMake args and avoid possible errors
 | 
			
		||||
      // when arbitrary args are given to CMake script.
 | 
			
		||||
      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);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -793,7 +787,6 @@ void cmake::SetArgs(const std::vector<std::string>& args)
 | 
			
		||||
  bool haveToolset = false;
 | 
			
		||||
  bool havePlatform = false;
 | 
			
		||||
  bool haveBArg = false;
 | 
			
		||||
  bool scriptMode = false;
 | 
			
		||||
  std::string possibleUnknownArg;
 | 
			
		||||
  std::string extraProvidedPath;
 | 
			
		||||
#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::Values::One,
 | 
			
		||||
                     CommandArgument::RequiresSeparator::No,
 | 
			
		||||
                     [&](std::string const&, cmake*) -> bool {
 | 
			
		||||
                       scriptMode = true;
 | 
			
		||||
                       return true;
 | 
			
		||||
                     } },
 | 
			
		||||
                     IgnoreAndTrueLambda },
 | 
			
		||||
    CommandArgument{ "-D", "-D must be followed with VAR=VALUE.",
 | 
			
		||||
                     CommandArgument::Values::One,
 | 
			
		||||
                     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,
 | 
			
		||||
                       cmStrCat("Ignoring extra path from command line:\n \"",
 | 
			
		||||
                                extraProvidedPath, "\""));
 | 
			
		||||
  }
 | 
			
		||||
  if (!possibleUnknownArg.empty() && !scriptMode) {
 | 
			
		||||
  if (!possibleUnknownArg.empty() && this->GetWorkingMode() != SCRIPT_MODE) {
 | 
			
		||||
    cmSystemTools::Error(cmStrCat("Unknown argument ", possibleUnknownArg));
 | 
			
		||||
    cmSystemTools::Error("Run 'cmake --help' for all supported options.");
 | 
			
		||||
    exit(1);
 | 
			
		||||
@ -1787,7 +1777,8 @@ void cmake::SetHomeDirectoryViaCommandLine(std::string const& path)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  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,
 | 
			
		||||
                       cmStrCat("Ignoring extra path from command line:\n \"",
 | 
			
		||||
                                prev_path, "\""));
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								Tests/RunCMake/CommandLine/P_args-stdout.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								Tests/RunCMake/CommandLine/P_args-stdout.txt
									
									
									
									
									
										Normal file
									
								
							@ -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=''$
 | 
			
		||||
							
								
								
									
										6
									
								
								Tests/RunCMake/CommandLine/P_args.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								Tests/RunCMake/CommandLine/P_args.cmake
									
									
									
									
									
										Normal file
									
								
							@ -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(P_no-arg ${CMAKE_COMMAND} -P)
 | 
			
		||||
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(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]*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]*nil host used in call to allows.*HTTPSCertificateForHost"
 | 
			
		||||
    "|[^\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]*is a member of multiple groups"
 | 
			
		||||
 | 
			
		||||
@ -18,3 +18,4 @@ run_cmake(DependOnDoubleExport)
 | 
			
		||||
run_cmake(UnknownExport)
 | 
			
		||||
run_cmake(NamelinkOnlyExport)
 | 
			
		||||
run_cmake(SeparateNamelinkExport)
 | 
			
		||||
run_cmake(TryCompileExport)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								Tests/RunCMake/export/TryCompileExport.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Tests/RunCMake/export/TryCompileExport.cmake
									
									
									
									
									
										Normal file
									
								
							@ -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 @@
 | 
			
		||||
1
 | 
			
		||||
@ -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 @@
 | 
			
		||||
1
 | 
			
		||||
@ -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(FileSetInstallMissingSetsPrivate)
 | 
			
		||||
run_cmake(FileSetInstallMissingSetsInterface)
 | 
			
		||||
run_cmake(FileSetInstallMissingSetsInterfacePostInstall)
 | 
			
		||||
run_cmake(FileSetExportMissingSetsInterfacePostExport)
 | 
			
		||||
run_cmake(FileSetReadOnlyPrivate)
 | 
			
		||||
run_cmake(FileSetReadOnlyInterface)
 | 
			
		||||
run_cmake(FileSetNoExistInstall)
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
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.
 | 
			
		||||
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:
 | 
			
		||||
 | 
			
		||||
    -i <id>                Signing Identity
 | 
			
		||||
    -d <dev-acct>          Developer account name
 | 
			
		||||
    -k <key-item>          Keychain item containing account credentials
 | 
			
		||||
    -p <provider>          Provider short name
 | 
			
		||||
    -k <keychain-profile>  Keychain profile containing stored credentials
 | 
			
		||||
 | 
			
		||||
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() {
 | 
			
		||||
@ -29,15 +42,11 @@ die() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
id=''
 | 
			
		||||
dev_acct=''
 | 
			
		||||
key_item=''
 | 
			
		||||
provider=''
 | 
			
		||||
keychain_profile=''
 | 
			
		||||
while test "$#" != 0; do
 | 
			
		||||
    case "$1" in
 | 
			
		||||
    -i) shift; id="$1" ;;
 | 
			
		||||
    -d) shift; dev_acct="$1" ;;
 | 
			
		||||
    -k) shift; key_item="$1" ;;
 | 
			
		||||
    -p) shift; provider="$1" ;;
 | 
			
		||||
    -k) shift; keychain_profile="$1" ;;
 | 
			
		||||
    --) shift ; break ;;
 | 
			
		||||
    -*) die "$usage" ;;
 | 
			
		||||
    *) break ;;
 | 
			
		||||
@ -51,18 +60,14 @@ esac
 | 
			
		||||
test "$#" = 0 || die "$usage"
 | 
			
		||||
 | 
			
		||||
# 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"
 | 
			
		||||
fi
 | 
			
		||||
if test -n "$provider"; then
 | 
			
		||||
    provider="--provider $provider"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Verify environment.
 | 
			
		||||
if ! xcnotary="$(type -p xcnotary)"; then
 | 
			
		||||
    die "'xcnotary' not found in PATH"
 | 
			
		||||
if ! xcrun --find notarytool 2>/dev/null; then
 | 
			
		||||
    die "'xcrun notarytool' not found"
 | 
			
		||||
fi
 | 
			
		||||
readonly xcnotary
 | 
			
		||||
 | 
			
		||||
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"
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
readonly tar_gz="${dmg/%.dmg/.tar.gz}"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user