Imported Upstream version 3.15.6 upstream/3.15.6
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:14:14 +0000 (09:14 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:14:14 +0000 (09:14 +0900)
13 files changed:
CompileFlags.cmake
Modules/CMakeDetermineCompilerId.cmake
Modules/CMakeParseImplicitIncludeInfo.cmake
Modules/FindBLAS.cmake
Modules/FindBoost.cmake
Modules/FindGTK2.cmake
Modules/FindPostgreSQL.cmake
Source/CMakeVersion.cmake
Source/Modules/CheckCXXLinkerFlag.cmake [new file with mode: 0644]
Source/cmGlobalVisualStudioVersionedGenerator.cxx
Tests/FindPostgreSQL/Test/main.c
Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
Tests/RunCMake/FileAPI/check_index.pyc

index 91f2adf..053259f 100644 (file)
@@ -54,12 +54,20 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
 endif()
 
 # Workaround for TOC Overflow on ppc64
+set(bigTocFlag "")
 if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND
    CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-bbigtoc")
+  set(bigTocFlag "-Wl,-bbigtoc")
 elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
    CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-multi-toc")
+  set(bigTocFlag "-Wl,--no-multi-toc")
+endif()
+if(bigTocFlag)
+  include(CheckCXXLinkerFlag)
+  check_cxx_linker_flag(${bigTocFlag} BIG_TOC_FLAG_SUPPORTED)
+  if(BIG_TOC_FLAG_SUPPORTED)
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${bigTocFlag}")
+  endif()
 endif()
 
 if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND
index d9002fb..edbc23b 100644 (file)
@@ -284,10 +284,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
           set(id_cl icl.exe)
         endif()
         if(CMAKE_VS_PLATFORM_TOOLSET_VERSION)
+          set(id_sep "\\")
           if(CMAKE_VS_PLATFORM_TOOLSET_VERSION VERSION_GREATER_EQUAL "14.20")
-            set(id_sep ".")
-          else()
-            set(id_sep "\\")
+            if(EXISTS "${CMAKE_GENERATOR_INSTANCE}/VC/Auxiliary/Build.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}/Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props")
+              set(id_sep ".")
+            endif()
           endif()
           set(id_toolset_version_props "<Import Project=\"${CMAKE_GENERATOR_INSTANCE}\\VC\\Auxiliary\\Build${id_sep}${CMAKE_VS_PLATFORM_TOOLSET_VERSION}\\Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props\" />")
           unset(id_sep)
index 91d03cd..ff4c325 100644 (file)
@@ -167,7 +167,7 @@ function(cmake_parse_implicit_include_info text lang dir_var log_var state_var)
   set(log "")
 
   # go through each line of output...
-  string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
+  string(REGEX REPLACE "\r*\n" ";" output_lines "${text}")
   foreach(line IN LISTS output_lines)
     if(state STREQUAL start)
       string(FIND "${line}" "#include \"...\" search starts here:" rv)
index 77f9d0e..d3acafc 100644 (file)
@@ -481,8 +481,12 @@ if (BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
       ""
       )
   endif()
-  if(NOT BLAS_LIBRARIES)
-    find_package(Threads)
+  if(NOT BLAS_LIBRARIES AND (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED))
+    if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
+      find_package(Threads)
+    else()
+      find_package(Threads REQUIRED)
+    endif()
     # OpenBLAS (http://www.openblas.net)
     check_fortran_libraries(
       BLAS_LIBRARIES
index 078000f..af4947c 100644 (file)
@@ -449,6 +449,9 @@ if (NOT Boost_NO_BOOST_CMAKE)
     # Convert component found variables to standard variables if required
     # Necessary for legacy boost-cmake and 1.70 builtin BoostConfig
     if(Boost_FIND_COMPONENTS)
+      # Ignore the meta-component "ALL", introduced by Boost 1.73
+      list(REMOVE_ITEM Boost_FIND_COMPONENTS "ALL")
+
       foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
         if(DEFINED Boost_${_comp}_FOUND)
           continue()
index e3af676..83091f3 100644 (file)
@@ -259,6 +259,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
         gtkmm-2.4
         libglade-2.0
         libglademm-2.4
+        harfbuzz
         pango-1.0
         pangomm-1.4
         sigc++-2.0
@@ -711,6 +712,8 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
         _GTK2_FIND_LIBRARY    (PANGO pango false true)
         _GTK2_ADD_TARGET      (PANGO GTK2_DEPENDS gobject glib)
 
+        _GTK2_FIND_INCLUDE_DIR(HARFBUZZ hb.h)
+
         _GTK2_FIND_LIBRARY    (PANGOCAIRO pangocairo false true)
         _GTK2_ADD_TARGET      (PANGOCAIRO GTK2_DEPENDS pango cairo gobject glib)
 
index dfece22..dfdd211 100644 (file)
@@ -205,11 +205,22 @@ if (PostgreSQL_INCLUDE_DIR)
     endif()
   endforeach()
   if (_PostgreSQL_VERSION_NUM)
-    math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
-    math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000")
-    set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}")
-    unset(_PostgreSQL_major_version)
-    unset(_PostgreSQL_minor_version)
+    # 9.x and older encoding
+    if (_PostgreSQL_VERSION_NUM LESS 100000)
+      math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
+      math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000 / 100")
+      math(EXPR _PostgreSQL_patch_version "${_PostgreSQL_VERSION_NUM} % 100")
+      set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}.${_PostgreSQL_patch_version}")
+      unset(_PostgreSQL_major_version)
+      unset(_PostgreSQL_minor_version)
+      unset(_PostgreSQL_patch_version)
+    else ()
+      math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
+      math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000")
+      set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}")
+      unset(_PostgreSQL_major_version)
+      unset(_PostgreSQL_minor_version)
+    endif ()
   else ()
     foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
       if(EXISTS "${_PG_CONFIG_HEADER}")
