Imported Upstream version 3.15.3 upstream/3.15.3
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:14:09 +0000 (09:14 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:14:09 +0000 (09:14 +0900)
27 files changed:
CMakeLists.txt
Help/release/3.15.rst
Modules/Compiler/CrayPrgEnv.cmake
Modules/FindBoost.cmake
Modules/FindMPI.cmake
Modules/Platform/Windows-Flang-Fortran.cmake
Source/CMakeVersion.cmake
Source/CTest/cmCTestMultiProcessHandler.cxx
Source/CursesDialog/cmCursesOptionsWidget.cxx
Source/cmAffinity.cxx
Source/cmFileAPICodemodel.cxx
Source/cmFindBase.cxx
Source/cmGlobalGenerator.cxx
Source/cmNinjaNormalTargetGenerator.cxx
Source/cmNinjaUtilityTargetGenerator.cxx
Source/cmQtAutoMocUic.cxx
Source/cmQtAutoMocUic.h
Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
Tests/MakeClean/ToClean/CMakeLists.txt
Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
Tests/RunCMake/FileAPI/check_index.pyc
Tests/RunCMake/FindBoost/CMakePackage_New/BoostConfig.cmake
Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt [new file with mode: 0644]
Tests/RunCMake/find_path/EmptyOldStyle.cmake [new file with mode: 0644]
Tests/RunCMake/find_path/RunCMakeTest.cmake

index 51a1d8b..e60b6c5 100644 (file)
@@ -511,7 +511,7 @@ macro (CMAKE_BUILD_UTILITIES)
   #---------------------------------------------------------------------
   # Build or use system libarchive for CMake and CTest.
   if(CMAKE_USE_SYSTEM_LIBARCHIVE)
-    find_package(LibArchive 3.1.0)
+    find_package(LibArchive 3.3.3)
     if(NOT LibArchive_FOUND)
       message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
     endif()
index b0365ba..48f3aa4 100644 (file)
@@ -369,3 +369,10 @@ Changes made since CMake 3.15.0 include the following.
 * In CMake 3.15.0 and 3.15.1 the :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG`
   variable caused the :command:`find_package` command to fail on a missing
   package even without the ``REQUIRED`` option.  This has been fixed.
+
+3.15.3
+------
+
+* ``CrayPrgEnv`` compiler wrapper support has been updated for the 19.06
+  release of the Cray Programming Environment for which the default linking
+  mode on XC Cray systems is now dynamic instead of static.
index e55e587..f6e46ac 100644 (file)
@@ -69,13 +69,27 @@ endfunction()
 # note that cmake applies both CMAKE_${lang}_FLAGS and CMAKE_EXE_LINKER_FLAGS
 # (in that order) to the linking command, so -dynamic can appear in either
 # variable.
+#
+# Note: As of CrayPE v19.06 (which translates to the craype/2.6.0 module)
+# the default has changed and is now dynamic by default.  This is handled
+# accordingly
 function(__cmake_craype_linktype lang rv)
   # start with ENV, but allow flags to override
-  if("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "dynamic")
-    set(linktype dynamic)
+  if(("$ENV{CRAYPE_VERSION}" STREQUAL "") OR
+     ("$ENV{CRAYPE_VERSION}" VERSION_LESS "2.6"))
+    if("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "dynamic")
+      set(linktype dynamic)
+    else()
+      set(linktype static)
+    endif()
   else()
-    set(linktype static)
+    if("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "static")
+      set(linktype static)
+    else()
+      set(linktype dynamic)
+    endif()
   endif()
+
   # combine flags and convert to a list so we can apply the flags in order
   set(linkflags "${CMAKE_${lang}_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
   string(REPLACE " " ";" linkflags "${linkflags}")
index 25dd397..078000f 100644 (file)
@@ -266,6 +266,21 @@ function(_boost_get_existing_target component target_var)
   foreach(prefix Boost boost)
     foreach(name IN LISTS names)
       if(TARGET "${prefix}::${name}")
+        # The target may be an INTERFACE library that wraps around a single other
+        # target for compatibility.  Unwrap this layer so we can extract real info.
+        if("${name}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9])$")
+          set(name_nv "${CMAKE_MATCH_1}")
+          if(TARGET "${prefix}::${name_nv}")
+            get_property(type TARGET "${prefix}::${name}" PROPERTY TYPE)
+            if(type STREQUAL "INTERFACE_LIBRARY")
+              get_property(lib TARGET "${prefix}::${name}" PROPERTY INTERFACE_LINK_LIBRARIES)
+              if("${lib}" STREQUAL "${prefix}::${name_nv}")
+                set(${target_var} "${prefix}::${name_nv}" PARENT_SCOPE)
+                return()
+              endif()
+            endif()
+          endif()
+        endif()
         set(${target_var} "${prefix}::${name}" PARENT_SCOPE)
         return()
       endif()
@@ -330,7 +345,7 @@ function(_boost_set_legacy_variables_from_config)
       _boost_get_existing_target(${comp} target)
       if(NOT target)
         if(Boost_DEBUG OR Boost_VERBOSE)
-          message(WARNING "Could not find imported target for required component '${comp}'. Standard variables for this component might be missing. Refer to the documentation of your Boost installation for help on variables to use.")
+          message(WARNING "Could not find imported target for required component '${comp}'. Legacy variables for this component might be missing. Refer to the documentation of your Boost installation for help on variables to use.")
         endif()
         continue()
       endif()
@@ -338,14 +353,20 @@ function(_boost_set_legacy_variables_from_config)
       _boost_set_if_unset(Boost_${uppercomp}_LIBRARY "${target}")
       _boost_set_if_unset(Boost_${uppercomp}_LIBRARIES "${target}") # Very old legacy variable
       list(APPEND libraries "${target}")
-      foreach(cfg RELEASE DEBUG)
-        get_target_property(lib ${target} IMPORTED_LOCATION_${cfg})
-        if(lib)
-          get_filename_component(lib_dir "${lib}" DIRECTORY)
-          list(APPEND library_dirs ${lib_dir})
-          _boost_set_cache_if_unset(Boost_${uppercomp}_LIBRARY_${cfg} "${lib}")
-        endif()
-      endforeach()
+      get_property(type TARGET "${target}" PROPERTY TYPE)
+      if(NOT type STREQUAL "INTERFACE_LIBRARY")
+        foreach(cfg RELEASE DEBUG)
+          get_target_property(lib ${target} IMPORTED_LOCATION_${cfg})
+          if(lib)
+            get_filename_component(lib_dir "${lib}" DIRECTORY)
+            list(APPEND library_dirs ${lib_dir})
+            _boost_set_cache_if_unset(Boost_${uppercomp}_LIBRARY_${cfg} "${lib}")
+          endif()
+        endforeach()
+      elseif(Boost_DEBUG OR Boost_VERBOSE)
+        # For projects using only the Boost::* targets this warning can be safely ignored.
+        message(WARNING "Imported target '${target}' for required component '${comp}' has no artifact. Legacy variables for this component might be missing. Refer to the documentation of your Boost installation for help on variables to use.")
+      endif()
       _boost_get_canonical_target_name("${comp}" canonical_target)
       if(NOT TARGET "${canonical_target}")
         add_library("${canonical_target}" INTERFACE IMPORTED)
@@ -1105,23 +1126,21 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
     set(_Boost_TIMER_DEPENDENCIES chrono system)
     set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
     set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
-  else()
-    if(NOT Boost_VERSION_STRING VERSION_LESS 1.70.0)
-      set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
-      set(_Boost_COROUTINE_DEPENDENCIES context)
-      set(_Boost_FIBER_DEPENDENCIES context)
-      set(_Boost_IOSTREAMS_DEPENDENCIES regex)
-      set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
-      set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
-      set(_Boost_MPI_DEPENDENCIES serialization)
-      set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
-      set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
-      set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
-      set(_Boost_TIMER_DEPENDENCIES chrono system)
-      set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
-      set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
-    endif()
-    if(NOT Boost_VERSION_STRING VERSION_LESS 1.71.0)
+  elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.70.0)
+    set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
+    set(_Boost_COROUTINE_DEPENDENCIES context)
+    set(_Boost_FIBER_DEPENDENCIES context)
+    set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+    set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
+    set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
+    set(_Boost_MPI_DEPENDENCIES serialization)
+    set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
+    set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
+    set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
+    set(_Boost_TIMER_DEPENDENCIES chrono)
+    set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
+    set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+    if(NOT Boost_VERSION_STRING VERSION_LESS 1.72.0)
       message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
     endif()
   endif()
@@ -1393,7 +1412,7 @@ else()
   # _Boost_COMPONENT_HEADERS.  See the instructions at the top of
   # _Boost_COMPONENT_DEPENDENCIES.
   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
-    "1.70.0" "1.70" "1.69.0" "1.69"
+    "1.71.0" "1.71" "1.70.0" "1.70" "1.69.0" "1.69"
     "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
     "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
     "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
index 9471be8..2b9b20c 100644 (file)
@@ -1698,7 +1698,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
     set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}")
     unset(MPI_${LANG}_COMPILE_FLAGS)
     if(MPI_${LANG}_COMPILE_OPTIONS)
-      list(JOIN MPI_${LANG}_COMPILE_FLAGS " " MPI_${LANG}_COMPILE_OPTIONS)
+      list(JOIN MPI_${LANG}_COMPILE_OPTIONS " " MPI_${LANG}_COMPILE_FLAGS)
     endif()
     if(MPI_${LANG}_COMPILE_DEFINITIONS)
       foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS)
index a4b1cf1..c4420f7 100644 (file)
@@ -1,3 +1,8 @@
 include(Platform/Windows-MSVC)
 __windows_compiler_msvc(Fortran)
 set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> ${_COMPILE_Fortran} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded         -Xclang --dependent-lib=libcmt)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL      -Xclang --dependent-lib=msvcrt)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug    -Xclang --dependent-lib=libcmtd)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -Xclang --dependent-lib=msvcrtd)
index efbbeb4..72e6f4e 100644 (file)
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 15)
-set(CMake_VERSION_PATCH 2)
+set(CMake_VERSION_PATCH 3)
 #set(CMake_VERSION_RC 0)
index ef63073..1b71f2a 100644 (file)
@@ -855,8 +855,8 @@ static Json::Value DumpCTestProperties(
       DumpCTestProperty("PROCESSORS", testProperties.Processors));
   }
   if (!testProperties.RequiredFiles.empty()) {
-    properties["REQUIRED_FILES"] =
-      DumpToJsonArray(testProperties.RequiredFiles);
+    properties.append(DumpCTestProperty(
+      "REQUIRED_FILES", DumpToJsonArray(testProperties.RequiredFiles)));
   }
   if (!testProperties.LockedResources.empty()) {
     properties.append(DumpCTestProperty(
index a8c4933..eb773ad 100644 (file)
@@ -23,6 +23,9 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left,
 bool cmCursesOptionsWidget::HandleInput(int& key, cmCursesMainForm* /*fm*/,
                                         WINDOW* w)
 {
+  if (this->Options.empty()) {
+    return false;
+  }
   switch (key) {
     case 10: // 10 == enter
     case KEY_ENTER:
index 588b2f2..09b0298 100644 (file)
@@ -12,6 +12,8 @@
 #    define CM_HAVE_CPU_AFFINITY
 #    include <pthread.h>
 #    include <sched.h>
+// On some platforms CPU_ZERO needs memset but sched.h forgets string.h
+#    include <string.h> // IWYU pragma: keep
 #    if defined(__FreeBSD__)
 #      include <pthread_np.h>
 #      include <sys/cpuset.h>
index 6025025..fecbf63 100644 (file)
@@ -502,6 +502,12 @@ Json::Value CodemodelConfig::DumpTarget(cmGeneratorTarget* gt,
 {
   Target t(gt, this->Config);
   std::string prefix = "target-" + gt->GetName();
+  for (char& c : prefix) {
+    // CMP0037 OLD behavior allows slashes in target names.  Remove them.
+    if (c == '/' || c == '\\') {
+      c = '_';
+    }
+  }
   if (!this->Config.empty()) {
     prefix += "-" + this->Config;
   }
index e590802..42aff04 100644 (file)
@@ -141,7 +141,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
 
   // look for old style
   // FIND_*(VAR name path1 path2 ...)
-  if (!newStyle) {
+  if (!newStyle && !this->Names.empty()) {
     // All the short-hand arguments have been recorded as names.
     std::vector<std::string> shortArgs = this->Names;
     this->Names.clear(); // clear out any values in Names
index 9afc15a..6b001f2 100644 (file)
@@ -924,12 +924,9 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
   cmMakefile* mf, std::string const& lang) const
 {
   std::string compilerIdVar = "CMAKE_" + lang + "_COMPILER_ID";
-  const char* compilerId = mf->GetDefinition(compilerIdVar);
-  if (!compilerId) {
-    return;
-  }
+  std::string const compilerId = mf->GetSafeDefinition(compilerIdVar);
 
-  if (strcmp(compilerId, "AppleClang") == 0) {
+  if (compilerId == "AppleClang") {
     switch (mf->GetPolicyStatus(cmPolicies::CMP0025)) {
       case cmPolicies::WARN:
         if (!this->CMakeInstance->GetIsInTryCompile() &&
@@ -959,7 +956,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
     }
   }
 
-  if (strcmp(compilerId, "QCC") == 0) {
+  if (compilerId == "QCC") {
     switch (mf->GetPolicyStatus(cmPolicies::CMP0047)) {
       case cmPolicies::WARN:
         if (!this->CMakeInstance->GetIsInTryCompile() &&
@@ -995,7 +992,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
     }
   }
 
-  if (strcmp(compilerId, "XLClang") == 0) {
+  if (compilerId == "XLClang") {
     switch (mf->GetPolicyStatus(cmPolicies::CMP0089)) {
       case cmPolicies::WARN:
         if (!this->CMakeInstance->GetIsInTryCompile() &&
index f65abc8..b7b822a 100644 (file)
@@ -85,6 +85,7 @@ void cmNinjaNormalTargetGenerator::Generate()
     this->WriteLinkStatement();
   }
 
+  // Find ADDITIONAL_CLEAN_FILES
   this->AdditionalCleanFiles();
 }
 
index 1225cbd..e774b53 100644 (file)
@@ -135,6 +135,9 @@ void cmNinjaUtilityTargetGenerator::Generate()
     gg->WriteBuild(this->GetBuildFileStream(), phonyBuild);
   }
 
+  // Find ADDITIONAL_CLEAN_FILES
+  this->AdditionalCleanFiles();
+
   // Add an alias for the logical target name regardless of what directory
   // contains it.  Skip this for GLOBAL_TARGET because they are meant to
   // be per-directory and have one at the top-level anyway.
index 889f47d..641d8aa 100644 (file)
@@ -982,7 +982,7 @@ bool cmQtAutoMocUic::JobEvaluateT::UicEval(SourceFileMapT const& fileMap)
 }
 
 bool cmQtAutoMocUic::JobEvaluateT::UicEvalFile(
-  SourceFileHandleT sourceFileHandle)
+  SourceFileHandleT const& sourceFileHandle)
 {
   SourceFileT const& sourceFile = *sourceFileHandle;
   auto const& Include = sourceFile.ParseData->Uic.Include;
@@ -1000,7 +1000,7 @@ bool cmQtAutoMocUic::JobEvaluateT::UicEvalFile(
     }
     // Register mapping
     if (!UicRegisterMapping(incKey.Key, std::move(uiFileHandle),
-                            std::move(sourceFileHandle))) {
+                            sourceFileHandle)) {
       return false;
     }
   }
index 8061c13..81546cc 100644 (file)
@@ -439,7 +439,7 @@ public:
 
     // -- Uic
     bool UicEval(SourceFileMapT const& fileMap);
-    bool UicEvalFile(SourceFileHandleT sourceFileHandle);
+    bool UicEvalFile(SourceFileHandleT const& sourceFileHandle);
     SourceFileHandleT UicFindIncludedUi(std::string const& sourceFile,
                                         std::string const& sourceDir,
                                         IncludeKeyT const& incKey) const;
index 169ba07..27838a4 100644 (file)
@@ -6,9 +6,17 @@ foreach(t MultiThreaded SingleThreaded)
   foreach(dbg "" Debug)
     foreach(dll "" DLL)
       set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_${t}${dbg}${dll}")
-      # ifort does not actually define these, so inject them
-      string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
-      string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+      if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+        # ifort does not actually define these, so inject them
+        string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
+        string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+      elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Flang")
+        # flang does not actually define these, so inject them
+        string(REPLACE ";--dependent-lib=libcmt;" ";--dependent-lib=libcmt;-D_MT;" "${var}" ";${${var}};")
+        string(REPLACE ";--dependent-lib=msvcrt;" ";--dependent-lib=msvcrt;-D_MT;-D_DLL;" "${var}" ";${${var}};")
+        string(REPLACE ";--dependent-lib=libcmtd;" ";--dependent-lib=libcmtd;-D_MT;-D_DEBUG;" "${var}" ";${${var}};")
+        string(REPLACE ";--dependent-lib=msvcrtd;" ";--dependent-lib=msvcrtd;-D_MT;-D_DEBUG;-D_DLL;" "${var}" ";${${var}};")
+      endif()
     endforeach()
   endforeach()
 endforeach()
@@ -45,6 +53,6 @@ endfunction()
 verify(Fortran verify.F90)
 # Intel Fortran for Windows supports single-threaded RTL but it is
 # not implemented by the Visual Studio integration.
-if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
   verify_combinations(SingleThreaded Fortran verify.F90)
 endif()
index 6f16d12..a05c38b 100644 (file)
@@ -15,42 +15,45 @@ function(writeCleanFile FILENAME)
   file(WRITE "${FILENAME}" ${CLEAN_FILE_CONTENT})
 endfunction()
 
+set(DUMMY_CONTENT_FILE ${CSD}/toclean.cxx)
+
 # Build a simple project whose compiled objects should be cleaned.
 add_executable(toclean toclean.cxx)
-addCleanFile("${CBD}${CMAKE_FILES_DIRECTORY}/toclean.dir/toclean.cxx${CMAKE_CXX_OUTPUT_EXTENSION}")
+addCleanFile(
+  "${CBD}${CMAKE_FILES_DIRECTORY}/toclean.dir/toclean.cxx${CMAKE_CXX_OUTPUT_EXTENSION}")
 
-# Create a post build custom command that copies the toclean output executable
+# Create a post build custom command that copies a dummy file
 # to a custom location
-function(addToCleanPostBuildCopy FILENAME)
-  add_custom_command(TARGET toclean POST_BUILD
+function(addPostBuildFile TARGET FILENAME)
+  add_custom_command(TARGET ${TARGET} POST_BUILD
     COMMAND ${CMAKE_COMMAND}
-    ARGS -E copy $<TARGET_FILE:toclean> ${FILENAME})
+    ARGS -E copy ${DUMMY_CONTENT_FILE} ${FILENAME})
 endfunction()
 
 # Create a custom command whose output should be cleaned.
 set(CustomCommandFile "${CBD}/CustomCommandFile.txt")
 add_custom_command(OUTPUT ${CustomCommandFile}
-  DEPENDS ${CSD}/toclean.cxx
+  DEPENDS ${DUMMY_CONTENT_FILE}
   COMMAND ${CMAKE_COMMAND}
-  ARGS -E copy ${CSD}/toclean.cxx ${CustomCommandFile})
-add_custom_target(generate ALL DEPENDS ${CustomCommandFile})
+  ARGS -E copy ${DUMMY_CONTENT_FILE} ${CustomCommandFile})
+add_custom_target(customTarget ALL DEPENDS ${CustomCommandFile})
 addCleanFile(${CustomCommandFile})
 
 
 ### Tests ADDITIONAL_MAKE_CLEAN_FILES directory property
 if("${CMAKE_GENERATOR}" MATCHES "Makefile")
   # Create a file that must be registered for cleaning.
-  set(MakeDirPropFile "${CBD}/MakeDirPropFile.txt")
-  writeCleanFile("${MakeDirPropFile}")
-  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${MakeDirPropFile}")
-  addCleanFile(${MakeDirPropFile})
+  set(MakeDirPropFileAbs "${CBD}/MakeDirPropFile.txt")
+  writeCleanFile("${MakeDirPropFileAbs}")
+  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${MakeDirPropFileAbs}")
+  addCleanFile(${MakeDirPropFileAbs})
 
   # Create a custom command whose output should be cleaned, but whose name
   # is not known until generate-time
   set(MakeDirPropExpFileRel "MakeDirProp_copy${CMAKE_EXECUTABLE_SUFFIX}")
-  set(MakeDirPropExpFile "$<TARGET_FILE_DIR:toclean>/${MakeDirPropExpFileRel}")
-  addToCleanPostBuildCopy("${MakeDirPropExpFile}")
-  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${MakeDirPropExpFile})
+  set(MakeDirPropExpFileAbs "$<TARGET_FILE_DIR:toclean>/${MakeDirPropExpFileRel}")
+  addPostBuildFile(toclean "${MakeDirPropExpFileAbs}")
+  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${MakeDirPropExpFileAbs})
   addCleanFile("${CBD}/${MakeDirPropExpFileRel}")
 endif()
 
@@ -72,34 +75,43 @@ addCleanFile("${DirPropFileAbs}")
 # Create a custom command whose output should be cleaned, but whose name
 # is not known until generate-time
 set(DirPropExpFileRel "DirProp_copy${CMAKE_EXECUTABLE_SUFFIX}")
-set(DirPropExpFile "$<TARGET_FILE_DIR:toclean>/${DirPropExpFileRel}")
-addToCleanPostBuildCopy("${DirPropExpFile}")
-set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${DirPropExpFile})
+set(DirPropExpFileAbs "$<TARGET_FILE_DIR:toclean>/${DirPropExpFileRel}")
+addPostBuildFile(toclean "${DirPropExpFileAbs}")
+set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${DirPropExpFileAbs})
 addCleanFile("${CBD}/${DirPropExpFileRel}")
 
 
 ### Tests ADDITIONAL_CLEAN_FILES target property
 
-# Register a file path relative to the build directory
-set(TgtPropFileRel "TargetPropFileRel.txt")
-writeCleanFile("${CBD}/${TgtPropFileRel}")
-set_target_properties(toclean PROPERTIES ADDITIONAL_CLEAN_FILES ${TgtPropFileRel})
-addCleanFile("${CBD}/${TgtPropFileRel}")
-
-# Register an absolute file path
-set(TgtPropFileAbs "${CBD}/TargetPropFileAbs.txt")
-writeCleanFile("${TgtPropFileAbs}")
-set_property(TARGET toclean APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${TgtPropFileAbs})
-addCleanFile("${TgtPropFileAbs}")
-
-# Create a custom command whose output should be cleaned, but whose name
-# is not known until generate-time
-set(TgtPropExpFileRel "TgtProp_copy${CMAKE_EXECUTABLE_SUFFIX}")
-set(TgtPropExpFile "$<TARGET_FILE_DIR:toclean>/${TgtPropExpFileRel}")
-addToCleanPostBuildCopy("${TgtPropExpFile}")
-set_property(TARGET toclean APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${TgtPropExpFile})
-addCleanFile("${CBD}/${TgtPropExpFileRel}")
+function(test_target_property TARGET)
+    # Register a file path relative to the build directory
+    set(TgtPropFileRel "${TARGET}_TargetPropFileRel.txt")
+    writeCleanFile("${CBD}/${TgtPropFileRel}")
+    set_target_properties(${TARGET} PROPERTIES ADDITIONAL_CLEAN_FILES ${TgtPropFileRel})
+    addCleanFile("${CBD}/${TgtPropFileRel}")
+
+    # Register an absolute file path
+    set(TgtPropFileAbs "${CBD}/${TARGET}_TargetPropFileAbs.txt")
+    writeCleanFile("${TgtPropFileAbs}")
+    set_property(TARGET ${TARGET} APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${TgtPropFileAbs})
+    addCleanFile("${TgtPropFileAbs}")
+
+    # Create a custom command whose output should be cleaned, but whose name
+    # is not known until generate-time
+    set(TgtPropExpFileRel "${TARGET}_TargetPropGenExp.txt")
+    set(TgtPropExpFileAbs "$<TARGET_FILE_DIR:toclean>/${TgtPropExpFileRel}")
+    addPostBuildFile(${TARGET} "${TgtPropExpFileAbs}")
+    set_property(TARGET ${TARGET} APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${TgtPropExpFileAbs})
+    addCleanFile("${CBD}/${TgtPropExpFileRel}")
+endfunction()
 
+# Test target property for various target types
+add_executable(acf_exec toclean.cxx)
+test_target_property(acf_exec)
+add_library(acf_lib toclean.cxx)
+test_target_property(acf_lib)
+add_custom_target(acf_custom ALL DEPENDS ${CustomCommandFile})
+test_target_property(acf_custom)
 
 # Process subdirectory without targets
 add_subdirectory(EmptySubDir)
index d524f41..b7f9a37 100644 (file)
@@ -200,7 +200,11 @@ function(run_ShowOnly)
   file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
   file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
     add_test(ShowOnly \"${CMAKE_COMMAND}\" -E echo)
-    set_tests_properties(ShowOnly PROPERTIES WILL_FAIL true _BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\")
+    set_tests_properties(ShowOnly PROPERTIES
+      WILL_FAIL true
+      REQUIRED_FILES RequiredFileDoesNotExist
+      _BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\"
+      )
     add_test(ShowOnlyNotAvailable NOT_AVAILABLE)
 ")
   run_cmake_command(show-only_human ${CMAKE_CTEST_COMMAND} --show-only=human)
index 4dff90c..3ad5768 100644 (file)
@@ -63,6 +63,15 @@ def check_command(c):
     assert is_string(c[2])
     assert c[2] == "echo"
 
+def check_reqfiles_property(p):
+    assert is_dict(p)
+    assert sorted(p.keys()) == ["name", "value"]
+    assert is_string(p["name"])
+    assert is_list(p["value"])
+    assert p["name"] == "REQUIRED_FILES"
+    assert len(p["value"]) == 1
+    assert p["value"][0] == "RequiredFileDoesNotExist"
+
 def check_willfail_property(p):
     assert is_dict(p)
     assert sorted(p.keys()) == ["name", "value"]
@@ -81,9 +90,10 @@ def check_workingdir_property(p):
 
 def check_properties(p):
     assert is_list(p)
-    assert len(p) == 2
-    check_willfail_property(p[0])
-    check_workingdir_property(p[1])
+    assert len(p) == 3
+    check_reqfiles_property(p[0])
+    check_willfail_property(p[1])
+    check_workingdir_property(p[2])
 
 def check_tests(t):
     assert is_list(t)
index 8ab3793..d971338 100644 (file)
Binary files a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc and b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc differ
index 0bd932b..bd51050 100644 (file)
Binary files a/Tests/RunCMake/FileAPI/check_index.pyc and b/Tests/RunCMake/FileAPI/check_index.pyc differ
index 3a88f26..1151514 100644 (file)
@@ -8,6 +8,7 @@ set_target_properties(Boost::date_time PROPERTIES
   IMPORTED_CONFIGURATIONS RELEASE
   IMPORTED_LOCATION_RELEASE "${CMAKE_CURRENT_LIST_DIR}/lib/libboost_date_time.a"
   )
+
 set(Boost_python37_FOUND 1)
 add_library(Boost::python UNKNOWN IMPORTED)
 set_target_properties(Boost::python PROPERTIES
@@ -15,6 +16,10 @@ set_target_properties(Boost::python PROPERTIES
   IMPORTED_LOCATION_RELEASE "${CMAKE_CURRENT_LIST_DIR}/lib/libboost_python_release.a"
   IMPORTED_LOCATION_DEBUG "${CMAKE_CURRENT_LIST_DIR}/lib/libboost_python.a"
   )
+# Versioned target alias for compatibility (added by upstream BoostConfig).
+add_library(Boost::python37 INTERFACE IMPORTED)
+set_property(TARGET Boost::python37 APPEND PROPERTY INTERFACE_LINK_LIBRARIES Boost::python)
+
 set(Boost_mpi_python2_FOUND 1)
 add_library(Boost::mpi_python UNKNOWN IMPORTED)
 set_target_properties(Boost::mpi_python PROPERTIES
diff --git a/Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt b/Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt
new file mode 100644 (file)
index 0000000..8f21eb8
--- /dev/null
@@ -0,0 +1 @@
+-- VAR-NOTFOUND
diff --git a/Tests/RunCMake/find_path/EmptyOldStyle.cmake b/Tests/RunCMake/find_path/EmptyOldStyle.cmake
new file mode 100644 (file)
index 0000000..d78bb65
--- /dev/null
@@ -0,0 +1,2 @@
+find_path(VAR ONLY_CMAKE_FIND_ROOT_PATH)
+message(STATUS "${VAR}")
index bf0fa89..3afbedc 100644 (file)
@@ -1,5 +1,6 @@
 include(RunCMake)
 
+run_cmake(EmptyOldStyle)
 if(WIN32 OR CYGWIN)
   run_cmake(PrefixInPATH)
 endif()