Commits (13)
......@@ -74,6 +74,7 @@ License File format:
#include <QString>
#include <QCryptographicHash>
#include <QNetworkInterface>
#include <QTime>
#include <limits>
......
......@@ -46,10 +46,12 @@ endif( WIN32 )
if (UNIX)
set ( ADDITIONAL_CXX_FLAGS )
set ( ADDITIONAL_CXX_DEBUG_FLAGS )
set ( ADDITIONAL_CXX_RELEASE_FLAGS )
set ( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS )
set ( ADDITIONAL_C_FLAGS )
set ( ADDITIONAL_C_DEBUG_FLAGS )
set ( ADDITIONAL_C_RELEASE_FLAGS )
set ( ADDITIONAL_C_RELWITHDEBINFO_FLAGS )
......@@ -59,28 +61,21 @@ if (UNIX)
################################################################################
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_FLAGS "-DINCLUDE_TEMPLATES" )
# Deprecated setting. Remove in future release, as the default template depth
# should be enough with state of the art compilers
# Increase the template depth as this might be exceeded from time to time
#IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
# list(APPEND ADDITIONAL_CXX_FLAGS "-ftemplate-depth-100" )
#ENDIF()
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-DINCLUDE_TEMPLATES" )
# Deprecated setting. Remove in future release, as the default template depth
# should be enough with state of the art compilers
# # Increase the template depth as this might be exceeded from time to time
# IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
# list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-ftemplate-depth-100" )
# list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-ftemplate-depth-100" )
# list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-ftemplate-depth-100" )
# ENDIF()
################################################################################
# OS Defines
################################################################################
if (APPLE)
add_definitions( -DARCH_DARWIN )
endif()
......@@ -101,7 +96,7 @@ if (UNIX)
################################################################################
# Warnings
################################################################################
# Add the standard compiler warnings
if ( NOT COMPILER_WARNINGS )
......@@ -114,18 +109,13 @@ if (UNIX)
set ( COMPILER_WARNINGS "" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
ELSE ()
set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
ENDIF()
ENDIF()
endif ( NOT COMPILER_WARNINGS )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_CXX_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_FLAGS ${COMPILER_WARNINGS} )
################################################################################
# STL Vector checks
################################################################################
......@@ -153,43 +143,49 @@ if (UNIX)
################################################################################
# Add the debug flags
foreach( flag ${ADDITIONAL_CXX_DEBUG_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_DEBUG_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_CXX_RELEASE_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_RELEASE MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELEASE_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
# Add the debug flags
foreach( flag ${ADDITIONAL_C_DEBUG_FLAGS} )
if( NOT CMAKE_C_FLAGS_DEBUG MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_DEBUG_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_C_RELEASE_FLAGS} )
if( NOT CMAKE_C_FLAGS_RELEASE MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELEASE_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
if( NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
......@@ -199,5 +195,5 @@ if (UNIX)
set (CMAKE_CFLAGS_RELEASE "-xO3")
set (CMAKE_CXX_FLAGS_RELEASE "-xO3")
endif ( CMAKE_SYSTEM MATCHES "SunOS*" )
endif ()
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
# This macro is intended to be used in FindXXX.cmake modules files.
# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
# it also sets the <UPPERCASED_NAME>_FOUND variable.
# The package is found if all variables listed are TRUE.
# Example:
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
#
# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and
# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
# independent whether QUIET was used or not.
# If it is found, the location is reported using the VAR1 argument, so
# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
# If the second argument is DEFAULT_MSG, the message in the failure case will
# be "Could NOT find LibXml2", if you don't like this message you can specify
# your own custom failure message there.
macro(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
if("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
set(_FAIL_MESSAGE "Could NOT find ${_NAME}")
else()
set(_FAIL_MESSAGE "${_FAIL_MSG}")
endif()
string(TOUPPER ${_NAME} _NAME_UPPER)
set(${_NAME_UPPER}_FOUND TRUE)
if(NOT ${_VAR1})
set(${_NAME_UPPER}_FOUND FALSE)
endif()
foreach(_CURRENT_VAR ${ARGN})
if(NOT ${_CURRENT_VAR})
set(${_NAME_UPPER}_FOUND FALSE)
endif()
endforeach()
if (${_NAME_UPPER}_FOUND)
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "Found ${_NAME}: ${${_VAR1}}")
endif()
else()
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_FAIL_MESSAGE}")
else()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_FAIL_MESSAGE}")
endif()
endif()
endif()
endmacro()
if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED )
set( CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED 1 )
message( STATUS "Targetting ${CMAKE_GENERATOR}")
if ( MSVC )
message( STATUS "Target build enviroment supports auto-linking" )
set(CGAL_AUTO_LINK_ENABLED TRUE)
endif()
if ( MSVC15 )
set(CGAL_TOOLSET "vc150")
message( STATUS "Using VC15 compiler." )
elseif ( MSVC14 )
set(CGAL_TOOLSET "vc140")
message( STATUS "Using VC14 compiler." )
elseif ( MSVC12 )
set(CGAL_TOOLSET "vc120")
message( STATUS "Using VC12 compiler." )
elseif ( MSVC11 )
set(CGAL_TOOLSET "vc110")
message( STATUS "Using VC11 compiler." )
elseif ( MSVC10 )
set(CGAL_TOOLSET "vc100")
message( STATUS "Using VC10 compiler." )
elseif ( MSVC90 )
set(CGAL_TOOLSET "vc90")
message( STATUS "Using VC90 compiler." )
elseif ( MSVC80 )
set(CGAL_TOOLSET "vc80")
message( STATUS "Using VC80 compiler." )
elseif ( MSVC71 )
set(CGAL_TOOLSET "vc71")
message( STATUS "Using VC71 compiler." )
else()
message( STATUS "Using ${CMAKE_CXX_COMPILER} compiler." )
endif()
# From james Bigler, in the cmake users list.
IF (APPLE)
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
message(STATUS "DARWIN_VERSION=${DARWIN_VERSION}")
if (DARWIN_VERSION GREATER 8)
message(STATUS "Mac Leopard detected")
set(CGAL_APPLE_LEOPARD 1)
endif()
endif()
if ( NOT "${CMAKE_CFG_INTDIR}" STREQUAL "." )
set(HAS_CFG_INTDIR TRUE CACHE INTERNAL "Generator uses intermediate configuration directory" )
message( STATUS "Generator uses intermediate configuration directory: ${CMAKE_CFG_INTDIR}" )
endif()
endif()
# Find TAUCS library shipped with CGAL
#
# This module searches for TAUCS in CGAL "auxiliary" folder
# and in in $CGAL_TAUCS_DIR environment variable.
#
# This module sets the following variables:
# CGAL_TAUCS_FOUND - set to true if TAUCS library shipped with CGAL
# is found
# CGAL_TAUCS_PLATFORM - name of TAUCS subfolder corresponding to the current compiler
# CGAL_TAUCS_INCLUDE_DIR - list of folders (using full path name) containing
# TAUCS (and optionaly BLAS and LAPACK) headers
# CGAL_TAUCS_LIBRARIES_DIR -list of folders (using full path name) containing
# TAUCS (and optionaly BLAS and LAPACK) libraries
include(CGAL_Macros)
if ( NOT CGAL_TAUCS_FOUND )
#
# Find out TAUCS name for the current platform.
# This code is a translation of TAUCS "configure" script.
#
# The first task is to figure out CMAKE_SYSTEM_NAME
# (on unix this is uname -s, for windows it is Windows).
#message("DEBUG: CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
#message("DEBUG: CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
set( CGAL_TAUCS_PLATFORM "${CMAKE_SYSTEM_NAME}" )
# Convert to lower case
STRING(TOLOWER "${CGAL_TAUCS_PLATFORM}" CGAL_TAUCS_PLATFORM)
# Sometimes uname returns a value that is
# inconsistent with the way CGAL_TAUCS_PLATFORM is set. For example, on
# Solaris, CGAL_TAUCS_PLATFORM=solaris but uname returns SunOS.
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "sunos" )
set( CGAL_TAUCS_PLATFORM "solaris" )
endif()
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "windows" )
set( CGAL_TAUCS_PLATFORM "win32" )
endif()
# LS 2007: added "darwin_intel" for Intel Macs.
# "darwin" = original Darwin platform = PowerPC architecture.
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "darwin" )
# CMAKE_SYSTEM_PROCESSOR=uname -p
if ( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386" )
set( CGAL_TAUCS_PLATFORM "darwin_intel" )
endif()
endif()
# LS 2007: append "64" if 64 bits processor (tested on Linux only)
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "linux" )
# CMAKE_SYSTEM_PROCESSOR=uname -p
if ( ${CMAKE_SYSTEM_PROCESSOR} MATCHES ".*64.*" )
set( CGAL_TAUCS_PLATFORM "${CGAL_TAUCS_PLATFORM}64" )
endif()
endif()
#message("DEBUG: CGAL_TAUCS_PLATFORM = ${CGAL_TAUCS_PLATFORM}")
#
# Search for TAUCS folder.
#
#message("DEBUG: CGAL_SOURCE_DIRECTORY = ${CGAL_SOURCE_DIRECTORY}")
# VC++ uses auto-link, thus we search for a folder containing the output of
# build_taucs_win32_for_CGAL.bat/build_taucs_win64_for_CGAL.bat,
# ie TAUCS libraries compiled for all Windows runtimes.
if ( MSVC )
# Check $CGAL_TAUCS_DIR environment variable
fetch_env_var(CGAL_TAUCS_DIR)
#message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}")
if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR})
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/include")
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/lib" )
set( CGAL_TAUCS_FOUND TRUE )
# Else, search for TAUCS in CGAL "auxiliary" folder
elseif ( EXISTS "${CGAL_SOURCE_DIRECTORY}/auxiliary/taucs" )
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_SOURCE_DIRECTORY}/auxiliary/taucs/include")
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_SOURCE_DIRECTORY}/auxiliary/taucs/lib" )
set( CGAL_TAUCS_FOUND TRUE )
endif()
# On Unix, search for TAUCS "taucs_full" folder
else ( MSVC )
# Check $CGAL_TAUCS_DIR environment variable
fetch_env_var(CGAL_TAUCS_DIR)
#message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}")
if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR})
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/build/${CGAL_TAUCS_PLATFORM}"
"${CGAL_TAUCS_DIR}/src" )
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}"
"${CGAL_TAUCS_DIR}/lib/${CGAL_TAUCS_PLATFORM}" )
set( CGAL_TAUCS_FOUND TRUE )
endif()
endif ( MSVC )
# Add variables to cache
set( CGAL_TAUCS_DIR "${CGAL_TAUCS_DIR}"
CACHE PATH "Directory containing BLAS, LAPACK and TAUCS" )
#message("DEBUG: CGAL_TAUCS_INCLUDE_DIR = ${CGAL_TAUCS_INCLUDE_DIR}")
#message("DEBUG: CGAL_TAUCS_LIBRARIES_DIR = ${CGAL_TAUCS_LIBRARIES_DIR}")
#message("DEBUG: CGAL_TAUCS_FOUND = ${CGAL_TAUCS_FOUND}")
endif ( NOT CGAL_TAUCS_FOUND )
if( NOT CGAL_MACROS_FILE_INCLUDED )
set(CGAL_MACROS_FILE_INCLUDED 1 )
macro(assert _arg )
if ( NOT ${_arg} )
message( FATAL_ERROR "Variable ${_arg} must be defined" )
endif()
endmacro()
macro( hide_variable var )
set ( ${var} ${${var}} CACHE INTERNAL "Variable hidden from user" FORCE )
endmacro()
macro( cache_set var )
set ( ${var} ${ARGN} CACHE INTERNAL "" )
set ( ${var} ${ARGN} CACHE INTERNAL "" )
endmacro()
macro( typed_cache_set type doc var )
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
endmacro()
macro( cache_get var )
set ( ${var} )
endmacro()
# Splits inlist in the first element (head) and the rest (tail)
macro( list_split head tail )
set( ${head} )
set( ${tail} )
set( _LS_is_head TRUE )
foreach( _LS_item ${ARGN} )
if ( _LS_is_head )
set( ${head} ${_LS_item} )
set( _LS_is_head FALSE )
else()
list( APPEND ${tail} ${_LS_item} )
endif()
endforeach()
endmacro()
# adds elements to an internal cached list
macro( add_to_cached_list listname )
cache_get ( ${listname} )
set( _ATC_${listname}_tmp ${${listname}} )
if ( NOT "${ARGN}" STREQUAL "" )
list( APPEND _ATC_${listname}_tmp ${ARGN} )
endif()
cache_set ( ${listname} ${_ATC_${listname}_tmp} )
endmacro()
# adds elements to an in-memory variable named 'listname'
macro( add_to_memory_list listname )
if ( NOT "${ARGN}" STREQUAL "" )
list( APPEND ${listname} ${ARGN} )
endif()
endmacro()
# adds elements to a list.
# If the first argument after 'listname' is PERSISTENT then 'listname'
# is a persistent internal cached variable, otherwise is a memory variable.
macro( add_to_list listname )
list_split( _ATL_ARGN_HEAD _ATL_ARGN_TAIL ${ARGN} )
if ( "${_ATL_ARGN_HEAD}" STREQUAL "PERSISTENT" )
add_to_cached_list( ${listname} ${_ATL_ARGN_TAIL} )
else()
add_to_memory_list( ${listname} ${ARGN} )
endif()
endmacro()
macro( at list idx var )
list( LENGTH ${list} ${list}_length )
if ( ${idx} LESS ${${list}_length} )
list( GET ${list} ${idx} ${var} )
else()
set( ${var} "NOTFOUND" )
endif()
endmacro()
macro( found_in_list item_list item result )
set( ${result} "FALSE" )
foreach( element ${${item_list}} )
if ( "${element}" STREQUAL "${item}" )
set( ${result} "TRUE" )
endif()
endforeach()
endmacro()
macro( uniquely_add_flags target_var )
if ( "${ARGC}" GREATER "1" )
set( target_list "${${target_var}}" )
set( source_list "${ARGN}" )
separate_arguments( target_list )
separate_arguments( source_list )
foreach( flag ${source_list} )
found_in_list( target_list ${flag} ${flag}_FOUND )
if ( NOT ${flag}_FOUND )
typed_cache_set( STRING "User-defined flags" ${target_var} "${${target_var}} ${flag}" )
endif()
endforeach()
endif()
endmacro()
macro( get_dependency_version LIB )
if ( "${ARGC}" GREATER "1" )
set( PKG ${ARGV1} )
else()
set( PKG ${LIB} )
endif()
if ( ${PKG}_FOUND )
set ( ${LIB}_VERSION "unknown" )
try_run( ${LIB}_RUN_RES
${LIB}_COMPILE_RES
"${CMAKE_BINARY_DIR}"
"${CMAKE_SOURCE_DIR}/config/support/print_${LIB}_version.cpp"
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${${PKG}_DEPENDENCY_INCLUDE_DIR};${${PKG}_INCLUDE_DIR}"
"-DLINK_LIBRARIES:STRING=${${PKG}_DEPENDENCY_LIBRARIES};${${PKG}_LIBRARIES}"
"-DLINK_DIRECTORIES:STRING=${${PKG}_DEPENDENCY_LIBRARY_DIR};${${PKG}_LIBRARY_DIR}"
OUTPUT_VARIABLE ${LIB}_OUTPUT
)
if ( ${LIB}_COMPILE_RES )
if ( ${LIB}_RUN_RES EQUAL "0" )
string( REGEX MATCH "version=.*\$" ${LIB}_VERSION_LINE ${${LIB}_OUTPUT} )
string( REPLACE "\n" "" ${LIB}_VERSION_LINE2 ${${LIB}_VERSION_LINE} )
string( REPLACE "\r" "" ${LIB}_VERSION_LINE3 ${${LIB}_VERSION_LINE2} )
string( REPLACE "version=" "" ${LIB}_VERSION ${${LIB}_VERSION_LINE3} )
else()
message( STATUS "WARNING: ${LIB} found but print_${LIB}_version.cpp exited with error condition: ${${LIB}_RUN_RES}" )
message( STATUS "${PKG}_INCLUDE_DIR=${${PKG}_INCLUDE_DIR}" )
message( STATUS "${PKG}_LIBRARIES=${${PKG}_LIBRARIES}" )
message( STATUS "${PKG}_LIBRARY_DIR=${${PKG}_LIBRARY_DIR}" )
message( STATUS "${${LIB}_OUTPUT}" )
endif()
else()
message( STATUS "WARNING: ${LIB} found but could not compile print_${LIB}_version.cpp:")
message( STATUS "${PKG}_INCLUDE_DIR=${${PKG}_INCLUDE_DIR}" )
message( STATUS "${PKG}_LIBRARIES=${${PKG}_LIBRARIES}" )
message( STATUS "${PKG}_LIBRARY_DIR=${${PKG}_LIBRARY_DIR}" )
message( STATUS "${${LIB}_OUTPUT}" )
endif()
message( STATUS "USING ${LIB}_VERSION = '${${LIB}_VERSION}'" )
endif()
endmacro()
macro( create_CGALconfig_files )
# FindCGAL and UseCGAL are platform specific so they are generated and stored in the binary folder.
configure_file(${CGAL_MODULES_DIR}/CGALConfig_binary.cmake.in ${CMAKE_BINARY_DIR}/CGALConfig.cmake @ONLY IMMEDIATE)
if ( SOURCE_INSTALL )
configure_file(${CGAL_MODULES_DIR}/CGALConfig_install.cmake.source.in ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake @ONLY IMMEDIATE)
else()
configure_file(${CGAL_MODULES_DIR}/CGALConfig_install.cmake.fhs.in ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake @ONLY IMMEDIATE)
endif()
endmacro()
macro ( fetch_env_var VAR )
if ( "${${VAR}}" STREQUAL "" )
set( ${VAR}_env_value "$ENV{${VAR}}" )
if ( NOT "${${VAR}_env_value}" STREQUAL "" )
set( ${VAR} ${${VAR}_env_value} )
endif()
endif()
endmacro()
# Composes a tagged list of libraries: a list with interpersed keywords or tags
# indicating that all following libraries, up to the next tag, are to be linked only for the
# corresponding build type. The 'general' tag indicates libraries that corresponds to all build types.
# 'optimized' corresponds to release builds and 'debug' to debug builds. Tags are case sensitve and
# the inital range of libraries listed before any tag is implicitely 'general'
#
# This macro takes 3 lists of general, optimized and debug libraries, resp, and populates the list
# given in the fourth argument.
#
# The first three parameters must be strings containing a semi-colon separated list of elements.
# All three lists must be passed, but any of them can be an empty string "".
# The fourth parameter, corresponding to the result, must be a variable name and it will be APPENDED
# (retaining any previous contents)
#
# If there is a last parameter whose value is "PERSISTENT" then the result is an internal cached variable,
# otherwise it is an in-memory variable
#
macro( compose_tagged_libraries libs_general libs_optimized libs_debug libs )
if ( "${ARGN}" STREQUAL "PERSISTENT" )
set( _CTL_IN_CACHE "PERSISTENT" )
else()
set( _CTL_IN_CACHE )
endif()
if ( NOT "${libs_general}" STREQUAL "" )
add_to_list( ${libs} ${_CTL_IN_CACHE} ${libs_general} )
endif()
if ( NOT "${libs_optimized}" STREQUAL "" )
add_to_list( ${libs} ${_CTL_IN_CACHE} optimized ${libs_optimized} )
endif()
if ( NOT "${libs_debug}" STREQUAL "" )
add_to_list( ${libs} ${_CTL_IN_CACHE} debug ${libs_debug} )
endif()
endmacro()
# Decomposes a tagged list of libraries (see macro compose_tagged_libraries).
# The first argument is the tagged list and the next 3 arguments are the lists
# where the general, optimized and debug libraries are collected.
#
# The first parameter must be a string containing a semi-colon separated list of elements.
# It cannot be ommitted, but it can be an empty string ""
#
# TThe next three arguments must be the names of the variables containing the result, and they
# will be APPENDED (retaining any previous contents)
#
# If there is a last parameter whose value is "PERSISTENT" then the result variables are internal in the cache,
# otherwise they are in-memory.
#
macro( decompose_tagged_libraries libs libs_general libs_optimized libs_debug )
if ( "${ARGN}" STREQUAL "PERSISTENT" )
set( _DTL_IN_CACHE "PERSISTENT" )
else()
set( _DTL_IN_CACHE )
endif()
set( _DTL_tag general )
foreach( _DTL_lib ${libs} )
if ( "${_DTL_lib}" STREQUAL "general" OR "${_DTL_lib}" STREQUAL "optimized" OR "${_DTL_lib}" STREQUAL "debug" )
set( _DTL_tag "${_DTL_lib}" )
else()
if ( "${_DTL_tag}" STREQUAL "general" )
set( _DTL_target ${libs_general} )
elseif ( "${_DTL_tag}" STREQUAL "optimized" )
set( _DTL_target ${libs_optimized} )
else()
set( _DTL_target ${libs_debug} )
endif()
add_to_list( ${_DTL_target} ${_DTL_IN_CACHE} ${_DTL_lib} )
endif()
endforeach()
endmacro()
# Given lists of optimized and debug libraries, creates a tagged list which will
# contain the libraries listed in the 'general' section if any of the two lists is empty,
#
# All arguments are variable names (not values), thus the input list can be undefined or empty.
# The return variable ('libs') will be APPENDED the result (retaining any previous contents)
#
# If there is a last parameter whose value is "PERSISTENT" then the result is an internal cached variable,
# otherwise it is an in-memory variable
#
# Example:
#
# set( LIBS_1 libA.so libB.so )
# set( LIBS_2 libC.so )
#
# tag_libraries( LIBS_1 LIBS_2 LIBS_R )
#
# LIBS_R -> optimized;libA.so;libB.so;debug;libC.so
#
# tag_libraries( LIBS_1 SOME_UNDEFINED_VARIABLE_OR_EMPTY_LIST LIBS_R )
#
# LIBS_R -> libA.so;libB.so (implicitely 'general' since there is no tag)
#
# tag_libraries( SOME_UNDEFINED_VARIABLE_OR_EMPTY_LIST LIBS_2 LIBS_R )
#
# LIBS_R -> libC.so (implicitely 'general' since there is no tag)
#
macro( tag_libraries libs_general_or_optimized libs_general_or_debug libs )
list( LENGTH ${libs_general_or_optimized} _TL_libs_general_or_optimized_len )
list( LENGTH ${libs_general_or_debug} _TL_libs_general_or_debug_len )
if ( _TL_libs_general_or_optimized_len EQUAL 0 )
compose_tagged_libraries( "${${libs_general_or_debug}}" "" "" ${libs} ${ARGN} )
elseif ( _TL_libs_general_or_debug_len EQUAL 0 )
compose_tagged_libraries( "${${libs_general_or_optimized}}" "" "" ${libs} ${ARGN} )
else()
compose_tagged_libraries( "" "${${libs_general_or_optimized}}" "${${libs_general_or_debug}}" ${libs} ${ARGN} )
endif()
endmacro()
# add_to_tagged_libraries( libsR ${libsA} <PERSISTENT> )
#
# Appends the list of tagged libraries contained in the variable 'libA' to the list
# of tagged libraries contained in the variable 'libR', properly redistributing each tagged subsequence.
#
# The first argument is the name of the variable recieving the list. It will be APPENDED
# (retaining any previous contents).
# The second parameter is a single string value containing the tagged
# lists of libraries to append (as a semi-colon separated list). It can be empty, in which case noting is added.
#
# If there is a third parameter whose value is PERSISTENT, then 'libR' is an internal cached variable, otherwise
# it is an in-memory variable.
#
# It is not possible to append more than one list in the same call.
#
# Example:
#
# set( LIBS_1 libG0.so libG1.so optimized libO0.so)
# set( LIBS_2 libG2.so debug libD0.so)
# set( LIBS_3 debug libD1.so optimized libO1.so libO2.so )
#
# concat_tagged_libraries( LIBS_R ${LIBS_1} PERSISTENT )
# concat_tagged_libraries( LIBS_R ${LIBS_2} PERSISTENT )
# concat_tagged_libraries( LIBS_R ${LIBS_3} PERSISTENT )
#
# LIBS_R -> libG0.so;libG1.so;libG2.so;optimized;libO0.so;libO1.so;libO2.so;debug;libD0.so;libD1.so, in the cache
#
macro( add_to_tagged_libraries libsR in_cache libsA )
if ( "${in_cache}" STREQUAL "PERSISTENT" )
set( _CTL_IN_CACHE "PERSISTENT" )
else()
set( _CTL_IN_CACHE )
endif()
set( _CTL_general_0 )
set( _CTL_optimized_0 )
set( _CTL_debug_0 )
set( _CTL_general_1 )
set( _CTL_optimized_1 )
set( _CTL_debug_0 )
decompose_tagged_libraries( "${${libsR}}" _CTL_general_0 _CTL_optimized_0 _CTL_debug_0 )
decompose_tagged_libraries( "${libsA}" _CTL_general_1 _CTL_optimized_1 _CTL_debug_1 )
add_to_list( _CTL_general_0 ${_CTL_general_1} )
add_to_list( _CTL_optimized_0 ${_CTL_optimized_1} )
add_to_list( _CTL_debug_0 ${_CTL_debug_1} )
if ( "${_CTL_IN_CACHE}" STREQUAL "PERSISTENT" )
cache_set( ${libsR} )
else()
set( ${libsR} )
endif()
compose_tagged_libraries( "${_CTL_general_0}" "${_CTL_optimized_0}" "${_CTL_debug_0}" ${libsR} ${_CTL_IN_CACHE} )
endmacro()
macro( add_to_persistent_tagged_libraries libsR )
add_to_tagged_libraries( ${libsR} PERSISTENT "${ARGN}" )
endmacro()
macro( add_to_in_memory_tagged_libraries libsR )
add_to_tagged_libraries( ${libsR} NOT_PERSISTENT "${ARGN}" )
endmacro()
endif()
\ No newline at end of file
# Find BLAS library
#
# This module finds an installed library that implements the BLAS
# linear-algebra interface (see http://www.netlib.org/blas/).
# The list of libraries searched for is mainly taken
# from the autoconf macro file, acx_blas.m4 (distributed at
# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
#
# This module sets the following variables:
# BLAS_FOUND - set to true if a library implementing the BLAS interface
# is found
# BLAS_INCLUDE_DIR - Directories containing the BLAS header files
# BLAS_DEFINITIONS - Compilation options to use BLAS
# BLAS_LINKER_FLAGS - Linker flags to use BLAS (excluding -l
# and -L).
# BLAS_LIBRARY_DIR - Directories containing the BLAS libraries.
# May be null if BLAS_LIBRARIES contains libraries name using full path.
# BLAS_LIBRARIES - List of libraries to link against BLAS interface.
# May be null if the compiler supports auto-link (e.g. VC++).
# BLAS_USE_FILE - The name of the cmake module to include to compile
# applications or libraries using BLAS.
#
# This module was modified by CGAL team:
# - find BLAS library shipped with TAUCS
# - find libraries for a C++ compiler, instead of Fortran
# - added BLAS_INCLUDE_DIR, BLAS_DEFINITIONS and BLAS_LIBRARY_DIR
# - removed BLAS95_LIBRARIES
#
# TODO (CGAL):
# - find CBLAS (http://www.netlib.org/cblas) on Unix?
include(CheckFunctionExists)
include(CGAL_GeneratorSpecificSettings)
# Check if the base path is set
if ( NOT CMAKE_WINDOWS_LIBS_DIR )
# This is the base directory for windows library search used in the finders we shipp.
set(CMAKE_WINDOWS_LIBS_DIR "c:/libs" CACHE STRING "Default Library search dir on windows." )
endif()
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# check_function_exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found and DEFINITIONS to the required definitions.
# Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
macro(check_fortran_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _path)
#message("DEBUG: check_fortran_libraries(${_list} in ${_path})")
# Check for the existence of the libraries given by _list
set(_libraries_found TRUE)
set(_libraries_work FALSE)
set(${DEFINITIONS} "")
set(${LIBRARIES} "")
set(_combined_name)
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
if(_libraries_found)
# search first in ${_path}
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
PATHS ${_path} NO_DEFAULT_PATH
)
# if not found, search in environment variables and system
if ( WIN32 )
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
PATHS ENV LIB
)
elseif ( APPLE )
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
)
else ()
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
)
endif()
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_found ${${_prefix}_${_library}_LIBRARY})
endif(_libraries_found)
endforeach(_library ${_list})
if(_libraries_found)
set(_libraries_found ${${LIBRARIES}})
endif()
# Test this combination of libraries with the Fortran/f2c interface.
# We test the Fortran interface first as it is well standardized.
if(_libraries_found AND NOT _libraries_work)
set(${DEFINITIONS} "-D${_prefix}_USE_F2C")
set(${LIBRARIES} ${_libraries_found})
# Some C++ linkers require the f2c library to link with Fortran libraries.
# I do not know which ones, thus I just add the f2c library if it is available.
find_package( F2C QUIET )
if ( F2C_FOUND )
set(${DEFINITIONS} ${${DEFINITIONS}} ${F2C_DEFINITIONS})
set(${LIBRARIES} ${${LIBRARIES}} ${F2C_LIBRARIES})
endif()
set(CMAKE_REQUIRED_DEFINITIONS ${${DEFINITIONS}})
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}})
#message("DEBUG: CMAKE_REQUIRED_DEFINITIONS = ${CMAKE_REQUIRED_DEFINITIONS}")
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
# Check if function exists with f2c calling convention (ie a trailing underscore)
check_function_exists(${_name}_ ${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
set(CMAKE_REQUIRED_DEFINITIONS} "")
set(CMAKE_REQUIRED_LIBRARIES "")
mark_as_advanced(${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
set(_libraries_work ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS})
endif(_libraries_found AND NOT _libraries_work)
# If not found, test this combination of libraries with a C interface.
# A few implementations (ie ACML) provide a C interface. Unfortunately, there is no standard.
if(_libraries_found AND NOT _libraries_work)
set(${DEFINITIONS} "")
set(${LIBRARIES} ${_libraries_found})
set(CMAKE_REQUIRED_DEFINITIONS "")
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}})
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
check_function_exists(${_name} ${_prefix}_${_name}${_combined_name}_WORKS)
set(CMAKE_REQUIRED_LIBRARIES "")
mark_as_advanced(${_prefix}_${_name}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}_${_name}${_combined_name}_WORKS})
endif(_libraries_found AND NOT _libraries_work)
# on failure
if(NOT _libraries_work)
set(${DEFINITIONS} "")
set(${LIBRARIES} FALSE)
endif()
#message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}")
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endmacro(check_fortran_libraries)
#
# main
#
# Is it already configured?
if (BLAS_LIBRARY_DIR OR BLAS_LIBRARIES)
set(BLAS_FOUND TRUE)
else()
# reset variables
set( BLAS_INCLUDE_DIR "" )
set( BLAS_DEFINITIONS "" )
set( BLAS_LINKER_FLAGS "" )
set( BLAS_LIBRARIES "" )
set( BLAS_LIBRARY_DIR "" )
# Look first for the TAUCS library distributed with CGAL in auxiliary/taucs.
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
include(CGAL_Locate_CGAL_TAUCS)
# Search for BLAS in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL),
# else in $BLAS_INC_DIR/$BLAS_LIB_DIR environment variables.
if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
# if VC++: done
set( BLAS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" )
set( BLAS_LIBRARY_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" )
else(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
#
# If Unix, search for BLAS function in possible libraries
#
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"cblas;f77blas;atlas"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
# BLAS in OPENBLAS library?
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"libopenblas"
"${VS_SEARCH_PATH}OpenBLAS-v0.2.9.rc2/lib"
)
endif()
# BLAS in OPENBLAS library?
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"libblas"
"${VS_SEARCH_PATH}suitesparse-metis-for-windows-1.2.2-install/lib64/lapack_blas_windows"
)
endif()
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"sgemm;dgemm;blas"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
# BLAS in Alpha CXML library?
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"cxml"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
# BLAS in Alpha DXML library? (now called CXML, see above)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"dxml"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
# BLAS in Sun Performance library?
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
"-xlic_lib=sunperf"
"sunperf;sunmath"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
if(BLAS_LIBRARIES)
# Extra linker flag
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
endif()
endif()
# BLAS in SCSL library? (SGI/Cray Scientific Library)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"scsl"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
# BLAS in SGIMATH library?
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"complib.sgimath"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"essl;blas"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
#BLAS in intel mkl 10 library? (em64t 64bit)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide;pthread"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
### windows version of intel mkl 10?
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
SGEMM
""
"mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
#older versions of intel mkl libs
# BLAS in intel mkl library? (shared)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl;guide;pthread"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
#BLAS in intel mkl library? (static, 32bit)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_ia32;guide;pthread"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
#BLAS in intel mkl library? (static, em64t 64bit)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_em64t;guide;pthread"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
#BLAS in acml library?
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"acml"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
# Apple BLAS library?
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"Accelerate"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
if ( NOT BLAS_LIBRARIES )
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"vecLib"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif ( NOT BLAS_LIBRARIES )
# Generic BLAS library?
# This configuration *must* be the last try as this library is notably slow.
if ( NOT BLAS_LIBRARIES )
check_fortran_libraries(
BLAS_DEFINITIONS
BLAS_LIBRARIES
BLAS
sgemm
""
"blas"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV BLAS_LIB_DIR"
)
endif()
endif(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
if(BLAS_LIBRARY_DIR OR BLAS_LIBRARIES)
set(BLAS_FOUND TRUE)
else()
set(BLAS_FOUND FALSE)
endif()
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_FOUND)
message(STATUS "A library with BLAS API found.")
else(BLAS_FOUND)
if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR "A required library with BLAS API not found. Please specify library location.")
else()
message(STATUS "A library with BLAS API not found. Please specify library location.")
endif()
endif(BLAS_FOUND)
endif(NOT BLAS_FIND_QUIETLY)
# Extract path from libraries
if ( NOT BLAS_LIBRARY_DIR AND BLAS_LIBRARIES)
list (GET BLAS_LIBRARIES 0 FIRST_LIB)
get_filename_component(BLAS_LIBRARY_DIR ${FIRST_LIB} DIRECTORY)
endif()
# Add variables to cache
set( BLAS_INCLUDE_DIR "${BLAS_INCLUDE_DIR}"
CACHE PATH "Directories containing the BLAS header files" FORCE )
set( BLAS_DEFINITIONS "${BLAS_DEFINITIONS}"
CACHE STRING "Compilation options to use BLAS" FORCE )
set( BLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}"