index 3bb8cc3..ba06c4f 100644 (file)
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 15)
-set(CMake_VERSION_PATCH 5)
+set(CMake_VERSION_PATCH 6)
 #set(CMake_VERSION_RC 0)
diff --git a/Source/Modules/CheckCXXLinkerFlag.cmake b/Source/Modules/CheckCXXLinkerFlag.cmake
new file mode 100644 (file)
index 0000000..9ad2ad6
--- /dev/null
@@ -0,0 +1,25 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include_guard(GLOBAL)
+include(CheckCXXSourceCompiles)
+include(CMakeCheckCompilerFlagCommonPatterns)
+
+function(check_cxx_linker_flag _flag _var)
+  set(CMAKE_REQUIRED_LIBRARIES "${_flag}")
+
+  # Normalize locale during test compilation.
+  set(_locale_vars LC_ALL LC_MESSAGES LANG)
+  foreach(v IN LISTS _locale_vars)
+    set(_locale_vars_saved_${v} "$ENV{${v}}")
+    set(ENV{${v}} C)
+  endforeach()
+  check_compiler_flag_common_patterns(_common_patterns)
+  check_cxx_source_compiles("int main() { return 0; }" ${_var}
+    ${_common_patterns}
+    )
+  foreach(v IN LISTS _locale_vars)
+    set(ENV{${v}} ${_locale_vars_saved_${v}})
+  endforeach()
+  set(${_var} "${${_var}}" PARENT_SCOPE)
+endfunction()
index 1eca1f6..66a57eb 100644 (file)
@@ -388,15 +388,17 @@ std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
   if (version) {
     std::string instancePath;
     GetVSInstance(instancePath);
-    std::stringstream path;
-    path << instancePath;
-    path << "/VC/Auxiliary/Build";
-    path << (cmSystemTools::VersionCompareGreaterEq(version, "14.20") ? '.'
-                                                                      : '/');
-    path << version;
-    path << "/Microsoft.VCToolsVersion." << version << ".props";
-
-    std::string toolsetPath = path.str();
+    std::string toolsetDir = instancePath + "/VC/Auxiliary/Build";
+    char sep = '/';
+    if (cmSystemTools::VersionCompareGreaterEq(version, "14.20")) {
+      std::string toolsetDot = toolsetDir + "." + version +
+        "/Microsoft.VCToolsVersion." + version + ".props";
+      if (cmSystemTools::PathExists(toolsetDot)) {
+        sep = '.';
+      }
+    }
+    std::string toolsetPath = toolsetDir + sep + version +
+      "/Microsoft.VCToolsVersion." + version + ".props";
     cmSystemTools::ConvertToUnixSlashes(toolsetPath);
     return toolsetPath;
   }
index 2cfeed0..a63377a 100644 (file)
@@ -5,10 +5,19 @@
 int main()
 {
   int version = PQlibVersion();
-  int major = version / 10000;
-  int minor = version % 10000;
   char version_string[100];
-  snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+  // 9.x and older encoding.
+  if (version < 100000) {
+    int major = version / 10000;
+    int minor = version % 10000 / 100;
+    int patch = version % 100;
+    snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor,
+             patch);
+  } else {
+    int major = version / 10000;
+    int minor = version % 10000;
+    snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+  }
   printf("Found PostgreSQL version %s, expected version %s\n", version_string,
          CMAKE_EXPECTED_POSTGRESQL_VERSION);
   return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION);
index 1c49c51..4983bf4 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 b1d5882..2ab7837 100644 (file)
Binary files a/Tests/RunCMake/FileAPI/check_index.pyc and b/Tests/RunCMake/FileAPI/check_index.pyc differ