mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 22:58:37 -05:00
Merge branch 'master' into osx-init-early
Resolve conflict in Source/cmGlobalGenerator.cxx by integrating changes from both sides.
This commit is contained in:
@@ -16,6 +16,7 @@ set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
|
||||
set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
|
||||
set(AM_QT_VERSION_MAJOR "@_target_qt_version@")
|
||||
set(AM_TARGET_NAME @_moc_target_name@)
|
||||
set(AM_ORIGIN_TARGET_NAME @_origin_target_name@)
|
||||
set(AM_RELAXED_MODE "@_moc_relaxed_mode@")
|
||||
set(AM_UIC_TARGET_OPTIONS @_uic_target_options@)
|
||||
set(AM_UIC_OPTIONS_FILES @_qt_uic_options_files@)
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
|
||||
set(PACKAGE_VERSION "@CVF_VERSION@")
|
||||
|
||||
if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version
|
||||
if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
|
||||
set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@")
|
||||
endif()
|
||||
|
||||
if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version
|
||||
if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\.") # strip the tweak version
|
||||
set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
|
||||
|
||||
@@ -235,8 +235,8 @@ function(get_bundle_main_executable bundle result_var)
|
||||
#
|
||||
set(eol_char "E")
|
||||
file(READ "${bundle}/Contents/Info.plist" info_plist)
|
||||
string(REGEX REPLACE ";" "\\\\;" info_plist "${info_plist}")
|
||||
string(REGEX REPLACE "\n" "${eol_char};" info_plist "${info_plist}")
|
||||
string(REPLACE ";" "\\;" info_plist "${info_plist}")
|
||||
string(REPLACE "\n" "${eol_char};" info_plist "${info_plist}")
|
||||
|
||||
# Scan the lines for "<key>CFBundleExecutable</key>" - the line after that
|
||||
# is the name of the main executable.
|
||||
@@ -247,7 +247,7 @@ function(get_bundle_main_executable bundle result_var)
|
||||
break()
|
||||
endif()
|
||||
|
||||
if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
|
||||
if(line MATCHES "<key>CFBundleExecutable</key>")
|
||||
set(line_is_main_executable 1)
|
||||
endif()
|
||||
endforeach()
|
||||
@@ -287,7 +287,7 @@ endfunction()
|
||||
function(get_dotapp_dir exe dotapp_dir_var)
|
||||
set(s "${exe}")
|
||||
|
||||
if(s MATCHES "^.*/.*\\.app/.*$")
|
||||
if(s MATCHES "/.*\\.app/")
|
||||
# If there is a ".app" parent directory,
|
||||
# ascend until we hit it:
|
||||
# (typical of a Mac bundle executable)
|
||||
@@ -394,7 +394,7 @@ function(get_item_key item key_var)
|
||||
if(WIN32)
|
||||
string(TOLOWER "${item_name}" item_name)
|
||||
endif()
|
||||
string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}")
|
||||
string(REPLACE "." "_" ${key_var} "${item_name}")
|
||||
set(${key_var} ${${key_var}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -31,15 +31,15 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
||||
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
include(TestCXXAcceptsFlag)
|
||||
set(CMAKE_TRY_ANSI_CXX_FLAGS "")
|
||||
if(CMAKE_SYSTEM MATCHES "IRIX.*")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "IRIX")
|
||||
set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
|
||||
endif()
|
||||
if(CMAKE_SYSTEM MATCHES "OSF.*")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "OSF")
|
||||
set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
|
||||
endif()
|
||||
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
|
||||
# if the compiler accepts it
|
||||
if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
|
||||
if(NOT CMAKE_TRY_ANSI_CXX_FLAGS STREQUAL "")
|
||||
CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
|
||||
# if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
|
||||
# to the flag
|
||||
|
||||
@@ -26,7 +26,7 @@ if(CMAKE_COMPILER_IS_MINGW)
|
||||
set(MINGW 1)
|
||||
endif()
|
||||
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
|
||||
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
|
||||
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
set(CMAKE_C_LINKER_PREFERENCE 10)
|
||||
|
||||
|
||||
@@ -68,10 +68,19 @@
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
|
||||
# if __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# else
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_C)
|
||||
# define COMPILER_ID "SunPro"
|
||||
|
||||
@@ -175,10 +175,10 @@ endif()
|
||||
# Create a static archive incrementally for large object file counts.
|
||||
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
|
||||
if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
|
||||
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
|
||||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||
|
||||
@@ -2,6 +2,9 @@ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
|
||||
set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
|
||||
set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
|
||||
set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
|
||||
set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
|
||||
set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@")
|
||||
|
||||
set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
|
||||
set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@")
|
||||
set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@")
|
||||
@@ -27,7 +30,7 @@ if(CMAKE_COMPILER_IS_MINGW)
|
||||
endif()
|
||||
set(CMAKE_CXX_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
|
||||
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP)
|
||||
set(CMAKE_CXX_LINKER_PREFERENCE 30)
|
||||
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
|
||||
|
||||
|
||||
@@ -73,10 +73,19 @@
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
|
||||
# if __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# else
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_CC)
|
||||
# define COMPILER_ID "SunPro"
|
||||
|
||||
@@ -266,10 +266,10 @@ endif()
|
||||
# Create a static archive incrementally for large object file counts.
|
||||
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
|
||||
if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
|
||||
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
|
||||
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
# cache values that can be initialized in the platform-compiler.cmake file
|
||||
# it may be included by more than one language.
|
||||
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||
CACHE STRING "Flags used by the linker.")
|
||||
|
||||
if(NOT "x$ENV{LDFLAGS}" STREQUAL "x")
|
||||
set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
# default build type is none
|
||||
@@ -82,12 +84,17 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
|
||||
"Flags used by the linker during Release with Debug Info builds.")
|
||||
endif()
|
||||
|
||||
# executable linker flags
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT}"
|
||||
CACHE STRING "Flags used by the linker.")
|
||||
|
||||
# shared linker flags
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT}"
|
||||
CACHE STRING "Flags used by the linker during the creation of dll's.")
|
||||
|
||||
# module linker flags
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT}"
|
||||
CACHE STRING "Flags used by the linker during the creation of modules.")
|
||||
|
||||
# static linker flags
|
||||
@@ -124,4 +131,3 @@ CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
|
||||
CMAKE_STATIC_LINKER_FLAGS_RELEASE
|
||||
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
|
||||
)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
|
||||
|
||||
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||
# prefer the environment variable ASM
|
||||
if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
|
||||
if(NOT $ENV{ASM${ASM_DIALECT}} STREQUAL "")
|
||||
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ else()
|
||||
set(CMAKE_C_COMPILER_INIT NOTFOUND)
|
||||
|
||||
# prefer the environment variable CC
|
||||
if($ENV{CC} MATCHES ".+")
|
||||
if(NOT $ENV{CC} STREQUAL "")
|
||||
get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
|
||||
if(CMAKE_C_FLAGS_ENV_INIT)
|
||||
set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
|
||||
@@ -138,7 +138,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
|
||||
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-)
|
||||
elseif(COMPILER_BASENAME MATCHES "qcc(\\.exe)?$")
|
||||
if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?.*$")
|
||||
if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?")
|
||||
set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
@@ -47,7 +47,7 @@ else()
|
||||
set(CMAKE_CXX_COMPILER_INIT NOTFOUND)
|
||||
|
||||
# prefer the environment variable CXX
|
||||
if($ENV{CXX} MATCHES ".+")
|
||||
if(NOT $ENV{CXX} STREQUAL "")
|
||||
get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
|
||||
if(CMAKE_CXX_FLAGS_ENV_INIT)
|
||||
set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
|
||||
@@ -135,7 +135,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-)
|
||||
elseif(COMPILER_BASENAME MATCHES "QCC(\\.exe)?$")
|
||||
if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?.*$")
|
||||
if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?")
|
||||
set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2013 Stephen Kelly <steveire@gmail.com>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
function(cmake_determine_compile_features lang)
|
||||
|
||||
if(lang STREQUAL CXX AND COMMAND cmake_record_cxx_compile_features)
|
||||
message(STATUS "Detecting ${lang} compile features")
|
||||
|
||||
set(CMAKE_CXX11_COMPILE_FEATURES)
|
||||
|
||||
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
|
||||
|
||||
cmake_record_cxx_compile_features()
|
||||
|
||||
if(NOT _result EQUAL 0)
|
||||
message(STATUS "Detecting ${lang} compile features - failed")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILE_FEATURES)
|
||||
set(CMAKE_CXX_COMPILE_FEATURES
|
||||
${CMAKE_CXX11_COMPILE_FEATURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE)
|
||||
set(CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES} PARENT_SCOPE)
|
||||
|
||||
message(STATUS "Detecting ${lang} compile features - done")
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
@@ -52,11 +52,11 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
|
||||
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
|
||||
file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
|
||||
foreach(info ${ABI_STRINGS})
|
||||
if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
|
||||
string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
|
||||
if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]")
|
||||
set(ABI_SIZEOF_DPTR "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
|
||||
string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
|
||||
if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]")
|
||||
set(ABI_NAME "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
|
||||
else()
|
||||
set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
|
||||
endif()
|
||||
string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
|
||||
string(REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
|
||||
|
||||
# Compute the directory in which to run the test.
|
||||
set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang})
|
||||
@@ -367,35 +367,30 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
|
||||
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 6 REGEX "INFO:")
|
||||
set(COMPILER_ID_TWICE)
|
||||
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
|
||||
if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
|
||||
if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]")
|
||||
if(COMPILER_ID)
|
||||
set(COMPILER_ID_TWICE 1)
|
||||
endif()
|
||||
string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
|
||||
COMPILER_ID "${info}")
|
||||
set(COMPILER_ID "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
|
||||
string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
|
||||
PLATFORM_ID "${info}")
|
||||
if("${info}" MATCHES "INFO:platform\\[([^]\"]*)\\]")
|
||||
set(PLATFORM_ID "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
|
||||
string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
|
||||
ARCHITECTURE_ID "${info}")
|
||||
if("${info}" MATCHES "INFO:arch\\[([^]\"]*)\\]")
|
||||
set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
|
||||
string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
|
||||
string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
|
||||
if("${info}" MATCHES "INFO:compiler_version\\[([^]\"]*)\\]")
|
||||
string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
|
||||
endif()
|
||||
if("${info}" MATCHES ".*INFO:simulate\\[([^]\"]*)\\].*")
|
||||
if("${info}" MATCHES "INFO:simulate\\[([^]\"]*)\\]")
|
||||
set(SIMULATE_ID "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if("${info}" MATCHES ".*INFO:simulate_version\\[([^]\"]*)\\].*")
|
||||
set(SIMULATE_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX REPLACE "^0+([0-9])" "\\1" SIMULATE_VERSION "${SIMULATE_VERSION}")
|
||||
if("${info}" MATCHES "INFO:simulate_version\\[([^]\"]*)\\]")
|
||||
string(REGEX REPLACE "^0+([0-9])" "\\1" SIMULATE_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX REPLACE "\\.0+([0-9])" ".\\1" SIMULATE_VERSION "${SIMULATE_VERSION}")
|
||||
endif()
|
||||
if("${info}" MATCHES ".*INFO:qnxnto")
|
||||
if("${info}" MATCHES "INFO:qnxnto")
|
||||
set(COMPILER_QNXNTO 1)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -32,7 +32,7 @@ elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
|
||||
else()
|
||||
if(NOT CMAKE_Fortran_COMPILER)
|
||||
# prefer the environment variable CC
|
||||
if($ENV{FC} MATCHES ".+")
|
||||
if(NOT $ENV{FC} STREQUAL "")
|
||||
get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
|
||||
if(CMAKE_Fortran_FLAGS_ENV_INIT)
|
||||
set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
|
||||
@@ -130,7 +130,7 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
|
||||
ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
|
||||
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
|
||||
if(NOT CMAKE_COMPILER_RETURN)
|
||||
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||
if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_GNU")
|
||||
set(CMAKE_Fortran_COMPILER_ID "GNU")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the Fortran compiler is GNU succeeded with "
|
||||
@@ -141,10 +141,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
|
||||
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
||||
endif()
|
||||
if(NOT CMAKE_Fortran_PLATFORM_ID)
|
||||
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
|
||||
if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_MINGW")
|
||||
set(CMAKE_Fortran_PLATFORM_ID "MinGW")
|
||||
endif()
|
||||
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
|
||||
if("${CMAKE_COMPILER_OUTPUT}" MATCHES "THIS_IS_CYGWIN")
|
||||
set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
if(NOT CMAKE_Java_COMPILER)
|
||||
# prefer the environment variable CC
|
||||
if($ENV{JAVA_COMPILER} MATCHES ".+")
|
||||
if(NOT $ENV{JAVA_COMPILER} STREQUAL "")
|
||||
get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
||||
if(CMAKE_Java_FLAGS_ENV_INIT)
|
||||
set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
|
||||
@@ -28,14 +28,14 @@ if(NOT CMAKE_Java_COMPILER)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if($ENV{JAVA_RUNTIME} MATCHES ".+")
|
||||
if(NOT $ENV{JAVA_RUNTIME} STREQUAL "")
|
||||
get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
||||
if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
|
||||
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if($ENV{JAVA_ARCHIVE} MATCHES ".+")
|
||||
if(NOT $ENV{JAVA_ARCHIVE} STREQUAL "")
|
||||
get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
||||
if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
|
||||
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# as a default compiler
|
||||
if(NOT CMAKE_RC_COMPILER)
|
||||
# prefer the environment variable RC
|
||||
if($ENV{RC} MATCHES ".+")
|
||||
if(NOT $ENV{RC} STREQUAL "")
|
||||
get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
|
||||
if(CMAKE_RC_FLAGS_ENV_INIT)
|
||||
set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
|
||||
|
||||
@@ -72,8 +72,8 @@ if(CMAKE_HOST_UNIX)
|
||||
endif()
|
||||
set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
|
||||
# processor may have double quote in the name, and that needs to be removed
|
||||
string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
string(REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
string(REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_HOST_WIN32)
|
||||
|
||||
@@ -43,6 +43,13 @@
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
|
||||
message(DEPRECATION
|
||||
"This module is deprecated and should not be used. "
|
||||
"Use the CMAKE_<LANG>_COMPILER_VERSION variable instead."
|
||||
)
|
||||
endif()
|
||||
|
||||
# [INTERNAL]
|
||||
# Please do not call this function directly
|
||||
function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
|
||||
|
||||
@@ -27,7 +27,7 @@ endif()
|
||||
# loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it
|
||||
# creates a file that refuses to load (with comment explaining why).
|
||||
macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
|
||||
if(${SETTINGS_FILE} MATCHES ".+")
|
||||
if(NOT ${SETTINGS_FILE} STREQUAL "")
|
||||
configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
|
||||
${SETTINGS_FILE} @ONLY)
|
||||
else()
|
||||
|
||||
@@ -194,10 +194,10 @@ endif()
|
||||
# Create a static archive incrementally for large object file counts.
|
||||
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
|
||||
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
|
||||
set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
|
||||
set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
|
||||
set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
# This macro used to load build settings from another project that
|
||||
# stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
|
||||
macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
|
||||
if(${SETTINGS_FILE} MATCHES ".+")
|
||||
else()
|
||||
if("${SETTINGS_FILE}" STREQUAL "")
|
||||
message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
@@ -64,10 +64,9 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
|
||||
string(REGEX REPLACE "^-L" "" dir "${arg}")
|
||||
list(APPEND implicit_dirs_tmp ${dir})
|
||||
set(log "${log} arg [${arg}] ==> dir [${dir}]\n")
|
||||
elseif("${arg}" MATCHES "^-l[^:]")
|
||||
elseif("${arg}" MATCHES "^-l([^:].*)$")
|
||||
# Unix library.
|
||||
string(REGEX REPLACE "^-l" "" lib "${arg}")
|
||||
list(APPEND implicit_libs_tmp ${lib})
|
||||
list(APPEND implicit_libs_tmp ${CMAKE_MATCH_1})
|
||||
set(log "${log} arg [${arg}] ==> lib [${lib}]\n")
|
||||
elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.a$")
|
||||
# Unix library full path.
|
||||
@@ -97,11 +96,10 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
|
||||
endif()
|
||||
endforeach()
|
||||
break()
|
||||
elseif("${line}" MATCHES "LPATH(=| is:? )")
|
||||
elseif("${line}" MATCHES "LPATH(=| is:? *)(.*)$")
|
||||
set(log "${log} LPATH line: [${line}]\n")
|
||||
# HP search path.
|
||||
string(REGEX REPLACE ".*LPATH(=| is:? *)" "" paths "${line}")
|
||||
string(REPLACE ":" ";" paths "${paths}")
|
||||
string(REPLACE ":" ";" paths "${CMAKE_MATCH_2}")
|
||||
list(APPEND implicit_dirs_tmp ${paths})
|
||||
set(log "${log} dirs [${paths}]\n")
|
||||
else()
|
||||
|
||||
@@ -74,6 +74,23 @@
|
||||
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||
# define PLATFORM_ID "Xenix"
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__LINUX__)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
# elif defined(__DOS__)
|
||||
# define PLATFORM_ID "DOS"
|
||||
|
||||
# elif defined(__OS2__)
|
||||
# define PLATFORM_ID "OS2"
|
||||
|
||||
# elif defined(__WINDOWS__)
|
||||
# define PLATFORM_ID "Windows3x"
|
||||
|
||||
# else /* unknown platform */
|
||||
# define PLATFORM_ID ""
|
||||
# endif
|
||||
|
||||
#else /* unknown platform */
|
||||
# define PLATFORM_ID ""
|
||||
|
||||
@@ -107,6 +124,17 @@
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(_M_I86)
|
||||
# define ARCHITECTURE_ID "I86"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#else
|
||||
# define ARCHITECTURE_ID ""
|
||||
#endif
|
||||
|
||||
@@ -53,6 +53,7 @@ macro(CMAKE_RESET_CHECK_STATE)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CMAKE_REQUIRED_FLAGS)
|
||||
set(CMAKE_REQUIRED_QUIET)
|
||||
|
||||
endmacro()
|
||||
|
||||
@@ -68,6 +69,7 @@ macro(CMAKE_PUSH_CHECK_STATE)
|
||||
set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
|
||||
set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
|
||||
set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
|
||||
set(_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_QUIET})
|
||||
|
||||
if (ARGC GREATER 0 AND ARGV0 STREQUAL "RESET")
|
||||
cmake_reset_check_state()
|
||||
@@ -84,6 +86,7 @@ macro(CMAKE_POP_CHECK_STATE)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||
set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||
set(CMAKE_REQUIRED_QUIET ${_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||
|
||||
math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
|
||||
endif()
|
||||
|
||||
@@ -66,6 +66,9 @@ else()
|
||||
# Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
|
||||
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
|
||||
CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
|
||||
# Try to identify the compiler features
|
||||
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompileFeatures.cmake)
|
||||
CMAKE_DETERMINE_COMPILE_FEATURES(CXX)
|
||||
|
||||
# Re-configure to save learned information.
|
||||
configure_file(
|
||||
|
||||
+13
-2
@@ -67,7 +67,12 @@
|
||||
# * Mandatory : YES
|
||||
# * Default : 'devel'
|
||||
#
|
||||
# The debian package section
|
||||
# .. variable:: CPACK_DEBIAN_COMPRESSION_TYPE
|
||||
#
|
||||
# * Mandatory : YES
|
||||
# * Default : 'gzip'
|
||||
#
|
||||
# Possible values are: lzma, xz, bzip2 and gzip.
|
||||
#
|
||||
# .. variable:: CPACK_DEBIAN_PACKAGE_PRIORITY
|
||||
#
|
||||
@@ -254,7 +259,7 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
||||
OUTPUT_VARIABLE CPACK_DEB_INSTALL_FILES)
|
||||
|
||||
# Convert to CMake list
|
||||
string(REGEX REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES})
|
||||
string(REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES})
|
||||
|
||||
# Only dynamically linked ELF files are included
|
||||
# Extract only file name infront of ":"
|
||||
@@ -390,6 +395,12 @@ if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
endif()
|
||||
|
||||
# Compression: (recommended)
|
||||
if(NOT CPACK_DEBIAN_COMPRESSION_TYPE)
|
||||
set(CPACK_DEBIAN_COMPRESSION_TYPE "gzip")
|
||||
endif()
|
||||
|
||||
|
||||
# Recommends:
|
||||
# You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ if(CPACK_RPM_PACKAGE_DEBUG)
|
||||
OUTPUT_VARIABLE _TMP_LSB_RELEASE_OUTPUT
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "\n" ", "
|
||||
string(REPLACE "\n" ", "
|
||||
LSB_RELEASE_OUTPUT
|
||||
${_TMP_LSB_RELEASE_OUTPUT})
|
||||
else ()
|
||||
@@ -397,7 +397,7 @@ endif()
|
||||
# to shut down warning about space in buildtree
|
||||
# some recent RPM version should support space in different places.
|
||||
# not checked [yet].
|
||||
if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
|
||||
if(CPACK_TOPLEVEL_DIRECTORY MATCHES " ")
|
||||
message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
|
||||
endif()
|
||||
|
||||
|
||||
+16
-1
@@ -216,9 +216,24 @@
|
||||
# allow other CMake projects to find your package with
|
||||
# the :command:`find_package` command.
|
||||
#
|
||||
# .. variable:: CPACK_WIX_PROPERTY_<PROPERTY>
|
||||
#
|
||||
# This variable can be used to provide a value for
|
||||
# the Windows Installer property ``<PROPERTY>``
|
||||
#
|
||||
# The follwing list contains some example properties that can be used to
|
||||
# customize information under
|
||||
# "Programs and Features" (also known as "Add or Remove Programs")
|
||||
#
|
||||
# * ARPCOMMENTS - Comments
|
||||
# * ARPHELPLINK - Help and support information URL
|
||||
# * ARPURLINFOABOUT - General information URL
|
||||
# * URLUPDATEINFO - Update information URL
|
||||
# * ARPHELPTELEPHONE - Help and support telephone number
|
||||
# * ARPSIZE - Size (in kilobytes) of the application
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2013 Kitware, Inc.
|
||||
# Copyright 2014 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
@@ -67,7 +68,9 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
||||
"${SOURCE}\n")
|
||||
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
endif()
|
||||
try_compile(${VAR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||
@@ -85,13 +88,17 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||
|
||||
if(${VAR})
|
||||
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
else()
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
endif()
|
||||
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
@@ -56,7 +57,9 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
||||
"${SOURCE}\n")
|
||||
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
endif()
|
||||
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||
@@ -73,7 +76,9 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||
# if the return value was 0 then it worked
|
||||
if("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
@@ -86,7 +91,9 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
@@ -68,7 +69,9 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
|
||||
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
|
||||
"${SOURCE}\n")
|
||||
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
endif()
|
||||
try_compile(${VAR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
|
||||
@@ -86,13 +89,17 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
|
||||
|
||||
if(${VAR})
|
||||
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
else()
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
endif()
|
||||
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
@@ -56,7 +57,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
|
||||
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
|
||||
"${SOURCE}\n")
|
||||
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
endif()
|
||||
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
|
||||
@@ -74,7 +77,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
|
||||
# if the return value was 0 then it worked
|
||||
if("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
@@ -87,7 +92,9 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
|
||||
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2003-2011 Kitware, Inc.
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2011 Kitware, Inc.
|
||||
@@ -40,7 +41,9 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
|
||||
if("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
|
||||
message(STATUS "Looking for ${FUNCTION}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${FUNCTION}")
|
||||
endif()
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
|
||||
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||
@@ -63,12 +66,16 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(${VARIABLE})
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
|
||||
message(STATUS "Looking for ${FUNCTION} - found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${FUNCTION} - found")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the function ${FUNCTION} exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
message(STATUS "Looking for ${FUNCTION} - not found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${FUNCTION} - not found")
|
||||
endif()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the function ${FUNCTION} exists failed with the following output:\n"
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2009 Kitware, Inc.
|
||||
@@ -49,7 +50,9 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
|
||||
set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
|
||||
configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c)
|
||||
message(STATUS "Looking for ${INCLUDE}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${INCLUDE}")
|
||||
endif()
|
||||
if(${ARGC} EQUAL 3)
|
||||
set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
|
||||
@@ -69,14 +72,18 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
|
||||
endif()
|
||||
|
||||
if(${VARIABLE})
|
||||
message(STATUS "Looking for ${INCLUDE} - found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${INCLUDE} - found")
|
||||
endif()
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the include file ${INCLUDE} "
|
||||
"exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
message(STATUS "Looking for ${INCLUDE} - not found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${INCLUDE} - not found")
|
||||
endif()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the include file ${INCLUDE} "
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2009 Kitware, Inc.
|
||||
@@ -53,7 +54,9 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
|
||||
set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
|
||||
configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
|
||||
message(STATUS "Looking for C++ include ${INCLUDE}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for C++ include ${INCLUDE}")
|
||||
endif()
|
||||
if(${ARGC} EQUAL 3)
|
||||
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
|
||||
@@ -73,14 +76,18 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
|
||||
endif()
|
||||
|
||||
if(${VARIABLE})
|
||||
message(STATUS "Looking for C++ include ${INCLUDE} - found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for C++ include ${INCLUDE} - found")
|
||||
endif()
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the include file ${INCLUDE} "
|
||||
"exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
message(STATUS "Looking for C++ include ${INCLUDE} - not found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for C++ include ${INCLUDE} - not found")
|
||||
endif()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the include file ${INCLUDE} "
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2003-2012 Kitware, Inc.
|
||||
@@ -66,7 +67,9 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
|
||||
set(_description "include file ${_INCLUDE}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Looking for ${_description}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${_description}")
|
||||
endif()
|
||||
try_compile(${VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
|
||||
@@ -76,14 +79,18 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
|
||||
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(${VARIABLE})
|
||||
message(STATUS "Looking for ${_description} - found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${_description} - found")
|
||||
endif()
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if files ${INCLUDE} "
|
||||
"exist passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
message(STATUS "Looking for ${_description} - not found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${_description} - not found")
|
||||
endif()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if files ${INCLUDE} "
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2009 Kitware, Inc.
|
||||
@@ -43,7 +44,9 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
|
||||
if("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||
set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
|
||||
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
|
||||
endif()
|
||||
set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_LIBRARY_EXISTS_LIBRARIES
|
||||
@@ -60,14 +63,18 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
|
||||
if(${VARIABLE})
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
|
||||
endif()
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
|
||||
"passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
|
||||
endif()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
@@ -97,12 +98,16 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
|
||||
|
||||
if (${_VARIABLE})
|
||||
set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
|
||||
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else ()
|
||||
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
|
||||
endif()
|
||||
set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2003-2011 Kitware, Inc.
|
||||
@@ -74,7 +75,9 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
|
||||
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
|
||||
"${SOURCEFILE}" @ONLY)
|
||||
|
||||
message(STATUS "Looking for ${SYMBOL}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${SYMBOL}")
|
||||
endif()
|
||||
try_compile(${VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
"${SOURCEFILE}"
|
||||
@@ -85,7 +88,9 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
|
||||
"${CMAKE_SYMBOL_EXISTS_INCLUDES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(${VARIABLE})
|
||||
message(STATUS "Looking for ${SYMBOL} - found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${SYMBOL} - found")
|
||||
endif()
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the ${SYMBOL} "
|
||||
@@ -93,7 +98,9 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
|
||||
"${OUTPUT}\nFile ${SOURCEFILE}:\n"
|
||||
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
|
||||
else()
|
||||
message(STATUS "Looking for ${SYMBOL} - not found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${SYMBOL} - not found")
|
||||
endif()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the ${SYMBOL} "
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
# CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
|
||||
|
||||
#=============================================================================
|
||||
@@ -75,6 +76,7 @@
|
||||
# License text for the above reference.)
|
||||
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
cmake_policy(PUSH)
|
||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||
@@ -84,7 +86,9 @@ get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
#-----------------------------------------------------------------------------
|
||||
# Helper function. DO NOT CALL DIRECTLY.
|
||||
function(__check_type_size_impl type var map builtin language)
|
||||
message(STATUS "Check size of ${type}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Check size of ${type}")
|
||||
endif()
|
||||
|
||||
# Include header files.
|
||||
set(headers)
|
||||
@@ -138,7 +142,7 @@ function(__check_type_size_impl type var map builtin language)
|
||||
foreach(info ${strings})
|
||||
if("${info}" MATCHES "${regex_size}")
|
||||
# Get the type size.
|
||||
string(REGEX REPLACE "${regex_size}" "\\1" size "${info}")
|
||||
set(size "${CMAKE_MATCH_1}")
|
||||
if(first)
|
||||
set(${var} ${size})
|
||||
elseif(NOT "${size}" STREQUAL "${${var}}")
|
||||
@@ -168,13 +172,17 @@ function(__check_type_size_impl type var map builtin language)
|
||||
message(SEND_ERROR "CHECK_TYPE_SIZE found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
|
||||
endif()
|
||||
|
||||
message(STATUS "Check size of ${type} - done")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Check size of ${type} - done")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining size of ${type} passed with the following output:\n${output}\n\n")
|
||||
set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})")
|
||||
else()
|
||||
# The check failed to compile.
|
||||
message(STATUS "Check size of ${type} - failed")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Check size of ${type} - failed")
|
||||
endif()
|
||||
file(READ ${src} content)
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
|
||||
@@ -218,9 +226,15 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
|
||||
set(_builtin 0)
|
||||
else()
|
||||
set(_builtin 1)
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(stddef.h HAVE_STDDEF_H)
|
||||
if("${_language}" STREQUAL "C")
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(stddef.h HAVE_STDDEF_H)
|
||||
elseif("${_language}" STREQUAL "CXX")
|
||||
check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file_cxx(stdint.h HAVE_STDINT_H)
|
||||
check_include_file_cxx(stddef.h HAVE_STDDEF_H)
|
||||
endif()
|
||||
endif()
|
||||
unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY)
|
||||
unset(_CHECK_TYPE_SIZE_LANGUAGE)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
# CMAKE_REQUIRED_QUIET = execute quietly without messages
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2009 Kitware, Inc.
|
||||
@@ -47,7 +48,9 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
|
||||
if("${VARIABLE}" MATCHES "^${VARIABLE}$")
|
||||
set(MACRO_CHECK_VARIABLE_DEFINITIONS
|
||||
"-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||
message(STATUS "Looking for ${VAR}")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${VAR}")
|
||||
endif()
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
|
||||
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||
@@ -63,13 +66,17 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(${VARIABLE})
|
||||
set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
|
||||
message(STATUS "Looking for ${VAR} - found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${VAR} - found")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining if the variable ${VAR} exists passed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
else()
|
||||
set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
|
||||
message(STATUS "Looking for ${VAR} - not found")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Looking for ${VAR} - not found")
|
||||
endif()
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining if the variable ${VAR} exists failed with the following output:\n"
|
||||
"${OUTPUT}\n\n")
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
include(Compiler/Clang-CXX)
|
||||
include(Compiler/Clang)
|
||||
__compiler_clang(CXX)
|
||||
|
||||
if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
|
||||
endif()
|
||||
|
||||
@@ -4,3 +4,21 @@ __compiler_clang(CXX)
|
||||
if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
|
||||
endif()
|
||||
|
||||
cmake_policy(GET CMP0025 appleClangPolicy)
|
||||
if(NOT appleClangPolicy STREQUAL NEW)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
|
||||
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
|
||||
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
|
||||
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
|
||||
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
|
||||
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
|
||||
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
# Reference: http://gcc.gnu.org/projects/cxx0x.html
|
||||
|
||||
set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408")
|
||||
# Introduced in GCC 4.8.1
|
||||
set(GNU481_CXX11 "((__GNUC__ * 100 + __GNUC_MINOR__) > 408 || __GNUC_PATCHLEVEL__ >= 1) && __cplusplus >= 201103L")
|
||||
set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${GNU481_CXX11}")
|
||||
set(_cmake_feature_test_cxx_reference_qualified_functions "${GNU481_CXX11}")
|
||||
set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L")
|
||||
set(_cmake_feature_test_cxx_alignas "${GNU48_CXX11}")
|
||||
set(_cmake_feature_test_cxx_alignof "${GNU48_CXX11}")
|
||||
set(_cmake_feature_test_cxx_attributes "${GNU48_CXX11}")
|
||||
set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
|
||||
set(_cmake_feature_test_cxx_thread_local "${GNU48_CXX11}")
|
||||
# TODO: Should be supported by GNU 4.7
|
||||
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||
set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
|
||||
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
|
||||
set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}")
|
||||
set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
|
||||
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")
|
||||
set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}")
|
||||
set(_cmake_feature_test_cxx_override "${GNU47_CXX11}")
|
||||
set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}")
|
||||
# NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
|
||||
# release following that (March 2012), and the first minor release to
|
||||
# support -std=c++11. Prior to that, support for C++11 features is technically
|
||||
# experiemental and possibly incomplete (see for example the note below about
|
||||
# cxx_variadic_template_template_parameters)
|
||||
# TODO: Should be supported by GNU 4.6
|
||||
set(GNU46_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||
set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
|
||||
set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}")
|
||||
set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}")
|
||||
set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}")
|
||||
set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}")
|
||||
set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}")
|
||||
# TODO: Should be supported by GNU 4.5
|
||||
set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
|
||||
set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}")
|
||||
set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}")
|
||||
set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}")
|
||||
# TODO: Should be supported by GNU 4.4
|
||||
set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||
set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_inline_namespaces "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_sizeof_member "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")
|
||||
# TODO: If features are ever recorded for GNU 4.3, there should possibly
|
||||
# be a new feature added like cxx_variadic_template_template_parameters,
|
||||
# which is implemented by GNU 4.4, but not 4.3. cxx_variadic_templates is
|
||||
# actually implemented by GNU 4.3, but variadic template template parameters
|
||||
# 'completes' it, so that is the version we record as having the variadic
|
||||
# templates capability in CMake. See
|
||||
# http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
|
||||
# TODO: Should be supported by GNU 4.3
|
||||
set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||
set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
|
||||
set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}")
|
||||
set(_cmake_feature_test_cxx_long_long_type "${GNU43_CXX11}")
|
||||
set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
|
||||
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
|
||||
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
|
||||
# TODO: Should be supported since GNU 3.4?
|
||||
set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
|
||||
# TODO: Should be supported forever?
|
||||
set(_cmake_feature_test_cxx_func_identifier "${_oldestSupported} && __cplusplus >= 201103L")
|
||||
set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L")
|
||||
set(_oldestSupported)
|
||||
@@ -10,3 +10,28 @@ else()
|
||||
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
|
||||
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
|
||||
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
||||
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
|
||||
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
|
||||
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
|
||||
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
|
||||
endif()
|
||||
|
||||
macro(cmake_record_cxx_compile_features)
|
||||
macro(_get_gcc_features std_version list)
|
||||
record_compiler_features(CXX "-std=${std_version}" ${list})
|
||||
endmacro()
|
||||
|
||||
if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
|
||||
_get_gcc_features(c++11 CMAKE_CXX11_COMPILE_FEATURES)
|
||||
else()
|
||||
set(_result 0)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
+33
-21
@@ -292,8 +292,7 @@ function(ExternalData_expand_arguments target outArgsVar)
|
||||
foreach(piece IN LISTS pieces)
|
||||
if("x${piece}" MATCHES "^x${data_regex}$")
|
||||
# Replace this DATA{}-piece with a file path.
|
||||
string(REGEX REPLACE "${data_regex}" "\\1" data "${piece}")
|
||||
_ExternalData_arg("${target}" "${piece}" "${data}" file)
|
||||
_ExternalData_arg("${target}" "${piece}" "${CMAKE_MATCH_1}" file)
|
||||
set(outArg "${outArg}${file}")
|
||||
else()
|
||||
# No replacement needed for this piece.
|
||||
@@ -422,16 +421,16 @@ function(_ExternalData_arg target arg options var_file)
|
||||
set(external "") # Entries external to the source tree.
|
||||
set(internal "") # Entries internal to the source tree.
|
||||
set(have_original ${data_is_directory})
|
||||
set(have_original_as_dir 0)
|
||||
|
||||
# Process options.
|
||||
set(series_option "")
|
||||
set(associated_files "")
|
||||
set(associated_regex "")
|
||||
foreach(opt ${options})
|
||||
if("x${opt}" MATCHES "^xREGEX:[^:/]+$")
|
||||
# Regular expression to match associated files.
|
||||
string(REGEX REPLACE "^REGEX:" "" regex "${opt}")
|
||||
list(APPEND associated_regex "${regex}")
|
||||
# Regular expression to match associated files.
|
||||
if("x${opt}" MATCHES "^xREGEX:([^:/]+)$")
|
||||
list(APPEND associated_regex "${CMAKE_MATCH_1}")
|
||||
elseif(opt STREQUAL ":")
|
||||
# Activate series matching.
|
||||
set(series_option "${opt}")
|
||||
@@ -472,11 +471,18 @@ function(_ExternalData_arg target arg options var_file)
|
||||
endif()
|
||||
|
||||
if(NOT have_original)
|
||||
message(FATAL_ERROR "Data file referenced by argument\n"
|
||||
if(have_original_as_dir)
|
||||
set(msg_kind FATAL_ERROR)
|
||||
set(msg "that is directory instead of a file!")
|
||||
else()
|
||||
set(msg_kind AUTHOR_WARNING)
|
||||
set(msg "that does not exist as a file (with or without an extension)!")
|
||||
endif()
|
||||
message(${msg_kind} "Data file referenced by argument\n"
|
||||
" ${arg}\n"
|
||||
"corresponds to source tree path\n"
|
||||
" ${reldata}\n"
|
||||
"that does not exist as a file (with or without an extension)!")
|
||||
"${msg}")
|
||||
endif()
|
||||
|
||||
if(external)
|
||||
@@ -593,27 +599,33 @@ function(_ExternalData_arg_find_files pattern regex)
|
||||
set(alg "")
|
||||
endif()
|
||||
if("x${relname}" MATCHES "^x${regex}$" # matches
|
||||
AND NOT IS_DIRECTORY "${top_src}/${entry}" # not a directory
|
||||
AND NOT "x${relname}" MATCHES "(^x|/)\\.ExternalData_" # not staged obj
|
||||
)
|
||||
set(name "${top_src}/${relname}")
|
||||
set(file "${top_bin}/${relname}")
|
||||
if(alg)
|
||||
list(APPEND external "${file}|${name}|${alg}")
|
||||
elseif(ExternalData_LINK_CONTENT)
|
||||
_ExternalData_link_content("${name}" alg)
|
||||
list(APPEND external "${file}|${name}|${alg}")
|
||||
elseif(NOT top_same)
|
||||
list(APPEND internal "${file}|${name}")
|
||||
endif()
|
||||
if("${relname}" STREQUAL "${reldata}")
|
||||
set(have_original 1)
|
||||
if(IS_DIRECTORY "${top_src}/${entry}")
|
||||
if("${relname}" STREQUAL "${reldata}")
|
||||
set(have_original_as_dir 1)
|
||||
endif()
|
||||
else()
|
||||
set(name "${top_src}/${relname}")
|
||||
set(file "${top_bin}/${relname}")
|
||||
if(alg)
|
||||
list(APPEND external "${file}|${name}|${alg}")
|
||||
elseif(ExternalData_LINK_CONTENT)
|
||||
_ExternalData_link_content("${name}" alg)
|
||||
list(APPEND external "${file}|${name}|${alg}")
|
||||
elseif(NOT top_same)
|
||||
list(APPEND internal "${file}|${name}")
|
||||
endif()
|
||||
if("${relname}" STREQUAL "${reldata}")
|
||||
set(have_original 1)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
set(external "${external}" PARENT_SCOPE)
|
||||
set(internal "${internal}" PARENT_SCOPE)
|
||||
set(have_original "${have_original}" PARENT_SCOPE)
|
||||
set(have_original_as_dir "${have_original_as_dir}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
+148
-24
@@ -16,10 +16,12 @@
|
||||
# [LIST_SEPARATOR sep] # Sep to be replaced by ; in cmd lines
|
||||
# [TMP_DIR dir] # Directory to store temporary files
|
||||
# [STAMP_DIR dir] # Directory to store step timestamps
|
||||
# [EXCLUDE_FROM_ALL 1] # The "all" target does not depend on this
|
||||
# #--Download step--------------
|
||||
# [DOWNLOAD_NAME fname] # File name to store (if not end of URL)
|
||||
# [DOWNLOAD_DIR dir] # Directory to store downloaded files
|
||||
# [DOWNLOAD_COMMAND cmd...] # Command to download source tree
|
||||
# [DOWNLOAD_NO_PROGRESS 1] # Disable download progress reports
|
||||
# [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository
|
||||
# [CVS_MODULE mod] # Module to checkout from CVS repo
|
||||
# [CVS_TAG tag] # Tag to checkout from CVS repo
|
||||
@@ -54,6 +56,7 @@
|
||||
# [BINARY_DIR dir] # Specify build dir location
|
||||
# [BUILD_COMMAND cmd...] # Command to drive the native build
|
||||
# [BUILD_IN_SOURCE 1] # Use source dir for build dir
|
||||
# [BUILD_ALWAYS 1] # No stamp file, build step always runs
|
||||
# #--Install step---------------
|
||||
# [INSTALL_DIR dir] # Installation prefix
|
||||
# [INSTALL_COMMAND cmd...] # Command to drive install after build
|
||||
@@ -117,6 +120,7 @@
|
||||
# [DEPENDERS steps...] # Steps that depend on this step
|
||||
# [DEPENDS files...] # Files on which this step depends
|
||||
# [ALWAYS 1] # No stamp file, step always runs
|
||||
# [EXCLUDE_FROM_MAIN 1] # Main target does not depend on this step
|
||||
# [WORKING_DIRECTORY dir] # Working directory for command
|
||||
# [LOG 1] # Wrap step in script to log output
|
||||
# )
|
||||
@@ -197,11 +201,11 @@ file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines
|
||||
LIMIT_COUNT ${_ep_documentation_line_count}
|
||||
REGEX "^# ( \\[[A-Z0-9_]+ [^]]*\\] +#.*$|[A-Za-z0-9_]+\\()")
|
||||
foreach(line IN LISTS lines)
|
||||
if("${line}" MATCHES "^# [A-Za-z0-9_]+\\(")
|
||||
if("${line}" MATCHES "^# ([A-Za-z0-9_]+)\\(")
|
||||
if(_ep_func)
|
||||
set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}})$")
|
||||
endif()
|
||||
string(REGEX REPLACE "^# ([A-Za-z0-9_]+)\\(.*" "\\1" _ep_func "${line}")
|
||||
set(_ep_func "${CMAKE_MATCH_1}")
|
||||
#message("function [${_ep_func}]")
|
||||
set(_ep_keywords_${_ep_func} "^(")
|
||||
set(_ep_keyword_sep)
|
||||
@@ -452,6 +456,7 @@ execute_process(
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
OUTPUT_VARIABLE head_sha
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR \"Failed to get the hash for HEAD\")
|
||||
@@ -470,6 +475,17 @@ else()
|
||||
set(is_remote_ref 0)
|
||||
endif()
|
||||
|
||||
# Tag is in the form <remote>/<tag> (i.e. origin/master) we must strip
|
||||
# the remote from the tag.
|
||||
if(\"\${show_ref_output}\" MATCHES \"refs/remotes/${git_tag}\")
|
||||
string(REGEX MATCH \"^([^/]+)/(.+)$\" _unused \"${git_tag}\")
|
||||
set(git_remote \"\${CMAKE_MATCH_1}\")
|
||||
set(git_tag \"\${CMAKE_MATCH_2}\")
|
||||
else()
|
||||
set(git_remote \"origin\")
|
||||
set(git_tag \"${git_tag}\")
|
||||
endif()
|
||||
|
||||
# This will fail if the tag does not exist (it probably has not been fetched
|
||||
# yet).
|
||||
execute_process(
|
||||
@@ -477,6 +493,7 @@ execute_process(
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
OUTPUT_VARIABLE tag_sha
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Is the hash checkout out that we want?
|
||||
@@ -490,13 +507,94 @@ if(error_code OR is_remote_ref OR NOT (\"\${tag_sha}\" STREQUAL \"\${head_sha}\"
|
||||
message(FATAL_ERROR \"Failed to fetch repository '${git_repository}'\")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR \"Failed to checkout tag: '${git_tag}'\")
|
||||
if(is_remote_ref)
|
||||
# Check if stash is needed
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" status --porcelain
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
OUTPUT_VARIABLE repo_status
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR \"Failed to get the status\")
|
||||
endif()
|
||||
string(LENGTH \"\${repo_status}\" need_stash)
|
||||
|
||||
# If not in clean state, stash changes in order to be able to be able to
|
||||
# perform git pull --rebase
|
||||
if(need_stash)
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" stash save --all --quiet
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR \"Failed to stash changes\")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Pull changes from the remote branch
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" rebase \${git_remote}/\${git_tag}
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
# Rebase failed: Restore previous state.
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" rebase --abort
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
)
|
||||
if(need_stash)
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" stash pop --index --quiet
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
)
|
||||
endif()
|
||||
message(FATAL_ERROR \"\\nFailed to rebase in: '${work_dir}/${src_name}'.\\nYou will have to resolve the conflicts manually\")
|
||||
endif()
|
||||
|
||||
if(need_stash)
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" stash pop --index --quiet
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
# Stash pop --index failed: Try again dropping the index
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" reset --hard --quiet
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" stash pop --quiet
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
# Stash pop failed: Restore previous state.
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" reset --hard --quiet \${head_sha}
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
)
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" stash pop --index --quiet
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
)
|
||||
message(FATAL_ERROR \"\\nFailed to unstash changes in: '${work_dir}/${src_name}'.\\nYou will have to resolve the conflicts manually\")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
|
||||
WORKING_DIRECTORY \"${work_dir}\"
|
||||
RESULT_VARIABLE error_code
|
||||
)
|
||||
if(error_code)
|
||||
message(FATAL_ERROR \"Failed to checkout tag: '${git_tag}'\")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
@@ -514,7 +612,7 @@ endif()
|
||||
|
||||
endfunction(_ep_write_gitupdate_script)
|
||||
|
||||
function(_ep_write_downloadfile_script script_filename remote local timeout hash tls_verify tls_cainfo)
|
||||
function(_ep_write_downloadfile_script script_filename remote local timeout no_progress hash tls_verify tls_cainfo)
|
||||
if(timeout)
|
||||
set(timeout_args TIMEOUT ${timeout})
|
||||
set(timeout_msg "${timeout} seconds")
|
||||
@@ -523,6 +621,12 @@ function(_ep_write_downloadfile_script script_filename remote local timeout hash
|
||||
set(timeout_msg "none")
|
||||
endif()
|
||||
|
||||
if(no_progress)
|
||||
set(show_progress "")
|
||||
else()
|
||||
set(show_progress "SHOW_PROGRESS")
|
||||
endif()
|
||||
|
||||
if("${hash}" MATCHES "${_ep_hash_regex}")
|
||||
set(hash_args EXPECTED_HASH ${CMAKE_MATCH_1}=${CMAKE_MATCH_2})
|
||||
else()
|
||||
@@ -562,7 +666,7 @@ ${tls_cainfo}
|
||||
file(DOWNLOAD
|
||||
\"${remote}\"
|
||||
\"${local}\"
|
||||
SHOW_PROGRESS
|
||||
${show_progress}
|
||||
${hash_args}
|
||||
${timeout_args}
|
||||
STATUS status
|
||||
@@ -803,7 +907,8 @@ function(_ep_write_initial_cache target_name script_filename args)
|
||||
set(regex "^([^:]+):([^=]+)=(.*)$")
|
||||
set(setArg "")
|
||||
foreach(line ${args})
|
||||
if("${line}" MATCHES "^-D")
|
||||
if("${line}" MATCHES "^-D(.*)")
|
||||
set(line "${CMAKE_MATCH_1}")
|
||||
if(setArg)
|
||||
# This is required to build up lists in variables, or complete an entry
|
||||
set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)")
|
||||
@@ -811,9 +916,7 @@ function(_ep_write_initial_cache target_name script_filename args)
|
||||
set(accumulator "")
|
||||
set(setArg "")
|
||||
endif()
|
||||
string(REGEX REPLACE "^-D" "" line ${line})
|
||||
if("${line}" MATCHES "${regex}")
|
||||
string(REGEX MATCH "${regex}" match "${line}")
|
||||
set(name "${CMAKE_MATCH_1}")
|
||||
set(type "${CMAKE_MATCH_2}")
|
||||
set(value "${CMAKE_MATCH_3}")
|
||||
@@ -1090,14 +1193,17 @@ function(ExternalProject_Add_Step name step)
|
||||
set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete")
|
||||
_ep_get_step_stampfile(${name} ${step} stamp_file)
|
||||
|
||||
add_custom_command(APPEND
|
||||
OUTPUT ${complete_stamp_file}
|
||||
DEPENDS ${stamp_file}
|
||||
)
|
||||
|
||||
_ep_parse_arguments(ExternalProject_Add_Step
|
||||
${name} _EP_${step}_ "${ARGN}")
|
||||
|
||||
get_property(exclude_from_main TARGET ${name} PROPERTY _EP_${step}_EXCLUDE_FROM_MAIN)
|
||||
if(NOT exclude_from_main)
|
||||
add_custom_command(APPEND
|
||||
OUTPUT ${complete_stamp_file}
|
||||
DEPENDS ${stamp_file}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Steps depending on this step.
|
||||
get_property(dependers TARGET ${name} PROPERTY _EP_${step}_DEPENDERS)
|
||||
foreach(depender IN LISTS dependers)
|
||||
@@ -1245,7 +1351,7 @@ function(_ep_add_download_command name)
|
||||
if(cmd_set)
|
||||
set(work_dir ${download_dir})
|
||||
elseif(cvs_repository)
|
||||
find_package(CVS)
|
||||
find_package(CVS QUIET)
|
||||
if(NOT CVS_EXECUTABLE)
|
||||
message(FATAL_ERROR "error: could not find cvs for checkout of ${name}")
|
||||
endif()
|
||||
@@ -1272,7 +1378,7 @@ function(_ep_add_download_command name)
|
||||
set(cmd ${CVS_EXECUTABLE} -d ${cvs_repository} -q co ${cvs_tag} -d ${src_name} ${cvs_module})
|
||||
list(APPEND depends ${stamp_dir}/${name}-cvsinfo.txt)
|
||||
elseif(svn_repository)
|
||||
find_package(Subversion)
|
||||
find_package(Subversion QUIET)
|
||||
if(NOT Subversion_SVN_EXECUTABLE)
|
||||
message(FATAL_ERROR "error: could not find svn for checkout of ${name}")
|
||||
endif()
|
||||
@@ -1308,7 +1414,7 @@ function(_ep_add_download_command name)
|
||||
--non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name})
|
||||
list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
|
||||
elseif(git_repository)
|
||||
find_package(Git)
|
||||
find_package(Git QUIET)
|
||||
if(NOT GIT_EXECUTABLE)
|
||||
message(FATAL_ERROR "error: could not find git for clone of ${name}")
|
||||
endif()
|
||||
@@ -1356,7 +1462,7 @@ function(_ep_add_download_command name)
|
||||
set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake)
|
||||
list(APPEND depends ${stamp_dir}/${name}-gitinfo.txt)
|
||||
elseif(hg_repository)
|
||||
find_package(Hg)
|
||||
find_package(Hg QUIET)
|
||||
if(NOT HG_EXECUTABLE)
|
||||
message(FATAL_ERROR "error: could not find hg for clone of ${name}")
|
||||
endif()
|
||||
@@ -1442,10 +1548,11 @@ function(_ep_add_download_command name)
|
||||
string(REPLACE ";" "-" fname "${fname}")
|
||||
set(file ${download_dir}/${fname})
|
||||
get_property(timeout TARGET ${name} PROPERTY _EP_TIMEOUT)
|
||||
get_property(no_progress TARGET ${name} PROPERTY _EP_DOWNLOAD_NO_PROGRESS)
|
||||
get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
|
||||
get_property(tls_cainfo TARGET ${name} PROPERTY _EP_TLS_CAINFO)
|
||||
set(download_script "${stamp_dir}/download-${name}.cmake")
|
||||
_ep_write_downloadfile_script("${download_script}" "${url}" "${file}" "${timeout}" "${hash}" "${tls_verify}" "${tls_cainfo}")
|
||||
_ep_write_downloadfile_script("${download_script}" "${url}" "${file}" "${timeout}" "${no_progress}" "${hash}" "${tls_verify}" "${tls_cainfo}")
|
||||
set(cmd ${CMAKE_COMMAND} -P "${download_script}"
|
||||
COMMAND)
|
||||
set(retries 3)
|
||||
@@ -1716,10 +1823,18 @@ function(_ep_add_build_command name)
|
||||
set(log "")
|
||||
endif()
|
||||
|
||||
get_property(build_always TARGET ${name} PROPERTY _EP_BUILD_ALWAYS)
|
||||
if(build_always)
|
||||
set(always 1)
|
||||
else()
|
||||
set(always 0)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add_Step(${name} build
|
||||
COMMAND ${cmd}
|
||||
WORKING_DIRECTORY ${binary_dir}
|
||||
DEPENDEES configure
|
||||
ALWAYS ${always}
|
||||
${log}
|
||||
)
|
||||
endfunction()
|
||||
@@ -1798,6 +1913,9 @@ function(ExternalProject_Add name)
|
||||
set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles)
|
||||
set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete")
|
||||
|
||||
# The "ALL" option to add_custom_target just tells it to not set the
|
||||
# EXCLUDE_FROM_ALL target property. Later, if the EXCLUDE_FROM_ALL
|
||||
# argument was passed, we explicitly set it for the target.
|
||||
add_custom_target(${name} ALL DEPENDS ${complete_stamp_file})
|
||||
set_property(TARGET ${name} PROPERTY _EP_IS_EXTERNAL_PROJECT 1)
|
||||
_ep_parse_arguments(ExternalProject_Add ${name} _EP_ "${ARGN}")
|
||||
@@ -1805,6 +1923,12 @@ function(ExternalProject_Add name)
|
||||
_ep_get_step_stampfile(${name} "done" done_stamp_file)
|
||||
_ep_get_step_stampfile(${name} "install" install_stamp_file)
|
||||
|
||||
# Set the EXCLUDE_FROM_ALL target property if required.
|
||||
get_property(exclude_from_all TARGET ${name} PROPERTY _EP_EXCLUDE_FROM_ALL)
|
||||
if(exclude_from_all)
|
||||
set_property(TARGET ${name} PROPERTY EXCLUDE_FROM_ALL TRUE)
|
||||
endif()
|
||||
|
||||
# The 'complete' step depends on all other steps and creates a
|
||||
# 'done' mark. A dependent external project's 'configure' step
|
||||
# depends on the 'done' mark so that it rebuilds when this project
|
||||
|
||||
@@ -71,6 +71,13 @@
|
||||
# RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME
|
||||
# RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME
|
||||
#
|
||||
# With the exception of the ``ALL`` value, these values can be combined
|
||||
# in order to customize the output. For example:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
|
||||
#
|
||||
#
|
||||
#
|
||||
# If a FILENAME is given, the information is printed into this file. If
|
||||
@@ -417,8 +424,8 @@ endfunction()
|
||||
function(FEATURE_SUMMARY)
|
||||
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
|
||||
set(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
set(oneValueArgs FILENAME VAR DESCRIPTION WHAT)
|
||||
set(multiValueArgs ) # none
|
||||
set(oneValueArgs FILENAME VAR DESCRIPTION)
|
||||
set(multiValueArgs WHAT)
|
||||
|
||||
CMAKE_PARSE_ARGUMENTS(_FS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
|
||||
|
||||
@@ -451,23 +458,42 @@ function(FEATURE_SUMMARY)
|
||||
set(requiredPackagesNotFound TRUE)
|
||||
endif()
|
||||
|
||||
elseif("${_FS_WHAT}" STREQUAL "ALL")
|
||||
else()
|
||||
if("${_FS_WHAT}" STREQUAL "ALL")
|
||||
|
||||
set(allWhatParts "ENABLED_FEATURES"
|
||||
"RUNTIME_PACKAGES_FOUND"
|
||||
"OPTIONAL_PACKAGES_FOUND"
|
||||
"RECOMMENDED_PACKAGES_FOUND"
|
||||
"REQUIRED_PACKAGES_FOUND"
|
||||
set(allWhatParts "ENABLED_FEATURES"
|
||||
"RUNTIME_PACKAGES_FOUND"
|
||||
"OPTIONAL_PACKAGES_FOUND"
|
||||
"RECOMMENDED_PACKAGES_FOUND"
|
||||
"REQUIRED_PACKAGES_FOUND"
|
||||
|
||||
"DISABLED_FEATURES"
|
||||
"RUNTIME_PACKAGES_NOT_FOUND"
|
||||
"OPTIONAL_PACKAGES_NOT_FOUND"
|
||||
"RECOMMENDED_PACKAGES_NOT_FOUND"
|
||||
"REQUIRED_PACKAGES_NOT_FOUND"
|
||||
)
|
||||
"DISABLED_FEATURES"
|
||||
"RUNTIME_PACKAGES_NOT_FOUND"
|
||||
"OPTIONAL_PACKAGES_NOT_FOUND"
|
||||
"RECOMMENDED_PACKAGES_NOT_FOUND"
|
||||
"REQUIRED_PACKAGES_NOT_FOUND"
|
||||
)
|
||||
|
||||
else()
|
||||
set(allWhatParts)
|
||||
foreach(part ${_FS_WHAT})
|
||||
list(FIND validWhatParts "${part}" indexInList)
|
||||
if(NOT "${indexInList}" STREQUAL "-1")
|
||||
list(APPEND allWhatParts "${part}")
|
||||
else()
|
||||
if("${part}" STREQUAL "ALL")
|
||||
message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() contains ALL, which cannot be combined with other values.")
|
||||
else()
|
||||
message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() contains ${part}, which is not a valid value.")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(title_ENABLED_FEATURES "The following features have been enabled:")
|
||||
set(title_DISABLED_FEATURES "The following features have been disabled:")
|
||||
set(title_PACKAGES_FOUND "The following packages have been found:")
|
||||
set(title_PACKAGES_NOT_FOUND "The following packages have not been found:")
|
||||
set(title_OPTIONAL_PACKAGES_FOUND "The following OPTIONAL packages have been found:")
|
||||
set(title_OPTIONAL_PACKAGES_NOT_FOUND "The following OPTIONAL packages have not been found:")
|
||||
set(title_RECOMMENDED_PACKAGES_FOUND "The following RECOMMENDED packages have been found:")
|
||||
@@ -488,8 +514,6 @@ function(FEATURE_SUMMARY)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.")
|
||||
endif()
|
||||
|
||||
if(_FS_FILENAME)
|
||||
@@ -522,10 +546,10 @@ function(SET_PACKAGE_INFO _name _desc)
|
||||
set(_url "${ARGV2}")
|
||||
set(_purpose "${ARGV3}")
|
||||
set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
|
||||
if(_url MATCHES ".+")
|
||||
if(NOT _url STREQUAL "")
|
||||
set_property(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" )
|
||||
endif()
|
||||
if(_purpose MATCHES ".+")
|
||||
if(NOT _purpose STREQUAL "")
|
||||
set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" )
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -92,16 +92,13 @@ if(BISON_EXECUTABLE)
|
||||
message(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
|
||||
else()
|
||||
# Bison++
|
||||
if("${BISON_version_output}" MATCHES "^bison\\+\\+")
|
||||
string(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
|
||||
BISON_VERSION "${BISON_version_output}")
|
||||
if("${BISON_version_output}" MATCHES "^bison\\+\\+ Version ([^,]+)")
|
||||
set(BISON_VERSION "${CMAKE_MATCH_1}")
|
||||
# GNU Bison
|
||||
elseif("${BISON_version_output}" MATCHES "^bison[^+]")
|
||||
string(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
|
||||
BISON_VERSION "${BISON_version_output}")
|
||||
elseif("${BISON_version_output}" MATCHES "^GNU Bison ")
|
||||
string(REGEX REPLACE "^GNU Bison (version )?([^\n]+).*" "\\2"
|
||||
BISON_VERSION "${BISON_version_output}")
|
||||
elseif("${BISON_version_output}" MATCHES "^bison \\(GNU Bison\\) ([^\n]+)\n")
|
||||
set(BISON_VERSION "${CMAKE_MATCH_1}")
|
||||
elseif("${BISON_version_output}" MATCHES "^GNU Bison (version )?([^\n]+)")
|
||||
set(BISON_VERSION "${CMAKE_MATCH_2}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_QUIET ${BLAS_FIND_QUIETLY})
|
||||
|
||||
set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
@@ -147,7 +150,7 @@ endmacro()
|
||||
set(BLAS_LINKER_FLAGS)
|
||||
set(BLAS_LIBRARIES)
|
||||
set(BLAS95_LIBRARIES)
|
||||
if ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||
if (NOT $ENV{BLA_VENDOR} STREQUAL "")
|
||||
set(BLA_VENDOR $ENV{BLA_VENDOR})
|
||||
else ()
|
||||
if(NOT BLA_VENDOR)
|
||||
@@ -285,7 +288,7 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
|
||||
endif ()
|
||||
|
||||
#BLAS in acml library?
|
||||
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
|
||||
if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR
|
||||
((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR
|
||||
((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS))
|
||||
@@ -462,7 +465,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
|
||||
endif ()
|
||||
|
||||
#BLAS in intel mkl 10 library? (em64t 64bit)
|
||||
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
||||
if (NOT WIN32)
|
||||
set(LM "-lm")
|
||||
endif ()
|
||||
@@ -529,7 +532,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
"mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide")
|
||||
|
||||
# mkl >= 10.3
|
||||
if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
|
||||
if (CMAKE_C_COMPILER MATCHES ".+gcc")
|
||||
list(APPEND BLAS_SEARCH_LIBS
|
||||
"mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core gomp")
|
||||
else ()
|
||||
@@ -597,7 +600,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
"mkl_intel_lp64 mkl_intel_thread mkl_core guide")
|
||||
|
||||
# mkl >= 10.3
|
||||
if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
|
||||
if (CMAKE_C_COMPILER MATCHES ".+gcc")
|
||||
list(APPEND BLAS_SEARCH_LIBS
|
||||
"mkl_intel_lp64 mkl_gnu_thread mkl_core gomp")
|
||||
else ()
|
||||
@@ -687,4 +690,5 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cmake_pop_check_state()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
@@ -57,7 +57,11 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
|
||||
|
||||
if (BZIP2_FOUND)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_QUIET ${BZip2_FIND_QUIETLY})
|
||||
CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
|
||||
cmake_pop_check_state()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(BZIP2_INCLUDE_DIR)
|
||||
|
||||
@@ -62,6 +62,7 @@ if (NOT DEFINED Backtrace_LIBRARY)
|
||||
# First, check if we already have backtrace(), e.g., in libc
|
||||
cmake_push_check_state(RESET)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
|
||||
set(CMAKE_REQUIRED_QUIET ${Backtrace_FIND_QUIETLY})
|
||||
check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
|
||||
@@ -631,12 +631,12 @@ if(NOT Boost_INCLUDE_DIR)
|
||||
set(_boost_BOOSTIFIED_VERSION)
|
||||
|
||||
# Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
|
||||
if(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
|
||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3"
|
||||
_boost_BOOSTIFIED_VERSION ${_boost_VER})
|
||||
elseif(_boost_VER MATCHES "[0-9]+\\.[0-9]+")
|
||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2"
|
||||
_boost_BOOSTIFIED_VERSION ${_boost_VER})
|
||||
if(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
|
||||
set(_boost_BOOSTIFIED_VERSION
|
||||
"${CMAKE_MATCH_1}_${CMAKE_MATCH_2}_${CMAKE_MATCH_3}")
|
||||
elseif(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)")
|
||||
set(_boost_BOOSTIFIED_VERSION
|
||||
"${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
|
||||
endif()
|
||||
|
||||
list(APPEND _boost_PATH_SUFFIXES
|
||||
@@ -684,7 +684,7 @@ if(Boost_INCLUDE_DIR)
|
||||
set(_Boost_VERSION_REGEX "([0-9]+)")
|
||||
set(_Boost_LIB_VERSION_REGEX "\"([0-9_]+)\"")
|
||||
foreach(v VERSION LIB_VERSION)
|
||||
if("${_boost_VERSION_HPP_CONTENTS}" MATCHES ".*#define BOOST_${v} ${_Boost_${v}_REGEX}.*")
|
||||
if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_${v} ${_Boost_${v}_REGEX}")
|
||||
set(Boost_${v} "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endforeach()
|
||||
@@ -954,7 +954,8 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
|
||||
|
||||
# Compute component-specific hints.
|
||||
set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "")
|
||||
if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python")
|
||||
if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR
|
||||
${COMPONENT} STREQUAL "graph_parallel")
|
||||
foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES})
|
||||
if(IS_ABSOLUTE "${lib}")
|
||||
get_filename_component(libdir "${lib}" PATH)
|
||||
|
||||
@@ -987,7 +987,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
|
||||
# This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
|
||||
# CMake source.
|
||||
|
||||
# Remove leading /
|
||||
@@ -1194,7 +1194,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
||||
foreach(file ${ARGN})
|
||||
# Ignore any file marked as a HEADER_FILE_ONLY
|
||||
get_source_file_property(_is_header ${file} HEADER_FILE_ONLY)
|
||||
if(${file} MATCHES ".*\\.cu$" AND NOT _is_header)
|
||||
if(${file} MATCHES "\\.cu$" AND NOT _is_header)
|
||||
|
||||
# Allow per source file overrides of the format.
|
||||
get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT)
|
||||
|
||||
@@ -37,12 +37,11 @@
|
||||
|
||||
file(READ ${input_file} depend_text)
|
||||
|
||||
if (${depend_text} MATCHES ".+")
|
||||
if (NOT "${depend_text}" STREQUAL "")
|
||||
|
||||
# message("FOUND DEPENDS")
|
||||
|
||||
# Remember, four backslashes is escaped to one backslash in the string.
|
||||
string(REGEX REPLACE "\\\\ " " " depend_text ${depend_text})
|
||||
string(REPLACE "\\ " " " depend_text ${depend_text})
|
||||
|
||||
# This works for the nvcc -M generated dependency files.
|
||||
string(REGEX REPLACE "^.* : " "" depend_text ${depend_text})
|
||||
|
||||
@@ -37,11 +37,10 @@
|
||||
|
||||
file(READ ${input_file} file_text)
|
||||
|
||||
if (${file_text} MATCHES ".+")
|
||||
if (NOT "${file_text}" STREQUAL "")
|
||||
|
||||
# Remember, four backslashes is escaped to one backslash in the string.
|
||||
string(REGEX REPLACE ";" "\\\\;" file_text ${file_text})
|
||||
string(REGEX REPLACE "\ncode" ";code" file_text ${file_text})
|
||||
string(REPLACE ";" "\\;" file_text ${file_text})
|
||||
string(REPLACE "\ncode" ";code" file_text ${file_text})
|
||||
|
||||
list(LENGTH file_text len)
|
||||
|
||||
@@ -57,7 +56,7 @@ if (${file_text} MATCHES ".+")
|
||||
|
||||
# Extract kernel names.
|
||||
if (${entry} MATCHES "[^g]name = ([^ ]+)")
|
||||
string(REGEX REPLACE ".* = ([^ ]+)" "\\1" entry ${entry})
|
||||
set(entry "${CMAKE_MATCH_1}")
|
||||
|
||||
# Check to see if the kernel name starts with "_"
|
||||
set(skip FALSE)
|
||||
@@ -76,19 +75,19 @@ if (${file_text} MATCHES ".+")
|
||||
|
||||
# Registers
|
||||
if (${entry} MATCHES "reg([ ]+)=([ ]+)([^ ]+)")
|
||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
||||
set(entry "${CMAKE_MATCH_3}")
|
||||
message("Registers: ${entry}")
|
||||
endif()
|
||||
|
||||
# Local memory
|
||||
if (${entry} MATCHES "lmem([ ]+)=([ ]+)([^ ]+)")
|
||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
||||
set(entry "${CMAKE_MATCH_3}")
|
||||
message("Local: ${entry}")
|
||||
endif()
|
||||
|
||||
# Shared memory
|
||||
if (${entry} MATCHES "smem([ ]+)=([ ]+)([^ ]+)")
|
||||
string(REGEX REPLACE ".*([ ]+)=([ ]+)([^ ]+)" "\\3" entry ${entry})
|
||||
set(entry "${CMAKE_MATCH_3}")
|
||||
message("Shared: ${entry}")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -36,9 +36,13 @@ find_library(CUPS_LIBRARIES NAMES cups )
|
||||
|
||||
if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_QUIET ${Cups_FIND_QUIETLY})
|
||||
|
||||
# ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
|
||||
CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
|
||||
cmake_pop_check_state()
|
||||
endif ()
|
||||
|
||||
if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
|
||||
@@ -48,9 +52,8 @@ if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
|
||||
unset(CUPS_VERSION_STRING)
|
||||
foreach(VPART MAJOR MINOR PATCH)
|
||||
foreach(VLINE ${cups_version_str})
|
||||
if(VLINE MATCHES "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}")
|
||||
string(REGEX REPLACE "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}[\t ]+([0-9]+)$" "\\1"
|
||||
CUPS_VERSION_PART "${VLINE}")
|
||||
if(VLINE MATCHES "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}[\t ]+([0-9]+)$")
|
||||
set(CUPS_VERSION_PART "${CMAKE_MATCH_1}")
|
||||
if(CUPS_VERSION_STRING)
|
||||
set(CUPS_VERSION_STRING "${CUPS_VERSION_STRING}.${CUPS_VERSION_PART}")
|
||||
else()
|
||||
|
||||
@@ -67,6 +67,9 @@ endif()
|
||||
# default search paths.
|
||||
if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_QUIET ${Curses_FIND_QUIETLY})
|
||||
CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
|
||||
wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
|
||||
|
||||
@@ -77,6 +80,7 @@ if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
|
||||
set(CURSES_USE_NCURSES TRUE)
|
||||
endif()
|
||||
endif()
|
||||
cmake_pop_check_state()
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
@@ -38,9 +38,8 @@ if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
|
||||
unset(EXPAT_VERSION_STRING)
|
||||
foreach(VPART MAJOR MINOR MICRO)
|
||||
foreach(VLINE ${expat_version_str})
|
||||
if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION")
|
||||
string(REGEX REPLACE "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$" "\\1"
|
||||
EXPAT_VERSION_PART "${VLINE}")
|
||||
if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$")
|
||||
set(EXPAT_VERSION_PART "${CMAKE_MATCH_1}")
|
||||
if(EXPAT_VERSION_STRING)
|
||||
set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}")
|
||||
else()
|
||||
|
||||
@@ -285,9 +285,7 @@ endif()
|
||||
OUTPUT_VARIABLE FLTK_IMAGES_LDFLAGS)
|
||||
set(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*")
|
||||
if("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
|
||||
string(REGEX REPLACE "${FLTK_LIBS_EXTRACT_REGEX}" "\\1"
|
||||
FLTK_IMAGES_LIBS "${FLTK_IMAGES_LDFLAGS}")
|
||||
string(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}")
|
||||
string(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${CMAKE_MATCH_1}")
|
||||
# The EXEC_PROGRAM will not be inherited into subdirectories from
|
||||
# the file that originally included this module. Save the answer.
|
||||
set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
|
||||
|
||||
@@ -226,9 +226,7 @@ if(FLTK2_DIR)
|
||||
OUTPUT_VARIABLE FLTK2_IMAGES_LDFLAGS)
|
||||
set(FLTK2_LIBS_EXTRACT_REGEX ".*-lfltk2_images (.*) -lfltk2.*")
|
||||
if("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
|
||||
string(REGEX REPLACE "${FLTK2_LIBS_EXTRACT_REGEX}" "\\1"
|
||||
FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LDFLAGS}")
|
||||
string(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}")
|
||||
string(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${CMAKE_MATCH_1}")
|
||||
# The EXEC_PROGRAM will not be inherited into subdirectories from
|
||||
# the file that originally included this module. Save the answer.
|
||||
set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
|
||||
|
||||
@@ -62,7 +62,7 @@ find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
|
||||
ENV GTKMM_BASEPATH
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
|
||||
PATH_SUFFIXES include/freetype2 include
|
||||
PATH_SUFFIXES include/freetype2 include freetype2
|
||||
)
|
||||
|
||||
find_path(FREETYPE_INCLUDE_DIR_freetype2
|
||||
@@ -79,7 +79,7 @@ find_path(FREETYPE_INCLUDE_DIR_freetype2
|
||||
ENV GTKMM_BASEPATH
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
|
||||
PATH_SUFFIXES include/freetype2 include
|
||||
PATH_SUFFIXES include/freetype2 include freetype2
|
||||
)
|
||||
|
||||
find_library(FREETYPE_LIBRARY
|
||||
@@ -117,9 +117,8 @@ if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
|
||||
unset(FREETYPE_VERSION_STRING)
|
||||
foreach(VPART MAJOR MINOR PATCH)
|
||||
foreach(VLINE ${freetype_version_str})
|
||||
if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
|
||||
string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
|
||||
FREETYPE_VERSION_PART "${VLINE}")
|
||||
if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$")
|
||||
set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}")
|
||||
if(FREETYPE_VERSION_STRING)
|
||||
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
|
||||
else()
|
||||
|
||||
@@ -90,9 +90,9 @@ if(UNIX)
|
||||
exec_program(${GDAL_CONFIG} ARGS --libs OUTPUT_VARIABLE GDAL_CONFIG_LIBS)
|
||||
if(GDAL_CONFIG_LIBS)
|
||||
string(REGEX MATCHALL "-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS})
|
||||
string(REGEX REPLACE "-l" "" _gdal_lib "${_gdal_dashl}")
|
||||
string(REPLACE "-l" "" _gdal_lib "${_gdal_dashl}")
|
||||
string(REGEX MATCHALL "-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS})
|
||||
string(REGEX REPLACE "-L" "" _gdal_libpath "${_gdal_dashL}")
|
||||
string(REPLACE "-L" "" _gdal_libpath "${_gdal_dashL}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -66,6 +66,7 @@ if(GIF_INCLUDE_DIR)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckStructHasMember.cmake)
|
||||
CMAKE_PUSH_CHECK_STATE()
|
||||
set(CMAKE_REQUIRED_QUIET ${GIF_FIND_QUIETLY})
|
||||
set(GIF_VERSION 3)
|
||||
set(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}")
|
||||
CHECK_STRUCT_HAS_MEMBER(GifFileType UserData gif_lib.h GIF_GifFileType_UserData )
|
||||
|
||||
+30
-12
@@ -267,6 +267,8 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
|
||||
/usr/local/lib
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/X11R6/include
|
||||
/usr/X11R6/lib
|
||||
/opt/gnome/include
|
||||
/opt/gnome/lib
|
||||
/opt/openwin/include
|
||||
@@ -641,6 +643,10 @@ endif()
|
||||
|
||||
foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
|
||||
if(_GTK2_component STREQUAL "gtk")
|
||||
# Left for compatibility with previous versions.
|
||||
_GTK2_FIND_INCLUDE_DIR(FONTCONFIG fontconfig/fontconfig.h)
|
||||
_GTK2_FIND_INCLUDE_DIR(X11 X11/Xlib.h)
|
||||
|
||||
_GTK2_FIND_INCLUDE_DIR(GLIB glib.h)
|
||||
_GTK2_FIND_INCLUDE_DIR(GLIBCONFIG glibconfig.h)
|
||||
_GTK2_FIND_LIBRARY (GLIB glib false true)
|
||||
@@ -680,11 +686,15 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
|
||||
|
||||
_GTK2_FIND_LIBRARY (PANGOFT2 pangoft2 false true)
|
||||
_GTK2_ADD_TARGET (PANGOFT2 GTK2_DEPENDS pango gobject glib
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2})
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2}
|
||||
${GTK2_FONTCONFIG_INCLUDE_DIR}
|
||||
${GTK2_X11_INCLUDE_DIR})
|
||||
|
||||
_GTK2_FIND_LIBRARY (PANGOXFT pangoxft false true)
|
||||
_GTK2_ADD_TARGET (PANGOXFT GTK2_DEPENDS pangoft2 pango gobject glib
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2})
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2}
|
||||
${GTK2_FONTCONFIG_INCLUDE_DIR}
|
||||
${GTK2_X11_INCLUDE_DIR})
|
||||
|
||||
_GTK2_FIND_INCLUDE_DIR(GDK gdk/gdk.h)
|
||||
_GTK2_FIND_INCLUDE_DIR(GDKCONFIG gdkconfig.h)
|
||||
@@ -715,9 +725,6 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
|
||||
_GTK2_ADD_TARGET (GTK GTK2_DEPENDS gdk atk pangoft2 pango gdk_pixbuf gthread gobject glib
|
||||
GTK2_OPTIONAL_DEPENDS gio pangocairo cairo)
|
||||
|
||||
# Left for compatibility with previous versions. It doesn't seem to be required
|
||||
_GTK2_FIND_INCLUDE_DIR(FONTCONFIG fontconfig/fontconfig.h)
|
||||
|
||||
elseif(_GTK2_component STREQUAL "gtkmm")
|
||||
|
||||
_GTK2_FIND_INCLUDE_DIR(SIGC++ sigc++/sigc++.h)
|
||||
@@ -743,29 +750,36 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
|
||||
_GTK2_FIND_INCLUDE_DIR(CAIROMMCONFIG cairommconfig.h)
|
||||
_GTK2_FIND_LIBRARY (CAIROMM cairomm true true)
|
||||
_GTK2_ADD_TARGET (CAIROMM GTK2_DEPENDS cairo sigc++
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2})
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2}
|
||||
${GTK2_FONTCONFIG_INCLUDE_DIR}
|
||||
${GTK2_X11_INCLUDE_DIR})
|
||||
|
||||
_GTK2_FIND_INCLUDE_DIR(PANGOMM pangomm.h)
|
||||
_GTK2_FIND_INCLUDE_DIR(PANGOMMCONFIG pangommconfig.h)
|
||||
_GTK2_FIND_LIBRARY (PANGOMM pangomm true true)
|
||||
_GTK2_ADD_TARGET (PANGOMM GTK2_DEPENDS glibmm sigc++ pango gobject glib
|
||||
GTK2_OPTIONAL_DEPENDS cairomm pangocairo cairo
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2})
|
||||
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2}
|
||||
${GTK2_FONTCONFIG_INCLUDE_DIR}
|
||||
${GTK2_X11_INCLUDE_DIR})
|
||||
|
||||
_GTK2_FIND_INCLUDE_DIR(GDKMM gdkmm.h)
|
||||
_GTK2_FIND_INCLUDE_DIR(GDKMMCONFIG gdkmmconfig.h)
|
||||
_GTK2_FIND_LIBRARY (GDKMM gdkmm true true)
|
||||
_GTK2_ADD_TARGET (GDKMM GTK2_DEPENDS pangomm gtk glibmm sigc++ gdk atk pangoft2 gdk_pixbuf pango gobject glib
|
||||
GTK2_OPTIONAL_DEPENDS giomm cairomm gio pangocairo cairo
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2})
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2}
|
||||
${GTK2_FONTCONFIG_INCLUDE_DIR}
|
||||
${GTK2_X11_INCLUDE_DIR})
|
||||
|
||||
_GTK2_FIND_INCLUDE_DIR(GTKMM gtkmm.h)
|
||||
_GTK2_FIND_INCLUDE_DIR(GTKMMCONFIG gtkmmconfig.h)
|
||||
_GTK2_FIND_LIBRARY (GTKMM gtkmm true true)
|
||||
_GTK2_ADD_TARGET (GTKMM GTK2_DEPENDS atkmm gdkmm pangomm gtk glibmm sigc++ gdk atk pangoft2 gdk_pixbuf pango gthread gobject glib
|
||||
GTK2_OPTIONAL_DEPENDS giomm cairomm gio pangocairo cairo
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2})
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2}
|
||||
${GTK2_FONTCONFIG_INCLUDE_DIR}
|
||||
${GTK2_X11_INCLUDE_DIR})
|
||||
|
||||
elseif(_GTK2_component STREQUAL "glade")
|
||||
|
||||
@@ -773,7 +787,9 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
|
||||
_GTK2_FIND_LIBRARY (GLADE glade false true)
|
||||
_GTK2_ADD_TARGET (GLADE GTK2_DEPENDS gtk gdk atk gio pangoft2 gdk_pixbuf pango gobject glib
|
||||
GTK2_OPTIONAL_DEPENDS pangocairo cairo
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2})
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2}
|
||||
${GTK2_FONTCONFIG_INCLUDE_DIR}
|
||||
${GTK2_X11_INCLUDE_DIR})
|
||||
|
||||
elseif(_GTK2_component STREQUAL "glademm")
|
||||
|
||||
@@ -782,7 +798,9 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
|
||||
_GTK2_FIND_LIBRARY (GLADEMM glademm true true)
|
||||
_GTK2_ADD_TARGET (GLADEMM GTK2_DEPENDS gtkmm glade atkmm gdkmm giomm pangomm glibmm sigc++ gtk gdk atk pangoft2 gdk_pixbuf pango gthread gobject glib
|
||||
GTK2_OPTIONAL_DEPENDS giomm cairomm gio pangocairo cairo
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2})
|
||||
OPTIONAL_INCLUDES ${FREETYPE_INCLUDE_DIR_ft2build} ${FREETYPE_INCLUDE_DIR_freetype2}
|
||||
${GTK2_FONTCONFIG_INCLUDE_DIR}
|
||||
${GTK2_X11_INCLUDE_DIR})
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown GTK2 component ${_component}")
|
||||
|
||||
+23
-5
@@ -79,7 +79,7 @@
|
||||
# extra_args = Pass a list of extra arguments to be passed to
|
||||
# executable enclosed in quotes (or "" for none)
|
||||
# ARGN = A list of source files to search for tests & test
|
||||
# fixtures.
|
||||
# fixtures. Or AUTO to find them from executable target.
|
||||
#
|
||||
#
|
||||
#
|
||||
@@ -88,7 +88,7 @@
|
||||
# Example:
|
||||
# set(FooTestArgs --foo 1 --bar 2)
|
||||
# add_executable(FooTest FooUnitTest.cc)
|
||||
# GTEST_ADD_TESTS(FooTest "${FooTestArgs}" FooUnitTest.cc)
|
||||
# GTEST_ADD_TESTS(FooTest "${FooTestArgs}" AUTO)
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
@@ -111,12 +111,30 @@ function(GTEST_ADD_TESTS executable extra_args)
|
||||
if(NOT ARGN)
|
||||
message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS")
|
||||
endif()
|
||||
if(ARGN STREQUAL "AUTO")
|
||||
# obtain sources used for building that executable
|
||||
get_property(ARGN TARGET ${executable} PROPERTY SOURCES)
|
||||
endif()
|
||||
set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*")
|
||||
set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
|
||||
foreach(source ${ARGN})
|
||||
file(READ "${source}" contents)
|
||||
string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
|
||||
string(REGEX MATCHALL "${gtest_test_type_regex}\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
|
||||
foreach(hit ${found_tests})
|
||||
string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit})
|
||||
add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})
|
||||
string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
|
||||
|
||||
# Parameterized tests have a different signature for the filter
|
||||
if(${test_type} STREQUAL "TEST_P")
|
||||
string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit})
|
||||
elseif(${test_type} STREQUAL "TEST_F" OR ${test_type} STREQUAL "TEST")
|
||||
string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit})
|
||||
elseif(${test_type} STREQUAL "TYPED_TEST")
|
||||
string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" test_name ${hit})
|
||||
else()
|
||||
message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
|
||||
continue()
|
||||
endif()
|
||||
add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})
|
||||
endforeach()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
@@ -71,8 +71,8 @@ if(GETTEXT_MSGMERGE_EXECUTABLE)
|
||||
OUTPUT_VARIABLE gettext_version
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (gettext_version MATCHES "^msgmerge \\(.*\\) [0-9]")
|
||||
string(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}")
|
||||
if (gettext_version MATCHES "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
|
||||
set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
unset(gettext_version)
|
||||
endif()
|
||||
|
||||
@@ -162,7 +162,7 @@ macro( _HDF5_parse_compile_line
|
||||
)
|
||||
foreach( IPATH ${include_path_flags} )
|
||||
string( REGEX REPLACE "^-I" "" IPATH ${IPATH} )
|
||||
string( REGEX REPLACE "//" "/" IPATH ${IPATH} )
|
||||
string( REPLACE "//" "/" IPATH ${IPATH} )
|
||||
list( APPEND ${include_paths} ${IPATH} )
|
||||
endforeach()
|
||||
|
||||
@@ -179,7 +179,7 @@ macro( _HDF5_parse_compile_line
|
||||
|
||||
foreach( LPATH ${library_path_flags} )
|
||||
string( REGEX REPLACE "^-L" "" LPATH ${LPATH} )
|
||||
string( REGEX REPLACE "//" "/" LPATH ${LPATH} )
|
||||
string( REPLACE "//" "/" LPATH ${LPATH} )
|
||||
list( APPEND ${library_paths} ${LPATH} )
|
||||
endforeach()
|
||||
|
||||
@@ -253,7 +253,7 @@ if( NOT HDF5_FOUND )
|
||||
list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} )
|
||||
|
||||
# find the HDF5 include directories
|
||||
if(${LANGUAGE} MATCHES "Fortran.*")
|
||||
if(${LANGUAGE} MATCHES "Fortran")
|
||||
set(HDF5_INCLUDE_FILENAME hdf5.mod)
|
||||
else()
|
||||
set(HDF5_INCLUDE_FILENAME hdf5.h)
|
||||
|
||||
+36
-1
@@ -2,7 +2,7 @@
|
||||
# FindHg
|
||||
# ------
|
||||
#
|
||||
#
|
||||
# Extract information from a mercurial working copy.
|
||||
#
|
||||
# The module defines the following variables:
|
||||
#
|
||||
@@ -12,6 +12,20 @@
|
||||
# HG_FOUND - true if the command line client was found
|
||||
# HG_VERSION_STRING - the version of mercurial found
|
||||
#
|
||||
# If the command line client executable is found the following macro is defined:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# HG_WC_INFO(<dir> <var-prefix>)
|
||||
#
|
||||
# Hg_WC_INFO extracts information of a mercurial working copy
|
||||
# at a given location. This macro defines the following variables:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# <var-prefix>_WC_CHANGESET - current changeset
|
||||
# <var-prefix>_WC_REVISION - current revision
|
||||
#
|
||||
# Example usage:
|
||||
#
|
||||
# ::
|
||||
@@ -19,11 +33,15 @@
|
||||
# find_package(Hg)
|
||||
# if(HG_FOUND)
|
||||
# message("hg found: ${HG_EXECUTABLE}")
|
||||
# HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
|
||||
# message("Current revision is ${Project_WC_REVISION}")
|
||||
# message("Current changeset is ${Project_WC_CHANGESET}")
|
||||
# endif()
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2010-2012 Kitware, Inc.
|
||||
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
|
||||
# Copyright 2014 Matthaeus G. Chajdas
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
@@ -37,6 +55,8 @@
|
||||
|
||||
find_program(HG_EXECUTABLE
|
||||
NAMES hg
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\Software\\TortoiseHG]
|
||||
PATH_SUFFIXES Mercurial
|
||||
DOC "hg command line client"
|
||||
)
|
||||
@@ -51,6 +71,21 @@ if(HG_EXECUTABLE)
|
||||
set(HG_VERSION_STRING "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
unset(hg_version)
|
||||
|
||||
macro(HG_WC_INFO dir prefix)
|
||||
execute_process(COMMAND ${HG_EXECUTABLE} id -i -n
|
||||
WORKING_DIRECTORY ${dir}
|
||||
RESULT_VARIABLE hg_id_result
|
||||
ERROR_VARIABLE hg_id_error
|
||||
OUTPUT_VARIABLE ${prefix}_WC_DATA
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT ${hg_id_result} EQUAL 0)
|
||||
message(SEND_ERROR "Command \"${HG_EXECUTBALE} id -n\" in directory ${dir} failed with output:\n${hg_id_error}")
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE "([0-9a-f]+)\\+? [0-9]+\\+?" "\\1" ${prefix}_WC_CHANGESET ${${prefix}_WC_DATA})
|
||||
string(REGEX REPLACE "[0-9a-f]+\\+? ([0-9]+)\\+?" "\\1" ${prefix}_WC_REVISION ${${prefix}_WC_DATA})
|
||||
endmacro(HG_WC_INFO)
|
||||
endif()
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set HG_FOUND to TRUE if
|
||||
|
||||
@@ -37,7 +37,7 @@ if(ICOTOOL_EXECUTABLE)
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if("${_icotool_version}" MATCHES "^icotool \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*")
|
||||
if("${_icotool_version}" MATCHES "^icotool \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
|
||||
set( ICOTOOL_VERSION_STRING
|
||||
"${CMAKE_MATCH_1}"
|
||||
)
|
||||
|
||||
@@ -221,8 +221,8 @@ if(ImageMagick_mogrify_EXECUTABLE)
|
||||
OUTPUT_VARIABLE imagemagick_version
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(imagemagick_version MATCHES "^Version: ImageMagick [0-9]")
|
||||
string(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}")
|
||||
if(imagemagick_version MATCHES "^Version: ImageMagick ([-0-9\\.]+)")
|
||||
set(ImageMagick_VERSION_STRING "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
unset(imagemagick_version)
|
||||
endif()
|
||||
|
||||
@@ -128,18 +128,15 @@ if(Java_JAVA_EXECUTABLE)
|
||||
# 3. GCJ 1.5
|
||||
# 4. Kaffe 1.4.2
|
||||
# 5. OpenJDK 1.7.x on OpenBSD
|
||||
if(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
|
||||
if(var MATCHES "java version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\"")
|
||||
# This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
|
||||
string( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
|
||||
"\\1" Java_VERSION_STRING "${var}" )
|
||||
elseif(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
|
||||
set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
|
||||
elseif(var MATCHES "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+)\"")
|
||||
# Kaffe style
|
||||
string( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
|
||||
"\\1" Java_VERSION_STRING "${var}" )
|
||||
elseif(var MATCHES "openjdk version \"[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
|
||||
set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
|
||||
elseif(var MATCHES "openjdk version \"([0-9]+\\.[0-9]+\\.[0-9_]+)\"")
|
||||
# OpenJDK ver 1.7.x on OpenBSD
|
||||
string( REGEX REPLACE "openjdk version \"([0-9]+\\.[0-9]+\\.[0-9_]+).*"
|
||||
"\\1" Java_VERSION_STRING "${var}" )
|
||||
set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
if(NOT Java_FIND_QUIETLY)
|
||||
message(WARNING "regex not supported: ${var}. Please report")
|
||||
|
||||
@@ -192,7 +192,7 @@ if(KDECONFIG_EXECUTABLE)
|
||||
if ("${kde_version}" MATCHES "KDE: 3\\.")
|
||||
execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --prefix
|
||||
OUTPUT_VARIABLE kdedir )
|
||||
string(REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}")
|
||||
string(REPLACE "\n" "" KDE3PREFIX "${kdedir}")
|
||||
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
@@ -54,6 +54,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
|
||||
else ()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
|
||||
endif ()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_QUIET ${LAPACK_FIND_QUIETLY})
|
||||
|
||||
set(LAPACK_FOUND FALSE)
|
||||
set(LAPACK95_FOUND FALSE)
|
||||
@@ -155,7 +159,7 @@ endif()
|
||||
|
||||
if(BLAS_FOUND)
|
||||
set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
|
||||
if ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||
if (NOT $ENV{BLA_VENDOR} STREQUAL "")
|
||||
set(BLA_VENDOR $ENV{BLA_VENDOR})
|
||||
else ()
|
||||
if(NOT BLA_VENDOR)
|
||||
@@ -179,7 +183,7 @@ endif ()
|
||||
|
||||
|
||||
#acml lapack
|
||||
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLAS_LIBRARIES MATCHES ".+acml.+")
|
||||
set (LAPACK_LIBRARIES ${BLAS_LIBRARIES})
|
||||
endif ()
|
||||
@@ -229,7 +233,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR
|
||||
endif ()
|
||||
endif ()
|
||||
#intel lapack
|
||||
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
|
||||
if (NOT WIN32)
|
||||
set(LM "-lm")
|
||||
endif ()
|
||||
@@ -347,4 +351,5 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cmake_pop_check_state()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
@@ -55,9 +55,12 @@ endif()
|
||||
# Avoid using old codebase
|
||||
if (LIBLZMA_LIBRARY)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
|
||||
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
|
||||
set(CMAKE_REQUIRED_QUIET ${LibLZMA_FIND_QUIETLY})
|
||||
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
|
||||
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
|
||||
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
|
||||
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
|
||||
endif ()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
|
||||
+6
-11
@@ -330,7 +330,7 @@ function (interrogate_mpi_compiler lang try_libs)
|
||||
string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
|
||||
foreach(IPATH ${MPI_ALL_INCLUDE_PATHS})
|
||||
string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH})
|
||||
string(REGEX REPLACE "//" "/" IPATH ${IPATH})
|
||||
string(REPLACE "//" "/" IPATH ${IPATH})
|
||||
list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH})
|
||||
endforeach()
|
||||
|
||||
@@ -354,7 +354,7 @@ function (interrogate_mpi_compiler lang try_libs)
|
||||
set(MPI_LINK_PATH)
|
||||
foreach(LPATH ${MPI_ALL_LINK_PATHS})
|
||||
string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
|
||||
string(REGEX REPLACE "//" "/" LPATH ${LPATH})
|
||||
string(REPLACE "//" "/" LPATH ${LPATH})
|
||||
list(APPEND MPI_LINK_PATH ${LPATH})
|
||||
endforeach()
|
||||
|
||||
@@ -378,19 +378,14 @@ function (interrogate_mpi_compiler lang try_libs)
|
||||
# Extract the set of libraries to link against from the link command
|
||||
# line
|
||||
string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
|
||||
|
||||
# add the compiler implicit directories because some compilers
|
||||
# such as the intel compiler have libraries that show up
|
||||
# in the showme list that can only be found in the implicit
|
||||
# link directories of the compiler. Do this for C++ and C
|
||||
# compilers if the implicit link directories are defined.
|
||||
if (DEFINED CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES)
|
||||
# link directories of the compiler.
|
||||
if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES)
|
||||
set(MPI_LINK_PATH
|
||||
"${MPI_LINK_PATH};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}")
|
||||
endif ()
|
||||
|
||||
if (DEFINED CMAKE_C_IMPLICIT_LINK_DIRECTORIES)
|
||||
set(MPI_LINK_PATH
|
||||
"${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
|
||||
"${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}")
|
||||
endif ()
|
||||
|
||||
# Determine full path names for all of the libraries that one needs
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
#.rst:
|
||||
# FindOpenCL
|
||||
# ----------
|
||||
#
|
||||
# Try to find OpenCL
|
||||
#
|
||||
# Once done this will define::
|
||||
#
|
||||
# OpenCL_FOUND - True if OpenCL was found
|
||||
# OpenCL_INCLUDE_DIRS - include directories for OpenCL
|
||||
# OpenCL_LIBRARIES - link against this library to use OpenCL
|
||||
# OpenCL_VERSION_STRING - Highest supported OpenCL version (eg. 1.2)
|
||||
# OpenCL_VERSION_MAJOR - The major version of the OpenCL implementation
|
||||
# OpenCL_VERSION_MINOR - The minor version of the OpenCL implementation
|
||||
#
|
||||
# The module will also define two cache variables::
|
||||
#
|
||||
# OpenCL_INCLUDE_DIR - the OpenCL include directory
|
||||
# OpenCL_LIBRARY - the path to the OpenCL library
|
||||
#
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2014 Matthaeus G. Chajdas
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
function(_FIND_OPENCL_VERSION)
|
||||
include(CheckSymbolExists)
|
||||
include(CMakePushCheckState)
|
||||
set(CMAKE_REQUIRED_QUIET ${OpenCL_FIND_QUIETLY})
|
||||
|
||||
CMAKE_PUSH_CHECK_STATE()
|
||||
foreach(VERSION "2_0" "1_2" "1_1" "1_0")
|
||||
set(CMAKE_REQUIRED_INCLUDES "${OpenCL_INCLUDE_DIR}")
|
||||
|
||||
if(APPLE)
|
||||
CHECK_SYMBOL_EXISTS(
|
||||
CL_VERSION_${VERSION}
|
||||
"${OpenCL_INCLUDE_DIR}/OpenCL/cl.h"
|
||||
OPENCL_VERSION_${VERSION})
|
||||
else()
|
||||
CHECK_SYMBOL_EXISTS(
|
||||
CL_VERSION_${VERSION}
|
||||
"${OpenCL_INCLUDE_DIR}/CL/cl.h"
|
||||
OPENCL_VERSION_${VERSION})
|
||||
endif()
|
||||
|
||||
if(OPENCL_VERSION_${VERSION})
|
||||
string(REPLACE "_" "." VERSION "${VERSION}")
|
||||
set(OpenCL_VERSION_STRING ${VERSION} PARENT_SCOPE)
|
||||
string(REGEX MATCHALL "[0-9]+" version_components "${VERSION}")
|
||||
list(GET version_components 0 major_version)
|
||||
list(GET version_components 1 minor_version)
|
||||
set(OpenCL_VERSION_MAJOR ${major_version} PARENT_SCOPE)
|
||||
set(OpenCL_VERSION_MINOR ${minor_version} PARENT_SCOPE)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
CMAKE_POP_CHECK_STATE()
|
||||
endfunction()
|
||||
|
||||
find_path(OpenCL_INCLUDE_DIR
|
||||
NAMES
|
||||
CL/cl.h OpenCL/cl.h
|
||||
PATHS ENV
|
||||
"PROGRAMFILES(X86)"
|
||||
AMDAPPSDKROOT
|
||||
INTELOCLSDKROOT
|
||||
NVSDKCOMPUTE_ROOT
|
||||
CUDA_PATH
|
||||
ATISTREAMSDKROOT
|
||||
PATH_SUFFIXES
|
||||
OpenCL/common/inc
|
||||
"AMD APP/include")
|
||||
|
||||
_FIND_OPENCL_VERSION()
|
||||
|
||||
if(WIN32)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
find_library(OpenCL_LIBRARY
|
||||
NAMES OpenCL
|
||||
PATHS ENV
|
||||
"PROGRAMFILES(X86)"
|
||||
AMDAPPSDKROOT
|
||||
INTELOCLSDKROOT
|
||||
CUDA_PATH
|
||||
NVSDKCOMPUTE_ROOT
|
||||
ATISTREAMSDKROOT
|
||||
PATH_SUFFIXES
|
||||
"AMD APP/lib/x86"
|
||||
lib/x86
|
||||
lib/Win32
|
||||
OpenCL/common/lib/Win32)
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
find_library(OpenCL_LIBRARY
|
||||
NAMES OpenCL
|
||||
PATHS ENV
|
||||
"PROGRAMFILES(X86)"
|
||||
AMDAPPSDKROOT
|
||||
INTELOCLSDKROOT
|
||||
CUDA_PATH
|
||||
NVSDKCOMPUTE_ROOT
|
||||
ATISTREAMSDKROOT
|
||||
PATH_SUFFIXES
|
||||
"AMD APP/lib/x86_64"
|
||||
lib/x86_64
|
||||
lib/x64
|
||||
OpenCL/common/lib/x64)
|
||||
endif()
|
||||
else()
|
||||
find_library(OpenCL_LIBRARY
|
||||
NAMES OpenCL)
|
||||
endif()
|
||||
|
||||
set(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
|
||||
set(OpenCL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIR})
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
find_package_handle_standard_args(
|
||||
OpenCL
|
||||
FOUND_VAR OpenCL_FOUND
|
||||
REQUIRED_VARS OpenCL_LIBRARY OpenCL_INCLUDE_DIR
|
||||
VERSION_VAR OpenCL_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(
|
||||
OpenCL_INCLUDE_DIR
|
||||
OpenCL_LIBRARY)
|
||||
@@ -39,6 +39,8 @@
|
||||
# License text for the above reference.)
|
||||
|
||||
set(_OPENMP_REQUIRED_VARS)
|
||||
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
|
||||
set(CMAKE_REQUIRED_QUIET ${OpenMP_FIND_QUIETLY})
|
||||
|
||||
function(_OPENMP_FLAG_CANDIDATES LANG)
|
||||
set(OpenMP_FLAG_CANDIDATES
|
||||
@@ -116,7 +118,9 @@ if(CMAKE_C_COMPILER_LOADED)
|
||||
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
|
||||
unset(OpenMP_FLAG_DETECTED CACHE)
|
||||
message(STATUS "Try OpenMP C flag = [${FLAG}]")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Try OpenMP C flag = [${FLAG}]")
|
||||
endif()
|
||||
check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
|
||||
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
|
||||
if(OpenMP_FLAG_DETECTED)
|
||||
@@ -150,7 +154,9 @@ if(CMAKE_CXX_COMPILER_LOADED)
|
||||
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
|
||||
unset(OpenMP_FLAG_DETECTED CACHE)
|
||||
message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
|
||||
if(NOT CMAKE_REQUIRED_QUIET)
|
||||
message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
|
||||
endif()
|
||||
check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
|
||||
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
|
||||
if(OpenMP_FLAG_DETECTED)
|
||||
@@ -167,6 +173,8 @@ if(CMAKE_CXX_COMPILER_LOADED)
|
||||
unset(OpenMP_CXX_TEST_SOURCE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
|
||||
|
||||
if(_OPENMP_REQUIRED_VARS)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
|
||||
|
||||
@@ -56,10 +56,8 @@ if(ZLIB_FOUND)
|
||||
list(APPEND PNG_NAMES png libpng)
|
||||
unset(PNG_NAMES_DEBUG)
|
||||
set(_PNG_VERSION_SUFFIXES 17 16 15 14 12)
|
||||
if (PNG_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\..*)?$")
|
||||
string(REGEX REPLACE
|
||||
"^([0-9]+)\\.([0-9]+).*" "\\1\\2"
|
||||
_PNG_VERSION_SUFFIX_MIN "${PNG_FIND_VERSION}")
|
||||
if (PNG_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)(\\..*)?$")
|
||||
set(_PNG_VERSION_SUFFIX_MIN "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
|
||||
if (PNG_FIND_VERSION_EXACT)
|
||||
set(_PNG_VERSION_SUFFIXES ${_PNG_VERSION_SUFFIX_MIN})
|
||||
else ()
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
function(FIND_PACKAGE_MESSAGE pkg msg details)
|
||||
# Avoid printing a message repeatedly for the same find result.
|
||||
if(NOT ${pkg}_FIND_QUIETLY)
|
||||
string(REGEX REPLACE "[\n]" "" details "${details}")
|
||||
string(REPLACE "\n" "" details "${details}")
|
||||
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
|
||||
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
|
||||
# The message has not yet been printed.
|
||||
|
||||
@@ -70,9 +70,9 @@ if(PERL_EXECUTABLE)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]")
|
||||
string(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
|
||||
set(PERL_VERSION_STRING "${CMAKE_MATCH_1}")
|
||||
elseif(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +")
|
||||
string(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
|
||||
set(PERL_VERSION_STRING "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
+285
-143
@@ -2,140 +2,20 @@
|
||||
# FindPkgConfig
|
||||
# -------------
|
||||
#
|
||||
# a pkg-config module for CMake
|
||||
# A `pkg-config` module for CMake.
|
||||
#
|
||||
# Finds the ``pkg-config`` executable and add the
|
||||
# :command:`pkg_check_modules` and :command:`pkg_search_module`
|
||||
# commands.
|
||||
#
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
|
||||
# checks for all the given modules
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# pkg_search_module(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
|
||||
# checks for given modules and uses the first working one
|
||||
#
|
||||
#
|
||||
#
|
||||
# When the 'REQUIRED' argument was set, macros will fail with an error
|
||||
# when module(s) could not be found
|
||||
#
|
||||
# When the 'QUIET' argument is set, no status messages will be printed.
|
||||
#
|
||||
# It sets the following variables:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# PKG_CONFIG_FOUND ... if pkg-config executable was found
|
||||
# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
|
||||
# PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
|
||||
# (since CMake 2.8.8)
|
||||
#
|
||||
#
|
||||
#
|
||||
# For the following variables two sets of values exist; first one is the
|
||||
# common one and has the given PREFIX. The second set contains flags
|
||||
# which are given out when pkgconfig was called with the '--static'
|
||||
# option.
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# <XPREFIX>_FOUND ... set to 1 if module(s) exist
|
||||
# <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
|
||||
# <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
|
||||
# <XPREFIX>_LDFLAGS ... all required linker flags
|
||||
# <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
|
||||
# <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
|
||||
# <XPREFIX>_CFLAGS ... all required cflags
|
||||
# <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# <XPREFIX> = <PREFIX> for common case
|
||||
# <XPREFIX> = <PREFIX>_STATIC for static linking
|
||||
#
|
||||
#
|
||||
#
|
||||
# There are some special variables whose prefix depends on the count of
|
||||
# given modules. When there is only one module, <PREFIX> stays
|
||||
# unchanged. When there are multiple modules, the prefix will be
|
||||
# changed to <PREFIX>_<MODNAME>:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# <XPREFIX>_VERSION ... version of the module
|
||||
# <XPREFIX>_PREFIX ... prefix-directory of the module
|
||||
# <XPREFIX>_INCLUDEDIR ... include-dir of the module
|
||||
# <XPREFIX>_LIBDIR ... lib-dir of the module
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# <XPREFIX> = <PREFIX> when |MODULES| == 1, else
|
||||
# <XPREFIX> = <PREFIX>_<MODNAME>
|
||||
#
|
||||
#
|
||||
#
|
||||
# A <MODULE> parameter can have the following formats:
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# {MODNAME} ... matches any version
|
||||
# {MODNAME}>={VERSION} ... at least version <VERSION> is required
|
||||
# {MODNAME}={VERSION} ... exactly version <VERSION> is required
|
||||
# {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
|
||||
#
|
||||
#
|
||||
#
|
||||
# Examples
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# pkg_check_modules (GLIB2 glib-2.0)
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# pkg_check_modules (GLIB2 glib-2.0>=2.10)
|
||||
# requires at least version 2.10 of glib2 and defines e.g.
|
||||
# GLIB2_VERSION=2.10.3
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
|
||||
# requires both glib2 and gtk2, and defines e.g.
|
||||
# FOO_glib-2.0_VERSION=2.10.3
|
||||
# FOO_gtk+-2.0_VERSION=2.8.20
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# pkg_check_modules (XRENDER REQUIRED xrender)
|
||||
# defines e.g.:
|
||||
# XRENDER_LIBRARIES=Xrender;X11
|
||||
# XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
|
||||
#
|
||||
#
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
|
||||
# In order to find the ``pkg-config`` executable, it uses the
|
||||
# :variable:`PKG_CONFIG_EXECUTABLE` variable or the ``PKG_CONFIG``
|
||||
# environment variable first.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
# Copyright 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
|
||||
# Copyright 2006-2014 Kitware, Inc.
|
||||
# Copyright 2014 Christoph Grüninger <foss@grueninger.de>
|
||||
# Copyright 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
@@ -150,6 +30,10 @@
|
||||
### Common stuff ####
|
||||
set(PKG_CONFIG_VERSION 1)
|
||||
|
||||
# find pkg-config, use PKG_CONFIG if set
|
||||
if((NOT PKG_CONFIG_EXECUTABLE) AND (NOT "$ENV{PKG_CONFIG}" STREQUAL ""))
|
||||
set(PKG_CONFIG_EXECUTABLE "$ENV{PKG_CONFIG}" CACHE FILEPATH "pkg-config executable")
|
||||
endif()
|
||||
find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
|
||||
mark_as_advanced(PKG_CONFIG_EXECUTABLE)
|
||||
|
||||
@@ -215,9 +99,20 @@ macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
|
||||
endmacro()
|
||||
|
||||
# Splits given arguments into options and a package list
|
||||
macro(_pkgconfig_parse_options _result _is_req _is_silent)
|
||||
macro(_pkgconfig_parse_options _result _is_req _is_silent _no_cmake_path _no_cmake_environment_path)
|
||||
set(${_is_req} 0)
|
||||
set(${_is_silent} 0)
|
||||
set(${_no_cmake_path} 0)
|
||||
set(${_no_cmake_environment_path} 0)
|
||||
if(DEFINED PKG_CONFIG_USE_CMAKE_PREFIX_PATH)
|
||||
if(NOT PKG_CONFIG_USE_CMAKE_PREFIX_PATH)
|
||||
set(${_no_cmake_path} 1)
|
||||
set(${_no_cmake_environment_path} 1)
|
||||
endif()
|
||||
elseif(${CMAKE_MINIMUM_REQUIRED_VERSION} VERSION_LESS 3.1)
|
||||
set(${_no_cmake_path} 1)
|
||||
set(${_no_cmake_environment_path} 1)
|
||||
endif()
|
||||
|
||||
foreach(_pkg ${ARGN})
|
||||
if (_pkg STREQUAL "REQUIRED")
|
||||
@@ -226,15 +121,48 @@ macro(_pkgconfig_parse_options _result _is_req _is_silent)
|
||||
if (_pkg STREQUAL "QUIET")
|
||||
set(${_is_silent} 1)
|
||||
endif ()
|
||||
if (_pkg STREQUAL "NO_CMAKE_PATH")
|
||||
set(${_no_cmake_path} 1)
|
||||
endif()
|
||||
if (_pkg STREQUAL "NO_CMAKE_ENVIRONMENT_PATH")
|
||||
set(${_no_cmake_environment_path} 1)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(${_result} ${ARGN})
|
||||
list(REMOVE_ITEM ${_result} "REQUIRED")
|
||||
list(REMOVE_ITEM ${_result} "QUIET")
|
||||
list(REMOVE_ITEM ${_result} "NO_CMAKE_PATH")
|
||||
list(REMOVE_ITEM ${_result} "NO_CMAKE_ENVIRONMENT_PATH")
|
||||
endmacro()
|
||||
|
||||
# Add the content of a variable or an environment variable to a list of
|
||||
# paths
|
||||
# Usage:
|
||||
# - _pkgconfig_add_extra_path(_extra_paths VAR)
|
||||
# - _pkgconfig_add_extra_path(_extra_paths ENV VAR)
|
||||
function(_pkgconfig_add_extra_path _extra_paths_var _var)
|
||||
set(_is_env 0)
|
||||
if(_var STREQUAL "ENV")
|
||||
set(_var ${ARGV2})
|
||||
set(_is_env 1)
|
||||
endif()
|
||||
if(NOT _is_env)
|
||||
if(NOT "${${_var}}" STREQUAL "")
|
||||
list(APPEND ${_extra_paths_var} ${CMAKE_PREFIX_PATH})
|
||||
endif()
|
||||
else()
|
||||
if(NOT "$ENV{${_var}}" STREQUAL "")
|
||||
file(TO_CMAKE_PATH "$ENV{${_var}}" _path)
|
||||
list(APPEND ${_extra_paths_var} ${_path})
|
||||
unset(_path)
|
||||
endif()
|
||||
endif()
|
||||
set(${_extra_paths_var} ${${_extra_paths_var}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
###
|
||||
macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
|
||||
macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cmake_environment_path _prefix)
|
||||
_pkgconfig_unset(${_prefix}_FOUND)
|
||||
_pkgconfig_unset(${_prefix}_VERSION)
|
||||
_pkgconfig_unset(${_prefix}_PREFIX)
|
||||
@@ -273,15 +201,86 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
|
||||
set(_pkg_check_modules_packages)
|
||||
set(_pkg_check_modules_failed)
|
||||
|
||||
set(_extra_paths)
|
||||
|
||||
if(NOT _no_cmake_path)
|
||||
_pkgconfig_add_extra_path(_extra_paths CMAKE_PREFIX_PATH)
|
||||
_pkgconfig_add_extra_path(_extra_paths CMAKE_FRAMEWORK_PATH)
|
||||
_pkgconfig_add_extra_path(_extra_paths CMAKE_APPBUNDLE_PATH)
|
||||
endif()
|
||||
|
||||
if(NOT _no_cmake_environment_path)
|
||||
_pkgconfig_add_extra_path(_extra_paths ENV CMAKE_PREFIX_PATH)
|
||||
_pkgconfig_add_extra_path(_extra_paths ENV CMAKE_FRAMEWORK_PATH)
|
||||
_pkgconfig_add_extra_path(_extra_paths ENV CMAKE_APPBUNDLE_PATH)
|
||||
endif()
|
||||
|
||||
if(NOT "${_extra_paths}" STREQUAL "")
|
||||
# Save the PKG_CONFIG_PATH environment variable, and add paths
|
||||
# from the CMAKE_PREFIX_PATH variables
|
||||
set(_pkgconfig_path_old $ENV{PKG_CONFIG_PATH})
|
||||
set(_pkgconfig_path ${_pkgconfig_path_old})
|
||||
if(NOT "${_pkgconfig_path}" STREQUAL "")
|
||||
file(TO_CMAKE_PATH "${_pkgconfig_path}" _pkgconfig_path)
|
||||
endif()
|
||||
|
||||
# Create a list of the possible pkgconfig subfolder (depending on
|
||||
# the system
|
||||
set(_lib_dirs)
|
||||
if(NOT DEFINED CMAKE_SYSTEM_NAME
|
||||
OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
|
||||
AND NOT CMAKE_CROSSCOMPILING))
|
||||
if(EXISTS "/etc/debian_version") # is this a debian system ?
|
||||
if(CMAKE_LIBRARY_ARCHITECTURE)
|
||||
list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig")
|
||||
endif()
|
||||
else()
|
||||
# not debian, chech the FIND_LIBRARY_USE_LIB64_PATHS property
|
||||
get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
|
||||
if(uselib64)
|
||||
list(APPEND _lib_dirs "lib64/pkgconfig")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
list(APPEND _lib_dirs "lib/pkgconfig")
|
||||
|
||||
# Check if directories exist and eventually append them to the
|
||||
# pkgconfig path list
|
||||
foreach(_prefix_dir ${_extra_paths})
|
||||
foreach(_lib_dir ${_lib_dirs})
|
||||
if(EXISTS "${_prefix_dir}/${_lib_dir}")
|
||||
list(APPEND _pkgconfig_path "${_prefix_dir}/${_lib_dir}")
|
||||
list(REMOVE_DUPLICATES _pkgconfig_path)
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
# Prepare and set the environment variable
|
||||
if(NOT "${_pkgconfig_path}" STREQUAL "")
|
||||
# remove empty values from the list
|
||||
list(REMOVE_ITEM _pkgconfig_path "")
|
||||
file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path)
|
||||
if(UNIX)
|
||||
string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}")
|
||||
string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}")
|
||||
endif()
|
||||
set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path})
|
||||
endif()
|
||||
|
||||
# Unset variables
|
||||
unset(_lib_dirs)
|
||||
unset(_pkgconfig_path)
|
||||
endif()
|
||||
|
||||
# iterate through module list and check whether they exist and match the required version
|
||||
foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})
|
||||
set(_pkg_check_modules_exist_query)
|
||||
|
||||
# check whether version is given
|
||||
if (_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
|
||||
string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
|
||||
string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op "${_pkg_check_modules_pkg}")
|
||||
string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver "${_pkg_check_modules_pkg}")
|
||||
if (_pkg_check_modules_pkg MATCHES "(.*[^><])(>=|=|<=)(.*)")
|
||||
set(_pkg_check_modules_pkg_name "${CMAKE_MATCH_1}")
|
||||
set(_pkg_check_modules_pkg_op "${CMAKE_MATCH_2}")
|
||||
set(_pkg_check_modules_pkg_ver "${CMAKE_MATCH_3}")
|
||||
else()
|
||||
set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
|
||||
set(_pkg_check_modules_pkg_op)
|
||||
@@ -338,7 +337,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
|
||||
if(_pkg_check_modules_failed)
|
||||
# fail when requested
|
||||
if (${_is_required})
|
||||
message(SEND_ERROR "A required package was not found")
|
||||
message(FATAL_ERROR "A required package was not found")
|
||||
endif ()
|
||||
else()
|
||||
# when we are here, we checked whether requested modules
|
||||
@@ -376,6 +375,14 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
|
||||
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags )
|
||||
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other )
|
||||
endif()
|
||||
|
||||
if(NOT "${_extra_paths}" STREQUAL "")
|
||||
# Restore the environment variable
|
||||
set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path})
|
||||
endif()
|
||||
|
||||
unset(_extra_paths)
|
||||
unset(_pkgconfig_path_old)
|
||||
else()
|
||||
if (${_is_required})
|
||||
message(SEND_ERROR "pkg-config tool not found")
|
||||
@@ -387,23 +394,138 @@ endmacro()
|
||||
### User visible macros start here
|
||||
###
|
||||
|
||||
###
|
||||
#[========================================[.rst:
|
||||
.. command:: pkg_check_modules
|
||||
|
||||
Checks for all the given modules. ::
|
||||
|
||||
pkg_check_modules(<PREFIX> [REQUIRED] [QUIET]
|
||||
[NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
|
||||
<MODULE> [<MODULE>]*)
|
||||
|
||||
|
||||
When the ``REQUIRED`` argument was set, macros will fail with an error
|
||||
when module(s) could not be found.
|
||||
|
||||
When the ``QUIET`` argument is set, no status messages will be printed.
|
||||
|
||||
By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or
|
||||
later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set, the
|
||||
:variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH`, and
|
||||
:variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables will
|
||||
be added to ``pkg-config`` search path.
|
||||
The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments
|
||||
disable this behavior for the cache variables and the environment
|
||||
variables, respectively.
|
||||
|
||||
It sets the following variables: ::
|
||||
|
||||
PKG_CONFIG_FOUND ... if pkg-config executable was found
|
||||
PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
|
||||
PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
|
||||
(since CMake 2.8.8)
|
||||
|
||||
For the following variables two sets of values exist; first one is the
|
||||
common one and has the given PREFIX. The second set contains flags
|
||||
which are given out when ``pkg-config`` was called with the ``--static``
|
||||
option. ::
|
||||
|
||||
<XPREFIX>_FOUND ... set to 1 if module(s) exist
|
||||
<XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
|
||||
<XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
|
||||
<XPREFIX>_LDFLAGS ... all required linker flags
|
||||
<XPREFIX>_LDFLAGS_OTHER ... all other linker flags
|
||||
<XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
|
||||
<XPREFIX>_CFLAGS ... all required cflags
|
||||
<XPREFIX>_CFLAGS_OTHER ... the other compiler flags
|
||||
|
||||
::
|
||||
|
||||
<XPREFIX> = <PREFIX> for common case
|
||||
<XPREFIX> = <PREFIX>_STATIC for static linking
|
||||
|
||||
There are some special variables whose prefix depends on the count of
|
||||
given modules. When there is only one module, <PREFIX> stays
|
||||
unchanged. When there are multiple modules, the prefix will be
|
||||
changed to <PREFIX>_<MODNAME>: ::
|
||||
|
||||
<XPREFIX>_VERSION ... version of the module
|
||||
<XPREFIX>_PREFIX ... prefix-directory of the module
|
||||
<XPREFIX>_INCLUDEDIR ... include-dir of the module
|
||||
<XPREFIX>_LIBDIR ... lib-dir of the module
|
||||
|
||||
::
|
||||
|
||||
<XPREFIX> = <PREFIX> when |MODULES| == 1, else
|
||||
<XPREFIX> = <PREFIX>_<MODNAME>
|
||||
|
||||
A <MODULE> parameter can have the following formats: ::
|
||||
|
||||
{MODNAME} ... matches any version
|
||||
{MODNAME}>={VERSION} ... at least version <VERSION> is required
|
||||
{MODNAME}={VERSION} ... exactly version <VERSION> is required
|
||||
{MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
|
||||
|
||||
Examples
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
pkg_check_modules (GLIB2 glib-2.0)
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
pkg_check_modules (GLIB2 glib-2.0>=2.10)
|
||||
|
||||
Requires at least version 2.10 of glib2 and defines e.g.
|
||||
``GLIB2_VERSION=2.10.3``
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
|
||||
|
||||
Requires both glib2 and gtk2, and defines e.g.
|
||||
``FOO_glib-2.0_VERSION=2.10.3`` and ``FOO_gtk+-2.0_VERSION=2.8.20``
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
pkg_check_modules (XRENDER REQUIRED xrender)
|
||||
|
||||
Defines e.g.:
|
||||
``XRENDER_LIBRARIES=Xrender;X11`` and
|
||||
``XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp``
|
||||
#]========================================]
|
||||
macro(pkg_check_modules _prefix _module0)
|
||||
# check cached value
|
||||
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
|
||||
_pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN})
|
||||
_pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" "${_prefix}" ${_pkg_modules})
|
||||
_pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path "${_module0}" ${ARGN})
|
||||
_pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" ${_no_cmake_path} ${_no_cmake_environment_path} "${_prefix}" ${_pkg_modules})
|
||||
|
||||
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
###
|
||||
|
||||
#[========================================[.rst:
|
||||
.. command:: pkg_search_module
|
||||
|
||||
Same as :command:`pkg_check_modules`, but instead it checks for given
|
||||
modules and uses the first working one. ::
|
||||
|
||||
pkg_search_module(<PREFIX> [REQUIRED] [QUIET]
|
||||
[NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
|
||||
<MODULE> [<MODULE>]*)
|
||||
|
||||
Examples
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
|
||||
#]========================================]
|
||||
macro(pkg_search_module _prefix _module0)
|
||||
# check cached value
|
||||
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
|
||||
set(_pkg_modules_found 0)
|
||||
_pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN})
|
||||
_pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path "${_module0}" ${ARGN})
|
||||
|
||||
if (NOT ${_pkg_is_silent})
|
||||
message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
|
||||
@@ -412,7 +534,7 @@ macro(pkg_search_module _prefix _module0)
|
||||
# iterate through all modules and stop at the first working one.
|
||||
foreach(_pkg_alt ${_pkg_modules_alt})
|
||||
if(NOT _pkg_modules_found)
|
||||
_pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}")
|
||||
_pkg_check_modules_internal(0 1 ${_no_cmake_path} ${_no_cmake_environment_path} "${_prefix}" "${_pkg_alt}")
|
||||
endif()
|
||||
|
||||
if (${_prefix}_FOUND)
|
||||
@@ -430,6 +552,26 @@ macro(pkg_search_module _prefix _module0)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
#[========================================[.rst:
|
||||
.. variable:: PKG_CONFIG_EXECUTABLE
|
||||
|
||||
Path to the pkg-config executable.
|
||||
|
||||
|
||||
.. variable:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH
|
||||
|
||||
Whether :command:`pkg_check_modules` and :command:`pkg_search_module`
|
||||
should add the paths in :variable:`CMAKE_PREFIX_PATH`,
|
||||
:variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH`
|
||||
cache and environment variables to ``pkg-config`` search path.
|
||||
|
||||
If this variable is not set, this behavior is enabled by default if
|
||||
:variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled
|
||||
otherwise.
|
||||
#]========================================]
|
||||
|
||||
|
||||
### Local Variables:
|
||||
### mode: cmake
|
||||
### End:
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
# of version numbers that should be taken into account when searching
|
||||
# for Python. You need to set this variable before calling
|
||||
# find_package(PythonInterp).
|
||||
#
|
||||
# If also calling find_package(PythonLibs), call find_package(PythonInterp)
|
||||
# first to get the currently active Python version by default with a consistent
|
||||
# version of PYTHON_LIBRARIES.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2010 Kitware, Inc.
|
||||
@@ -71,18 +75,23 @@ if(PythonInterp_FIND_VERSION)
|
||||
else()
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
|
||||
endif()
|
||||
|
||||
list(APPEND _Python_NAMES python)
|
||||
|
||||
# Search for the current active python version first
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
|
||||
|
||||
# Set up the versions we know about, in the order we will search. Always add
|
||||
# the user supplied additional versions to the front.
|
||||
set(_Python_VERSIONS
|
||||
${Python_ADDITIONAL_VERSIONS}
|
||||
${_PYTHON_FIND_OTHER_VERSIONS}
|
||||
)
|
||||
set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
|
||||
# If FindPythonInterp has already found the major and minor version,
|
||||
# insert that version next to get consistent versions of the interpreter and
|
||||
# library.
|
||||
if(DEFINED PYTHONLIBS_VERSION_STRING)
|
||||
string(REPLACE "." ";" _PYTHONLIBS_VERSION "${PYTHONLIBS_VERSION_STRING}")
|
||||
list(GET _PYTHONLIBS_VERSION 0 _PYTHONLIBS_VERSION_MAJOR)
|
||||
list(GET _PYTHONLIBS_VERSION 1 _PYTHONLIBS_VERSION_MINOR)
|
||||
list(APPEND _Python_VERSIONS ${_PYTHONLIBS_VERSION_MAJOR}.${_PYTHONLIBS_VERSION_MINOR})
|
||||
endif()
|
||||
# Search for the current active python version first
|
||||
list(APPEND _Python_VERSIONS ";")
|
||||
list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
|
||||
|
||||
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
||||
unset(_PYTHON1_VERSIONS)
|
||||
@@ -91,7 +100,7 @@ unset(_PYTHON3_VERSIONS)
|
||||
|
||||
# Search for newest python version if python executable isn't found
|
||||
if(NOT PYTHON_EXECUTABLE)
|
||||
foreach(_CURRENT_VERSION ${_Python_VERSIONS})
|
||||
foreach(_CURRENT_VERSION IN LISTS _Python_VERSIONS)
|
||||
set(_Python_NAMES python${_CURRENT_VERSION})
|
||||
if(WIN32)
|
||||
list(APPEND _Python_NAMES python)
|
||||
@@ -129,8 +138,8 @@ if(PYTHON_EXECUTABLE)
|
||||
string(REGEX REPLACE " .*" "" PYTHON_VERSION_STRING "${_VERSION}")
|
||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.([0-9])+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}")
|
||||
if(PYTHON_VERSION_STRING MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+.*")
|
||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}")
|
||||
if(PYTHON_VERSION_STRING MATCHES "^[0-9]+\\.[0-9]+\\.([0-9]+)")
|
||||
set(PYTHON_VERSION_PATCH "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
set(PYTHON_VERSION_PATCH "0")
|
||||
endif()
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
#
|
||||
# PYTHON_LIBRARY - path to the python library
|
||||
# PYTHON_INCLUDE_DIR - path to where Python.h is found
|
||||
#
|
||||
# If also calling find_package(PythonInterp), call find_package(PythonInterp)
|
||||
# first to get the currently active Python version by default with a consistent
|
||||
# version of PYTHON_LIBRARIES.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2001-2009 Kitware, Inc.
|
||||
@@ -80,10 +84,14 @@ endif()
|
||||
|
||||
# Set up the versions we know about, in the order we will search. Always add
|
||||
# the user supplied additional versions to the front.
|
||||
set(_Python_VERSIONS
|
||||
${Python_ADDITIONAL_VERSIONS}
|
||||
${_PYTHON_FIND_OTHER_VERSIONS}
|
||||
)
|
||||
# If FindPythonInterp has already found the major and minor version,
|
||||
# insert that version between the user supplied versions and the stock
|
||||
# version list.
|
||||
set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
|
||||
if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
|
||||
list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
endif()
|
||||
list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
|
||||
|
||||
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
||||
unset(_PYTHON1_VERSIONS)
|
||||
|
||||
@@ -87,7 +87,7 @@ find_program(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin
|
||||
if(QT_QMAKE_EXECUTABLE_FINDQT)
|
||||
exec_program(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION"
|
||||
OUTPUT_VARIABLE QTVERSION)
|
||||
if(QTVERSION MATCHES "4.*")
|
||||
if(QTVERSION MATCHES "4")
|
||||
set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "Qt4 qmake program.")
|
||||
set(QT4_INSTALLED TRUE)
|
||||
endif()
|
||||
@@ -154,12 +154,12 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DESIRED_QT_VERSION MATCHES 3)
|
||||
if(DESIRED_QT_VERSION EQUAL 3)
|
||||
set(Qt3_FIND_REQUIRED ${Qt_FIND_REQUIRED})
|
||||
set(Qt3_FIND_QUIETLY ${Qt_FIND_QUIETLY})
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindQt3.cmake)
|
||||
endif()
|
||||
if(DESIRED_QT_VERSION MATCHES 4)
|
||||
if(DESIRED_QT_VERSION EQUAL 4)
|
||||
set(Qt4_FIND_REQUIRED ${Qt_FIND_REQUIRED})
|
||||
set(Qt4_FIND_QUIETLY ${Qt_FIND_QUIETLY})
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindQt4.cmake)
|
||||
|
||||
@@ -295,12 +295,12 @@ if(QT_UIC_EXECUTABLE)
|
||||
endif()
|
||||
|
||||
set(_QT_UIC_VERSION_3 FALSE)
|
||||
if("${QTVERSION_UIC}" MATCHES ".* 3..*")
|
||||
if("${QTVERSION_UIC}" MATCHES " 3.")
|
||||
set(_QT_UIC_VERSION_3 TRUE)
|
||||
endif()
|
||||
|
||||
set(_QT_MOC_VERSION_3 FALSE)
|
||||
if("${QTVERSION_MOC}" MATCHES ".* 3..*")
|
||||
if("${QTVERSION_MOC}" MATCHES " 3.")
|
||||
set(_QT_MOC_VERSION_3 TRUE)
|
||||
endif()
|
||||
|
||||
|
||||
+11
-9
@@ -335,6 +335,7 @@ endif()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSymbolExists.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
|
||||
set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
|
||||
|
||||
@@ -613,9 +614,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
|
||||
set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
|
||||
set(QT_QTCORE_FOUND 1)
|
||||
else()
|
||||
message(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" "
|
||||
"but QtCore could not be found there. "
|
||||
"Qt is NOT installed correctly for the target build environment.")
|
||||
if(NOT Qt4_FIND_QUIETLY)
|
||||
message(WARNING
|
||||
"${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as "
|
||||
"\"${QT_LIBRARY_DIR_TMP}\" "
|
||||
"but QtCore could not be found there. "
|
||||
"Qt is NOT installed correctly for the target build environment.")
|
||||
endif()
|
||||
set(Qt4_FOUND FALSE)
|
||||
if(Qt4_FIND_REQUIRED)
|
||||
message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
|
||||
@@ -747,11 +752,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
|
||||
# Find out what window system we're using
|
||||
#
|
||||
#############################################
|
||||
# Save required variable
|
||||
set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
|
||||
set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
|
||||
cmake_push_check_state()
|
||||
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
|
||||
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
|
||||
set(CMAKE_REQUIRED_QUIET ${Qt4_FIND_QUIETLY})
|
||||
# Check for Window system symbols (note: only one should end up being set)
|
||||
CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
|
||||
CHECK_CXX_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
|
||||
@@ -771,9 +775,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
|
||||
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
|
||||
cmake_pop_check_state()
|
||||
#
|
||||
#############################################
|
||||
|
||||
|
||||
@@ -54,7 +54,9 @@ find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h
|
||||
HINTS
|
||||
ENV SDLIMAGEDIR
|
||||
ENV SDLDIR
|
||||
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
|
||||
PATH_SUFFIXES SDL
|
||||
# path suffixes to search inside ENV{SDLDIR}
|
||||
include/SDL include/SDL12 include/SDL11 include
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
@@ -54,7 +54,9 @@ find_path(SDL_MIXER_INCLUDE_DIR SDL_mixer.h
|
||||
HINTS
|
||||
ENV SDLMIXERDIR
|
||||
ENV SDLDIR
|
||||
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
|
||||
PATH_SUFFIXES SDL
|
||||
# path suffixes to search inside ENV{SDLDIR}
|
||||
include/SDL include/SDL12 include/SDL11 include
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
@@ -54,7 +54,9 @@ find_path(SDL_NET_INCLUDE_DIR SDL_net.h
|
||||
HINTS
|
||||
ENV SDLNETDIR
|
||||
ENV SDLDIR
|
||||
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
|
||||
PATH_SUFFIXES SDL
|
||||
# path suffixes to search inside ENV{SDLDIR}
|
||||
include/SDL include/SDL12 include/SDL11 include
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
@@ -98,7 +98,9 @@ find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h
|
||||
HINTS
|
||||
ENV SDLSOUNDDIR
|
||||
ENV SDLDIR
|
||||
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
|
||||
PATH_SUFFIXES SDL
|
||||
# path suffixes to search inside ENV{SDLDIR}
|
||||
include/SDL include/SDL12 include/SDL11 include
|
||||
)
|
||||
|
||||
find_library(SDL_SOUND_LIBRARY
|
||||
|
||||
@@ -54,7 +54,9 @@ find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
|
||||
HINTS
|
||||
ENV SDLTTFDIR
|
||||
ENV SDLDIR
|
||||
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
|
||||
PATH_SUFFIXES SDL
|
||||
# path suffixes to search inside ENV{SDLDIR}
|
||||
include/SDL include/SDL12 include/SDL11 include
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
@@ -184,7 +184,7 @@ if(SQUISH_CLIENT_EXECUTABLE)
|
||||
execute_process(COMMAND "${SQUISH_CLIENT_EXECUTABLE}" --version
|
||||
OUTPUT_VARIABLE _squishVersionOutput
|
||||
ERROR_QUIET )
|
||||
if("${_squishVersionOutput}" MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+).*$")
|
||||
if("${_squishVersionOutput}" MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
|
||||
set(SQUISH_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
set(SQUISH_VERSION_MINOR "${CMAKE_MATCH_2}")
|
||||
set(SQUISH_VERSION_PATCH "${CMAKE_MATCH_3}")
|
||||
|
||||
+24
-22
@@ -37,9 +37,11 @@ include (CheckIncludeFiles)
|
||||
include (CheckLibraryExists)
|
||||
include (CheckSymbolExists)
|
||||
set(Threads_FOUND FALSE)
|
||||
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
|
||||
set(CMAKE_REQUIRED_QUIET ${Threads_FIND_QUIETLY})
|
||||
|
||||
# Do we have sproc?
|
||||
if(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
|
||||
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
|
||||
endif()
|
||||
|
||||
@@ -63,32 +65,31 @@ else()
|
||||
set(CMAKE_THREAD_LIBS_INIT "")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
else()
|
||||
|
||||
if(NOT CMAKE_HAVE_THREADS_LIBRARY)
|
||||
# Do we have -lpthreads
|
||||
CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
|
||||
if(CMAKE_HAVE_PTHREADS_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lpthreads")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
else()
|
||||
|
||||
# Ok, how about -lpthread
|
||||
CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
|
||||
if(CMAKE_HAVE_PTHREAD_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "SunOS.*")
|
||||
# On sun also check for -lthread
|
||||
CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
|
||||
if(CMAKE_HAVE_THR_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lthread")
|
||||
# Ok, how about -lpthread
|
||||
CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
|
||||
if(CMAKE_HAVE_PTHREAD_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||
# On sun also check for -lthread
|
||||
CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
|
||||
if(CMAKE_HAVE_THR_CREATE)
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lthread")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -96,7 +97,7 @@ else()
|
||||
|
||||
if(NOT CMAKE_HAVE_THREADS_LIBRARY)
|
||||
# If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
|
||||
if("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
|
||||
if("x${THREADS_HAVE_PTHREAD_ARG}" STREQUAL "x")
|
||||
message(STATUS "Check if compiler accepts -pthread")
|
||||
try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
|
||||
${CMAKE_BINARY_DIR}
|
||||
@@ -137,13 +138,13 @@ if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "Windows")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(CMAKE_USE_WIN32_THREADS_INIT 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_USE_PTHREADS_INIT)
|
||||
if(CMAKE_SYSTEM MATCHES "HP-UX-*")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
|
||||
# Use libcma if it exists and can be used. It provides more
|
||||
# symbols than the plain pthread library. CMA threads
|
||||
# have actually been deprecated:
|
||||
@@ -161,12 +162,12 @@ if(CMAKE_USE_PTHREADS_INIT)
|
||||
set(CMAKE_USE_PTHREADS_INIT 1)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "OSF1-V*")
|
||||
if(CMAKE_SYSTEM MATCHES "OSF1-V")
|
||||
set(CMAKE_USE_PTHREADS_INIT 0)
|
||||
set(CMAKE_THREAD_LIBS_INIT )
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "CYGWIN_NT*")
|
||||
if(CMAKE_SYSTEM MATCHES "CYGWIN_NT")
|
||||
set(CMAKE_USE_PTHREADS_INIT 1)
|
||||
set(Threads_FOUND TRUE)
|
||||
set(CMAKE_THREAD_LIBS_INIT )
|
||||
@@ -174,5 +175,6 @@ if(CMAKE_USE_PTHREADS_INIT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user