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
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)
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)
""
)
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
# 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()
gtkmm-2.4
libglade-2.0
libglademm-2.4
+ harfbuzz
pango-1.0
pangomm-1.4
sigc++-2.0
_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)
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}")
# 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)
--- /dev/null
+# 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()
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;
}
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);