aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeDetermineVSServicePack.cmake103
-rw-r--r--cmake/EigenConfigureTesting.cmake79
-rw-r--r--cmake/EigenDetermineOSVersion.cmake46
-rw-r--r--cmake/EigenTesting.cmake477
-rw-r--r--cmake/FindAdolc.cmake20
-rw-r--r--cmake/FindBLAS.cmake419
-rw-r--r--cmake/FindCholmod.cmake80
-rw-r--r--cmake/FindEigen2.cmake80
-rw-r--r--cmake/FindEigen3.cmake81
-rw-r--r--cmake/FindFFTW.cmake119
-rw-r--r--cmake/FindGLEW.cmake105
-rw-r--r--cmake/FindGMP.cmake21
-rw-r--r--cmake/FindGSL.cmake170
-rw-r--r--cmake/FindGoogleHash.cmake23
-rw-r--r--cmake/FindLAPACK.cmake273
-rw-r--r--cmake/FindMPFR.cmake83
-rw-r--r--cmake/FindMetis.cmake24
-rw-r--r--cmake/FindPastix.cmake25
-rw-r--r--cmake/FindScotch.cmake24
-rw-r--r--cmake/FindStandardMathLibrary.cmake64
-rw-r--r--cmake/FindSuperLU.cmake25
-rw-r--r--cmake/FindUmfpack.cmake50
-rw-r--r--cmake/RegexUtils.cmake19
-rw-r--r--cmake/language_support.cmake64
24 files changed, 2474 insertions, 0 deletions
diff --git a/cmake/CMakeDetermineVSServicePack.cmake b/cmake/CMakeDetermineVSServicePack.cmake
new file mode 100644
index 000000000..b89462308
--- /dev/null
+++ b/cmake/CMakeDetermineVSServicePack.cmake
@@ -0,0 +1,103 @@
+# - Includes a public function for assisting users in trying to determine the
+# Visual Studio service pack in use.
+#
+# Sets the passed in variable to one of the following values or an empty
+# string if unknown.
+# vc80
+# vc80sp1
+# vc90
+# vc90sp1
+#
+# Usage:
+# ===========================
+#
+# if(MSVC)
+# include(CMakeDetermineVSServicePack)
+# DetermineVSServicePack( my_service_pack )
+#
+# if( my_service_pack )
+# message(STATUS "Detected: ${my_service_pack}")
+# endif()
+# endif()
+#
+# ===========================
+
+#=============================================================================
+# Copyright 2009-2010 Kitware, Inc.
+# Copyright 2009-2010 Philip Lowman <philip@yhbt.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.)
+
+# [INTERNAL]
+# Please do not call this function directly
+function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
+ if (${_cl_version} VERSION_EQUAL "14.00.50727.42")
+ set(_version "vc80")
+ elseif(${_cl_version} VERSION_EQUAL "14.00.50727.762")
+ set(_version "vc80sp1")
+ elseif(${_cl_version} VERSION_EQUAL "15.00.21022.08")
+ set(_version "vc90")
+ elseif(${_cl_version} VERSION_EQUAL "15.00.30729.01")
+ set(_version "vc90sp1")
+ elseif(${_cl_version} VERSION_EQUAL "16.00.30319.01")
+ set(_version "vc100")
+ else()
+ set(_version "")
+ endif()
+ set(${_OUT_VAR} ${_version} PARENT_SCOPE)
+endfunction()
+
+#
+# A function to call to determine the Visual Studio service pack
+# in use. See documentation above.
+function(DetermineVSServicePack _pack)
+ if(NOT DETERMINED_VS_SERVICE_PACK OR NOT ${_pack})
+ if(${CMAKE_BUILD_TOOL} STREQUAL "nmake")
+ EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} "/?"
+ ERROR_VARIABLE _output)
+ set(DETERMINED_VS_SERVICE_PACK ${_output})
+ else()
+ file(WRITE "${CMAKE_BINARY_DIR}/return0.cc"
+ "int main() { return 0; }\n")
+
+ try_compile(DETERMINED_VS_SERVICE_PACK
+ "${CMAKE_BINARY_DIR}"
+ "${CMAKE_BINARY_DIR}/return0.cc"
+ OUTPUT_VARIABLE _output
+ COPY_FILE "${CMAKE_BINARY_DIR}/return0.cc")
+
+ file(REMOVE "${CMAKE_BINARY_DIR}/return0.cc")
+ endif()
+
+ if(DETERMINED_VS_SERVICE_PACK AND _output)
+ string(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+"
+ _cl_version "${_output}")
+ if(_cl_version)
+ string(REGEX MATCHALL "[0-9]+"
+ _cl_version_list "${_cl_version}")
+ list(GET _cl_version_list 0 _major)
+ list(GET _cl_version_list 1 _minor)
+ list(GET _cl_version_list 2 _patch)
+ list(GET _cl_version_list 3 _tweak)
+
+ set(_cl_version_string ${_major}.${_minor}.${_patch}.${_tweak})
+
+ # Call helper function to determine VS version
+ _DetermineVSServicePackFromCompiler(_sp "${_cl_version_string}")
+ if(_sp)
+ #set(${_pack} "${_sp}(${_cl_version_string})" CACHE INTERNAL
+ set(${_pack} "${_sp}" CACHE INTERNAL
+ "The Visual Studio Release with Service Pack")
+ endif()
+ endif()
+ endif()
+ endif()
+endfunction()
diff --git a/cmake/EigenConfigureTesting.cmake b/cmake/EigenConfigureTesting.cmake
new file mode 100644
index 000000000..cf8f32c01
--- /dev/null
+++ b/cmake/EigenConfigureTesting.cmake
@@ -0,0 +1,79 @@
+include(EigenTesting)
+include(CheckCXXSourceCompiles)
+
+# configure the "site" and "buildname"
+ei_set_sitename()
+
+# retrieve and store the build string
+ei_set_build_string()
+
+add_custom_target(buildtests)
+add_custom_target(check COMMAND "ctest")
+add_dependencies(check buildtests)
+
+# check whether /bin/bash exists
+find_file(EIGEN_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH)
+
+# CMake/Ctest does not allow us to change the build command,
+# so we have to workaround by directly editing the generated DartConfiguration.tcl file
+# save CMAKE_MAKE_PROGRAM
+set(CMAKE_MAKE_PROGRAM_SAVE ${CMAKE_MAKE_PROGRAM})
+# and set a fake one
+set(CMAKE_MAKE_PROGRAM "@EIGEN_MAKECOMMAND_PLACEHOLDER@")
+
+# This call activates testing and generates the DartConfiguration.tcl
+include(CTest)
+
+# overwrite default DartConfiguration.tcl
+# The worarounds are different for each version of the MSVC IDE
+if(MSVC_IDE)
+ if(MSVC_VERSION EQUAL 1600) # MSVC 2010
+ set(EIGEN_MAKECOMMAND_PLACEHOLDER "${CMAKE_MAKE_PROGRAM_SAVE} buildtests.vcxproj /p:Configuration=\${CTEST_CONFIGURATION_TYPE} \n# ")
+ else() # MSVC 2008 (TODO check MSVC 2005)
+ set(EIGEN_MAKECOMMAND_PLACEHOLDER "${CMAKE_MAKE_PROGRAM_SAVE} Eigen.sln /build \"Release\" /project buildtests \n# ")
+ endif()
+else()
+ # for make and nmake
+ set(EIGEN_MAKECOMMAND_PLACEHOLDER "${CMAKE_MAKE_PROGRAM_SAVE} buildtests")
+endif()
+
+# copy ctest properties, which currently
+# o raise the warning levels
+configure_file(${CMAKE_BINARY_DIR}/DartConfiguration.tcl ${CMAKE_BINARY_DIR}/DartConfiguration.tcl)
+
+# restore default CMAKE_MAKE_PROGRAM
+set(CMAKE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM_SAVE})
+# un-set temporary variables so that it is like they never existed.
+# CMake 2.6.3 introduces the more logical unset() syntax for this.
+set(CMAKE_MAKE_PROGRAM_SAVE)
+set(EIGEN_MAKECOMMAND_PLACEHOLDER)
+
+configure_file(${CMAKE_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_BINARY_DIR}/CTestCustom.cmake)
+
+# some documentation of this function would be nice
+ei_init_testing()
+
+# configure Eigen related testing options
+option(EIGEN_NO_ASSERTION_CHECKING "Disable checking of assertions using exceptions" OFF)
+option(EIGEN_DEBUG_ASSERTS "Enable advanced debuging of assertions" OFF)
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+ option(EIGEN_COVERAGE_TESTING "Enable/disable gcov" OFF)
+ if(EIGEN_COVERAGE_TESTING)
+ set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage")
+ set(CTEST_CUSTOM_COVERAGE_EXCLUDE "/test/")
+ else(EIGEN_COVERAGE_TESTING)
+ set(COVERAGE_FLAGS "")
+ endif(EIGEN_COVERAGE_TESTING)
+ if(EIGEN_TEST_C++0x)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
+ endif(EIGEN_TEST_C++0x)
+ if(CMAKE_SYSTEM_NAME MATCHES Linux)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COVERAGE_FLAGS} -fno-inline-functions")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_FLAGS} -O0 -g3")
+ endif(CMAKE_SYSTEM_NAME MATCHES Linux)
+elseif(MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS")
+endif(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/cmake/EigenDetermineOSVersion.cmake b/cmake/EigenDetermineOSVersion.cmake
new file mode 100644
index 000000000..3c48d4c37
--- /dev/null
+++ b/cmake/EigenDetermineOSVersion.cmake
@@ -0,0 +1,46 @@
+# The utility function DetermineOSVersion aims at providing an
+# improved version of the CMake variable ${CMAKE_SYSTEM} on Windows
+# machines.
+#
+# Usage:
+# include(EigenDetermineOSVersion)
+# DetermineOSVersion(OS_VERSION)
+# message("OS: ${OS_VERSION}")
+
+# - A little helper variable which should not be directly called
+function(DetermineShortWindowsName WIN_VERSION win_num_version)
+ if (${win_num_version} VERSION_EQUAL "6.1")
+ set(_version "win7")
+ elseif(${win_num_version} VERSION_EQUAL "6.0")
+ set(_version "winVista")
+ elseif(${win_num_version} VERSION_EQUAL "5.2")
+ set(_version "winXpProf")
+ elseif(${win_num_version} VERSION_EQUAL "5.1")
+ set(_version "winXp")
+ elseif(${win_num_version} VERSION_EQUAL "5.0")
+ set(_version "win2000Prof")
+ else()
+ set(_version "unknownWin")
+ endif()
+ set(${WIN_VERSION} ${_version} PARENT_SCOPE)
+endfunction()
+
+function(DetermineOSVersion OS_VERSION)
+ if (WIN32)
+ file (TO_NATIVE_PATH "$ENV{COMSPEC}" SHELL)
+ exec_program( ${SHELL} ARGS "/c" "ver" OUTPUT_VARIABLE ver_output)
+
+ string(REGEX MATCHALL "[0-9]+"
+ ver_list "${ver_output}")
+ list(GET ver_list 0 _major)
+ list(GET ver_list 1 _minor)
+
+ set(win_num_version ${_major}.${_minor})
+ DetermineShortWindowsName(win_version "${win_num_version}")
+ if(win_version)
+ set(${OS_VERSION} ${win_version} PARENT_SCOPE)
+ endif()
+ else()
+ set(${OS_VERSION} ${CMAKE_SYSTEM} PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
new file mode 100644
index 000000000..266043974
--- /dev/null
+++ b/cmake/EigenTesting.cmake
@@ -0,0 +1,477 @@
+
+macro(ei_add_property prop value)
+ get_property(previous GLOBAL PROPERTY ${prop})
+ if ((NOT previous) OR (previous STREQUAL ""))
+ set_property(GLOBAL PROPERTY ${prop} "${value}")
+ else()
+ set_property(GLOBAL PROPERTY ${prop} "${previous} ${value}")
+ endif()
+endmacro(ei_add_property)
+
+#internal. See documentation of ei_add_test for details.
+macro(ei_add_test_internal testname testname_with_suffix)
+ set(targetname ${testname_with_suffix})
+
+ set(filename ${testname}.cpp)
+ add_executable(${targetname} ${filename})
+ if (targetname MATCHES "^eigen2_")
+ add_dependencies(eigen2_buildtests ${targetname})
+ else()
+ add_dependencies(buildtests ${targetname})
+ endif()
+
+ if(EIGEN_NO_ASSERTION_CHECKING)
+ ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_NO_ASSERTION_CHECKING=1")
+ else(EIGEN_NO_ASSERTION_CHECKING)
+ if(EIGEN_DEBUG_ASSERTS)
+ ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_DEBUG_ASSERTS=1")
+ endif(EIGEN_DEBUG_ASSERTS)
+ endif(EIGEN_NO_ASSERTION_CHECKING)
+
+ ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE}")
+
+ ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_FUNC=${testname}")
+
+ if(MSVC AND NOT EIGEN_SPLIT_LARGE_TESTS)
+ ei_add_target_property(${targetname} COMPILE_FLAGS "/bigobj")
+ endif()
+
+ # let the user pass flags.
+ if(${ARGC} GREATER 2)
+ ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV2}")
+ endif(${ARGC} GREATER 2)
+
+ if(EIGEN_TEST_CUSTOM_CXX_FLAGS)
+ ei_add_target_property(${targetname} COMPILE_FLAGS "${EIGEN_TEST_CUSTOM_CXX_FLAGS}")
+ endif()
+
+ if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
+ target_link_libraries(${targetname} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
+ endif()
+ if(EXTERNAL_LIBS)
+ target_link_libraries(${targetname} ${EXTERNAL_LIBS})
+ endif()
+ if(EIGEN_TEST_CUSTOM_LINKER_FLAGS)
+ target_link_libraries(${targetname} ${EIGEN_TEST_CUSTOM_LINKER_FLAGS})
+ endif()
+
+ if(${ARGC} GREATER 3)
+ set(libs_to_link ${ARGV3})
+ # it could be that some cmake module provides a bad library string " " (just spaces),
+ # and that severely breaks target_link_libraries ("can't link to -l-lstdc++" errors).
+ # so we check for strings containing only spaces.
+ string(STRIP "${libs_to_link}" libs_to_link_stripped)
+ string(LENGTH "${libs_to_link_stripped}" libs_to_link_stripped_length)
+ if(${libs_to_link_stripped_length} GREATER 0)
+ # notice: no double quotes around ${libs_to_link} here. It may be a list.
+ target_link_libraries(${targetname} ${libs_to_link})
+ endif()
+ endif()
+
+ if(EIGEN_BIN_BASH_EXISTS)
+ add_test(${testname_with_suffix} "${Eigen_SOURCE_DIR}/test/runtest.sh" "${testname_with_suffix}")
+ else()
+ add_test(${testname_with_suffix} "${targetname}")
+ endif()
+
+endmacro(ei_add_test_internal)
+
+# Macro to add a test
+#
+# the unique mandatory parameter testname must correspond to a file
+# <testname>.cpp which follows this pattern:
+#
+# #include "main.h"
+# void test_<testname>() { ... }
+#
+# Depending on the contents of that file, this macro can have 2 behaviors,
+# see below.
+#
+# The optional 2nd parameter is libraries to link to.
+#
+# A. Default behavior
+#
+# this macro adds an executable <testname> as well as a ctest test
+# named <testname> too.
+#
+# On platforms with bash simply run:
+# "ctest -V" or "ctest -V -R <testname>"
+# On other platform use ctest as usual
+#
+# B. Multi-part behavior
+#
+# If the source file matches the regexp
+# CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+
+# then it is interpreted as a multi-part test. The behavior then depends on the
+# CMake option EIGEN_SPLIT_LARGE_TESTS, which is ON by default.
+#
+# If EIGEN_SPLIT_LARGE_TESTS is OFF, the behavior is the same as in A (the multi-part
+# aspect is ignored).
+#
+# If EIGEN_SPLIT_LARGE_TESTS is ON, the test is split into multiple executables
+# test_<testname>_<N>
+# where N runs from 1 to the greatest occurence found in the source file. Each of these
+# executables is built passing -DEIGEN_TEST_PART_N. This allows to split large tests
+# into smaller executables.
+#
+# Moreover, targets <testname> are still generated, they
+# have the effect of building all the parts of the test.
+#
+# Again, ctest -R allows to run all matching tests.
+macro(ei_add_test testname)
+ get_property(EIGEN_TESTS_LIST GLOBAL PROPERTY EIGEN_TESTS_LIST)
+ set(EIGEN_TESTS_LIST "${EIGEN_TESTS_LIST}${testname}\n")
+ set_property(GLOBAL PROPERTY EIGEN_TESTS_LIST "${EIGEN_TESTS_LIST}")
+
+ file(READ "${testname}.cpp" test_source)
+ set(parts 0)
+ string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+|EIGEN_SUFFIXES(;[0-9]+)+"
+ occurences "${test_source}")
+ string(REGEX REPLACE "CALL_SUBTEST_|EIGEN_TEST_PART_|EIGEN_SUFFIXES" "" suffixes "${occurences}")
+ list(REMOVE_DUPLICATES suffixes)
+ if(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
+ add_custom_target(${testname})
+ foreach(suffix ${suffixes})
+ ei_add_test_internal(${testname} ${testname}_${suffix}
+ "${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
+ add_dependencies(${testname} ${testname}_${suffix})
+ endforeach(suffix)
+ else(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
+ set(symbols_to_enable_all_parts "")
+ foreach(suffix ${suffixes})
+ set(symbols_to_enable_all_parts
+ "${symbols_to_enable_all_parts} -DEIGEN_TEST_PART_${suffix}=1")
+ endforeach(suffix)
+ ei_add_test_internal(${testname} ${testname} "${ARGV1} ${symbols_to_enable_all_parts}" "${ARGV2}")
+ endif(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
+endmacro(ei_add_test)
+
+
+# adds a failtest, i.e. a test that succeed if the program fails to compile
+# note that the test runner for these is CMake itself, when passed -DEIGEN_FAILTEST=ON
+# so here we're just running CMake commands immediately, we're not adding any targets.
+macro(ei_add_failtest testname)
+ get_property(EIGEN_FAILTEST_FAILURE_COUNT GLOBAL PROPERTY EIGEN_FAILTEST_FAILURE_COUNT)
+ get_property(EIGEN_FAILTEST_COUNT GLOBAL PROPERTY EIGEN_FAILTEST_COUNT)
+
+ message(STATUS "Checking failtest: ${testname}")
+ set(filename "${testname}.cpp")
+ file(READ "${filename}" test_source)
+
+ try_compile(succeeds_when_it_should_fail
+ "${CMAKE_CURRENT_BINARY_DIR}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${filename}"
+ COMPILE_DEFINITIONS "-DEIGEN_SHOULD_FAIL_TO_BUILD")
+ if (succeeds_when_it_should_fail)
+ message(STATUS "FAILED: ${testname} build succeeded when it should have failed")
+ endif()
+
+ try_compile(succeeds_when_it_should_succeed
+ "${CMAKE_CURRENT_BINARY_DIR}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${filename}"
+ COMPILE_DEFINITIONS)
+ if (NOT succeeds_when_it_should_succeed)
+ message(STATUS "FAILED: ${testname} build failed when it should have succeeded")
+ endif()
+
+ if (succeeds_when_it_should_fail OR NOT succeeds_when_it_should_succeed)
+ math(EXPR EIGEN_FAILTEST_FAILURE_COUNT ${EIGEN_FAILTEST_FAILURE_COUNT}+1)
+ endif()
+
+ math(EXPR EIGEN_FAILTEST_COUNT ${EIGEN_FAILTEST_COUNT}+1)
+
+ set_property(GLOBAL PROPERTY EIGEN_FAILTEST_FAILURE_COUNT ${EIGEN_FAILTEST_FAILURE_COUNT})
+ set_property(GLOBAL PROPERTY EIGEN_FAILTEST_COUNT ${EIGEN_FAILTEST_COUNT})
+endmacro(ei_add_failtest)
+
+# print a summary of the different options
+macro(ei_testing_print_summary)
+ message(STATUS "************************************************************")
+ message(STATUS "*** Eigen's unit tests configuration summary ***")
+ message(STATUS "************************************************************")
+ message(STATUS "")
+ message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
+ message(STATUS "Build site: ${SITE}")
+ message(STATUS "Build string: ${BUILDNAME}")
+ get_property(EIGEN_TESTING_SUMMARY GLOBAL PROPERTY EIGEN_TESTING_SUMMARY)
+ get_property(EIGEN_TESTED_BACKENDS GLOBAL PROPERTY EIGEN_TESTED_BACKENDS)
+ get_property(EIGEN_MISSING_BACKENDS GLOBAL PROPERTY EIGEN_MISSING_BACKENDS)
+ message(STATUS "Enabled backends: ${EIGEN_TESTED_BACKENDS}")
+ message(STATUS "Disabled backends: ${EIGEN_MISSING_BACKENDS}")
+
+ if(EIGEN_DEFAULT_TO_ROW_MAJOR)
+ message(STATUS "Default order: Row-major")
+ else()
+ message(STATUS "Default order: Column-major")
+ endif()
+
+ if(EIGEN_TEST_NO_EXPLICIT_ALIGNMENT)
+ message(STATUS "Explicit alignment (hence vectorization) disabled")
+ elseif(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION)
+ message(STATUS "Explicit vectorization disabled (alignment kept enabled)")
+ else()
+
+ message(STATUS "Maximal matrix/vector size: ${EIGEN_TEST_MAX_SIZE}")
+
+ if(EIGEN_TEST_SSE2)
+ message(STATUS "SSE2: ON")
+ else()
+ message(STATUS "SSE2: Using architecture defaults")
+ endif()
+
+ if(EIGEN_TEST_SSE3)
+ message(STATUS "SSE3: ON")
+ else()
+ message(STATUS "SSE3: Using architecture defaults")
+ endif()
+
+ if(EIGEN_TEST_SSSE3)
+ message(STATUS "SSSE3: ON")
+ else()
+ message(STATUS "SSSE3: Using architecture defaults")
+ endif()
+
+ if(EIGEN_TEST_SSE4_1)
+ message(STATUS "SSE4.1: ON")
+ else()
+ message(STATUS "SSE4.1: Using architecture defaults")
+ endif()
+
+ if(EIGEN_TEST_SSE4_2)
+ message(STATUS "SSE4.2: ON")
+ else()
+ message(STATUS "SSE4.2: Using architecture defaults")
+ endif()
+
+ if(EIGEN_TEST_ALTIVEC)
+ message(STATUS "Altivec: ON")
+ else()
+ message(STATUS "Altivec: Using architecture defaults")
+ endif()
+
+ if(EIGEN_TEST_NEON)
+ message(STATUS "ARM NEON: ON")
+ else()
+ message(STATUS "ARM NEON: Using architecture defaults")
+ endif()
+
+ endif() # vectorization / alignment options
+
+ message(STATUS "\n${EIGEN_TESTING_SUMMARY}")
+
+ message(STATUS "************************************************************")
+endmacro(ei_testing_print_summary)
+
+macro(ei_init_testing)
+ define_property(GLOBAL PROPERTY EIGEN_TESTED_BACKENDS BRIEF_DOCS " " FULL_DOCS " ")
+ define_property(GLOBAL PROPERTY EIGEN_MISSING_BACKENDS BRIEF_DOCS " " FULL_DOCS " ")
+ define_property(GLOBAL PROPERTY EIGEN_TESTING_SUMMARY BRIEF_DOCS " " FULL_DOCS " ")
+ define_property(GLOBAL PROPERTY EIGEN_TESTS_LIST BRIEF_DOCS " " FULL_DOCS " ")
+
+ set_property(GLOBAL PROPERTY EIGEN_TESTED_BACKENDS "")
+ set_property(GLOBAL PROPERTY EIGEN_MISSING_BACKENDS "")
+ set_property(GLOBAL PROPERTY EIGEN_TESTING_SUMMARY "")
+ set_property(GLOBAL PROPERTY EIGEN_TESTS_LIST "")
+
+ define_property(GLOBAL PROPERTY EIGEN_FAILTEST_FAILURE_COUNT BRIEF_DOCS " " FULL_DOCS " ")
+ define_property(GLOBAL PROPERTY EIGEN_FAILTEST_COUNT BRIEF_DOCS " " FULL_DOCS " ")
+
+ set_property(GLOBAL PROPERTY EIGEN_FAILTEST_FAILURE_COUNT "0")
+ set_property(GLOBAL PROPERTY EIGEN_FAILTEST_COUNT "0")
+
+ # uncomment anytime you change the ei_get_compilerver_from_cxx_version_string macro
+ # ei_test_get_compilerver_from_cxx_version_string()
+endmacro(ei_init_testing)
+
+macro(ei_set_sitename)
+ # if the sitename is not yet set, try to set it
+ if(NOT ${SITE} OR ${SITE} STREQUAL "")
+ set(eigen_computername $ENV{COMPUTERNAME})
+ set(eigen_hostname $ENV{HOSTNAME})
+ if(eigen_hostname)
+ set(SITE ${eigen_hostname})
+ elseif(eigen_computername)
+ set(SITE ${eigen_computername})
+ endif()
+ endif()
+ # in case it is already set, enforce lower case
+ if(SITE)
+ string(TOLOWER ${SITE} SITE)
+ endif()
+endmacro(ei_set_sitename)
+
+macro(ei_get_compilerver VAR)
+ if(MSVC)
+ # on windows system, we use a modified CMake script
+ include(CMakeDetermineVSServicePack)
+ DetermineVSServicePack( my_service_pack )
+
+ if( my_service_pack )
+ set(${VAR} ${my_service_pack})
+ else()
+ set(${VAR} "na")
+ endif()
+ else()
+ # on all other system we rely on ${CMAKE_CXX_COMPILER}
+ # supporting a "--version" flag
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+ COMMAND head -n 1
+ OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ ei_get_compilerver_from_cxx_version_string(${eigen_cxx_compiler_version_string} CNAME CVER)
+
+ set(${VAR} "${CNAME}-${CVER}")
+ endif()
+endmacro(ei_get_compilerver)
+
+# Extract compiler name and version from a raw version string
+# WARNING: if you edit thid macro, then please test it by uncommenting
+# the testing macro call in ei_init_testing() of the EigenTesting.cmake file.
+# See also the ei_test_get_compilerver_from_cxx_version_string macro at the end of the file
+macro(ei_get_compilerver_from_cxx_version_string VERSTRING CNAME CVER)
+ # extract possible compiler names
+ string(REGEX MATCH "g\\+\\+" ei_has_gpp ${VERSTRING})
+ string(REGEX MATCH "llvm|LLVM" ei_has_llvm ${VERSTRING})
+ string(REGEX MATCH "gcc|GCC" ei_has_gcc ${VERSTRING})
+ string(REGEX MATCH "icpc|ICC" ei_has_icpc ${VERSTRING})
+ string(REGEX MATCH "clang|CLANG" ei_has_clang ${VERSTRING})
+
+ # combine them
+ if((ei_has_llvm) AND (ei_has_gpp OR ei_has_gcc))
+ set(${CNAME} "llvm-g++")
+ elseif((ei_has_llvm) AND (ei_has_clang))
+ set(${CNAME} "llvm-clang++")
+ elseif(ei_has_icpc)
+ set(${CNAME} "icpc")
+ elseif(ei_has_gpp OR ei_has_gcc)
+ set(${CNAME} "g++")
+ else()
+ set(${CNAME} "_")
+ endif()
+
+ # extract possible version numbers
+ # first try to extract 3 isolated numbers:
+ string(REGEX MATCH " [0-9]+\\.[0-9]+\\.[0-9]+" eicver ${VERSTRING})
+ if(NOT eicver)
+ # try to extract 2 isolated ones:
+ string(REGEX MATCH " [0-9]+\\.[0-9]+" eicver ${VERSTRING})
+ if(NOT eicver)
+ # try to extract 3:
+ string(REGEX MATCH "[^0-9][0-9]+\\.[0-9]+\\.[0-9]+" eicver ${VERSTRING})
+ if(NOT eicver)
+ # try to extract 2:
+ string(REGEX MATCH "[^0-9][0-9]+\\.[0-9]+" eicver ${VERSTRING})
+ else()
+ set(eicver " _")
+ endif()
+ endif()
+ endif()
+
+ string(REGEX REPLACE ".(.*)" "\\1" ${CVER} ${eicver})
+
+endmacro(ei_get_compilerver_from_cxx_version_string)
+
+macro(ei_get_cxxflags VAR)
+ set(${VAR} "")
+ ei_is_64bit_env(IS_64BIT_ENV)
+ if(EIGEN_TEST_NEON)
+ set(${VAR} NEON)
+ elseif(EIGEN_TEST_ALTIVEC)
+ set(${VAR} ALVEC)
+ elseif(EIGEN_TEST_SSE4_2)
+ set(${VAR} SSE42)
+ elseif(EIGEN_TEST_SSE4_1)
+ set(${VAR} SSE41)
+ elseif(EIGEN_TEST_SSSE3)
+ set(${VAR} SSSE3)
+ elseif(EIGEN_TEST_SSE3)
+ set(${VAR} SSE3)
+ elseif(EIGEN_TEST_SSE2 OR IS_64BIT_ENV)
+ set(${VAR} SSE2)
+ endif()
+
+ if(EIGEN_TEST_OPENMP)
+ if (${VAR} STREQUAL "")
+ set(${VAR} OMP)
+ else()
+ set(${VAR} ${${VAR}}-OMP)
+ endif()
+ endif()
+
+ if(EIGEN_DEFAULT_TO_ROW_MAJOR)
+ if (${VAR} STREQUAL "")
+ set(${VAR} ROW)
+ else()
+ set(${VAR} ${${VAR}}-ROWMAJ)
+ endif()
+ endif()
+endmacro(ei_get_cxxflags)
+
+macro(ei_set_build_string)
+ ei_get_compilerver(LOCAL_COMPILER_VERSION)
+ ei_get_cxxflags(LOCAL_COMPILER_FLAGS)
+
+ include(EigenDetermineOSVersion)
+ DetermineOSVersion(OS_VERSION)
+
+ set(TMP_BUILD_STRING ${OS_VERSION}-${LOCAL_COMPILER_VERSION})
+
+ if (NOT ${LOCAL_COMPILER_FLAGS} STREQUAL "")
+ set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-${LOCAL_COMPILER_FLAGS})
+ endif()
+
+ ei_is_64bit_env(IS_64BIT_ENV)
+ if(NOT IS_64BIT_ENV)
+ set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-32bit)
+ else()
+ set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-64bit)
+ endif()
+
+ string(TOLOWER ${TMP_BUILD_STRING} BUILDNAME)
+endmacro(ei_set_build_string)
+
+macro(ei_is_64bit_env VAR)
+
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
+ "int main() { return (sizeof(int*) == 8 ? 1 : 0); }
+ ")
+ try_run(run_res compile_res
+ ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
+ RUN_OUTPUT_VARIABLE run_output)
+
+ if(compile_res AND run_res)
+ set(${VAR} ${run_res})
+ elseif(CMAKE_CL_64)
+ set(${VAR} 1)
+ elseif("$ENV{Platform}" STREQUAL "X64") # nmake 64 bit
+ set(${VAR} 1)
+ endif()
+endmacro(ei_is_64bit_env)
+
+
+# helper macro for testing ei_get_compilerver_from_cxx_version_string
+# STR: raw version string
+# REFNAME: expected compiler name
+# REFVER: expected compiler version
+macro(ei_test1_get_compilerver_from_cxx_version_string STR REFNAME REFVER)
+ ei_get_compilerver_from_cxx_version_string(${STR} CNAME CVER)
+ if((NOT ${REFNAME} STREQUAL ${CNAME}) OR (NOT ${REFVER} STREQUAL ${CVER}))
+ message("STATUS ei_get_compilerver_from_cxx_version_string error:")
+ message("Expected \"${REFNAME}-${REFVER}\", got \"${CNAME}-${CVER}\"")
+ endif()
+endmacro(ei_test1_get_compilerver_from_cxx_version_string)
+
+# macro for testing ei_get_compilerver_from_cxx_version_string
+# feel free to add more version strings
+macro(ei_test_get_compilerver_from_cxx_version_string)
+ ei_test1_get_compilerver_from_cxx_version_string("g++ (SUSE Linux) 4.5.3 20110428 [gcc-4_5-branch revision 173117]" "g++" "4.5.3")
+ ei_test1_get_compilerver_from_cxx_version_string("c++ (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)" "g++" "4.5.1")
+ ei_test1_get_compilerver_from_cxx_version_string("icpc (ICC) 11.0 20081105" "icpc" "11.0")
+ ei_test1_get_compilerver_from_cxx_version_string("g++-3.4 (GCC) 3.4.6" "g++" "3.4.6")
+ ei_test1_get_compilerver_from_cxx_version_string("SUSE Linux clang version 3.0 (branches/release_30 145598) (based on LLVM 3.0)" "llvm-clang++" "3.0")
+ ei_test1_get_compilerver_from_cxx_version_string("icpc (ICC) 12.0.5 20110719" "icpc" "12.0.5")
+ ei_test1_get_compilerver_from_cxx_version_string("Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)" "llvm-clang++" "2.1")
+ ei_test1_get_compilerver_from_cxx_version_string("i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)" "llvm-g++" "4.2.1")
+ ei_test1_get_compilerver_from_cxx_version_string("g++-mp-4.4 (GCC) 4.4.6" "g++" "4.4.6")
+ ei_test1_get_compilerver_from_cxx_version_string("g++-mp-4.4 (GCC) 2011" "g++" "4.4")
+endmacro(ei_test_get_compilerver_from_cxx_version_string)
diff --git a/cmake/FindAdolc.cmake b/cmake/FindAdolc.cmake
new file mode 100644
index 000000000..1a7ff3628
--- /dev/null
+++ b/cmake/FindAdolc.cmake
@@ -0,0 +1,20 @@
+
+if (ADOLC_INCLUDES AND ADOLC_LIBRARIES)
+ set(ADOLC_FIND_QUIETLY TRUE)
+endif (ADOLC_INCLUDES AND ADOLC_LIBRARIES)
+
+find_path(ADOLC_INCLUDES
+ NAMES
+ adolc/adouble.h
+ PATHS
+ $ENV{ADOLCDIR}
+ ${INCLUDE_INSTALL_DIR}
+)
+
+find_library(ADOLC_LIBRARIES adolc PATHS $ENV{ADOLCDIR} ${LIB_INSTALL_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ADOLC DEFAULT_MSG
+ ADOLC_INCLUDES ADOLC_LIBRARIES)
+
+mark_as_advanced(ADOLC_INCLUDES ADOLC_LIBRARIES)
diff --git a/cmake/FindBLAS.cmake b/cmake/FindBLAS.cmake
new file mode 100644
index 000000000..68c4e0724
--- /dev/null
+++ b/cmake/FindBLAS.cmake
@@ -0,0 +1,419 @@
+# 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_LIBRARIES_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 libraries for a C++ compiler, instead of Fortran
+# - added BLAS_INCLUDE_DIR, BLAS_DEFINITIONS and BLAS_LIBRARIES_DIR
+# - removed BLAS95_LIBRARIES
+
+include(CheckFunctionExists)
+
+
+# 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_LIBRARIES_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_LIBRARIES_DIR "" )
+
+ #
+ # 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 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()
+
+ if(BLAS_LIBRARIES_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)
+
+ # 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}"
+ CACHE STRING "Linker flags to use BLAS" FORCE )
+ set( BLAS_LIBRARIES "${BLAS_LIBRARIES}"
+ CACHE FILEPATH "BLAS libraries name" FORCE )
+ set( BLAS_LIBRARIES_DIR "${BLAS_LIBRARIES_DIR}"
+ CACHE PATH "Directories containing the BLAS libraries" FORCE )
+
+ #message("DEBUG: BLAS_INCLUDE_DIR = ${BLAS_INCLUDE_DIR}")
+ #message("DEBUG: BLAS_DEFINITIONS = ${BLAS_DEFINITIONS}")
+ #message("DEBUG: BLAS_LINKER_FLAGS = ${BLAS_LINKER_FLAGS}")
+ #message("DEBUG: BLAS_LIBRARIES = ${BLAS_LIBRARIES}")
+ #message("DEBUG: BLAS_LIBRARIES_DIR = ${BLAS_LIBRARIES_DIR}")
+ #message("DEBUG: BLAS_FOUND = ${BLAS_FOUND}")
+
+endif(BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES)
diff --git a/cmake/FindCholmod.cmake b/cmake/FindCholmod.cmake
new file mode 100644
index 000000000..9095bea31
--- /dev/null
+++ b/cmake/FindCholmod.cmake
@@ -0,0 +1,80 @@
+# Cholmod lib usually requires linking to a blas and lapack library.
+# It is up to the user of this module to find a BLAS and link to it.
+
+if (CHOLMOD_INCLUDES AND CHOLMOD_LIBRARIES)
+ set(CHOLMOD_FIND_QUIETLY TRUE)
+endif (CHOLMOD_INCLUDES AND CHOLMOD_LIBRARIES)
+
+find_path(CHOLMOD_INCLUDES
+ NAMES
+ cholmod.h
+ PATHS
+ $ENV{CHOLMODDIR}
+ ${INCLUDE_INSTALL_DIR}
+ PATH_SUFFIXES
+ suitesparse
+ ufsparse
+)
+
+find_library(CHOLMOD_LIBRARIES cholmod PATHS $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
+
+if(CHOLMOD_LIBRARIES)
+
+ get_filename_component(CHOLMOD_LIBDIR ${CHOLMOD_LIBRARIES} PATH)
+
+ find_library(AMD_LIBRARY amd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
+ if (AMD_LIBRARY)
+ set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${AMD_LIBRARY})
+ else ()
+ set(CHOLMOD_LIBRARIES FALSE)
+ endif ()
+
+endif(CHOLMOD_LIBRARIES)
+
+if(CHOLMOD_LIBRARIES)
+
+ find_library(COLAMD_LIBRARY colamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
+ if (COLAMD_LIBRARY)
+ set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${COLAMD_LIBRARY})
+ else ()
+ set(CHOLMOD_LIBRARIES FALSE)
+ endif ()
+
+endif(CHOLMOD_LIBRARIES)
+
+if(CHOLMOD_LIBRARIES)
+
+ find_library(CAMD_LIBRARY camd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
+ if (CAMD_LIBRARY)
+ set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CAMD_LIBRARY})
+ else ()
+ set(CHOLMOD_LIBRARIES FALSE)
+ endif ()
+
+endif(CHOLMOD_LIBRARIES)
+
+if(CHOLMOD_LIBRARIES)
+
+ find_library(CCOLAMD_LIBRARY ccolamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
+ if (CCOLAMD_LIBRARY)
+ set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CCOLAMD_LIBRARY})
+ else ()
+ set(CHOLMOD_LIBRARIES FALSE)
+ endif ()
+
+endif(CHOLMOD_LIBRARIES)
+
+if(CHOLMOD_LIBRARIES)
+
+ find_library(CHOLMOD_METIS_LIBRARY metis PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
+ if (CHOLMOD_METIS_LIBRARY)
+ set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CHOLMOD_METIS_LIBRARY})
+ endif ()
+
+endif(CHOLMOD_LIBRARIES)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CHOLMOD DEFAULT_MSG
+ CHOLMOD_INCLUDES CHOLMOD_LIBRARIES)
+
+mark_as_advanced(CHOLMOD_INCLUDES CHOLMOD_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY)
diff --git a/cmake/FindEigen2.cmake b/cmake/FindEigen2.cmake
new file mode 100644
index 000000000..a834b8872
--- /dev/null
+++ b/cmake/FindEigen2.cmake
@@ -0,0 +1,80 @@
+# - Try to find Eigen2 lib
+#
+# This module supports requiring a minimum version, e.g. you can do
+# find_package(Eigen2 2.0.3)
+# to require version 2.0.3 to newer of Eigen2.
+#
+# Once done this will define
+#
+# EIGEN2_FOUND - system has eigen lib with correct version
+# EIGEN2_INCLUDE_DIR - the eigen include directory
+# EIGEN2_VERSION - eigen version
+
+# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
+# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+if(NOT Eigen2_FIND_VERSION)
+ if(NOT Eigen2_FIND_VERSION_MAJOR)
+ set(Eigen2_FIND_VERSION_MAJOR 2)
+ endif(NOT Eigen2_FIND_VERSION_MAJOR)
+ if(NOT Eigen2_FIND_VERSION_MINOR)
+ set(Eigen2_FIND_VERSION_MINOR 0)
+ endif(NOT Eigen2_FIND_VERSION_MINOR)
+ if(NOT Eigen2_FIND_VERSION_PATCH)
+ set(Eigen2_FIND_VERSION_PATCH 0)
+ endif(NOT Eigen2_FIND_VERSION_PATCH)
+
+ set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
+endif(NOT Eigen2_FIND_VERSION)
+
+macro(_eigen2_check_version)
+ file(READ "${EIGEN2_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header)
+
+ string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen2_world_version_match "${_eigen2_version_header}")
+ set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen2_major_version_match "${_eigen2_version_header}")
+ set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen2_minor_version_match "${_eigen2_version_header}")
+ set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}")
+
+ set(EIGEN2_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
+ if((${EIGEN2_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN2_MAJOR_VERSION} GREATER 10) OR (${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION}))
+ set(EIGEN2_VERSION_OK FALSE)
+ else()
+ set(EIGEN2_VERSION_OK TRUE)
+ endif()
+
+ if(NOT EIGEN2_VERSION_OK)
+
+ message(STATUS "Eigen2 version ${EIGEN2_VERSION} found in ${EIGEN2_INCLUDE_DIR}, "
+ "but at least version ${Eigen2_FIND_VERSION} is required")
+ endif(NOT EIGEN2_VERSION_OK)
+endmacro(_eigen2_check_version)
+
+if (EIGEN2_INCLUDE_DIR)
+
+ # in cache already
+ _eigen2_check_version()
+ set(EIGEN2_FOUND ${EIGEN2_VERSION_OK})
+
+else (EIGEN2_INCLUDE_DIR)
+
+find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
+ PATHS
+ ${INCLUDE_INSTALL_DIR}
+ ${KDE4_INCLUDE_DIR}
+ PATH_SUFFIXES eigen2
+ )
+
+if(EIGEN2_INCLUDE_DIR)
+ _eigen2_check_version()
+endif(EIGEN2_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR EIGEN2_VERSION_OK)
+
+mark_as_advanced(EIGEN2_INCLUDE_DIR)
+
+endif(EIGEN2_INCLUDE_DIR)
+
diff --git a/cmake/FindEigen3.cmake b/cmake/FindEigen3.cmake
new file mode 100644
index 000000000..9c546a05d
--- /dev/null
+++ b/cmake/FindEigen3.cmake
@@ -0,0 +1,81 @@
+# - Try to find Eigen3 lib
+#
+# This module supports requiring a minimum version, e.g. you can do
+# find_package(Eigen3 3.1.2)
+# to require version 3.1.2 or newer of Eigen3.
+#
+# Once done this will define
+#
+# EIGEN3_FOUND - system has eigen lib with correct version
+# EIGEN3_INCLUDE_DIR - the eigen include directory
+# EIGEN3_VERSION - eigen version
+
+# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
+# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
+# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
+# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
+
+if(NOT Eigen3_FIND_VERSION)
+ if(NOT Eigen3_FIND_VERSION_MAJOR)
+ set(Eigen3_FIND_VERSION_MAJOR 2)
+ endif(NOT Eigen3_FIND_VERSION_MAJOR)
+ if(NOT Eigen3_FIND_VERSION_MINOR)
+ set(Eigen3_FIND_VERSION_MINOR 91)
+ endif(NOT Eigen3_FIND_VERSION_MINOR)
+ if(NOT Eigen3_FIND_VERSION_PATCH)
+ set(Eigen3_FIND_VERSION_PATCH 0)
+ endif(NOT Eigen3_FIND_VERSION_PATCH)
+
+ set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
+endif(NOT Eigen3_FIND_VERSION)
+
+macro(_eigen3_check_version)
+ file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
+
+ string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
+ set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
+ set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
+ set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
+
+ set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
+ if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+ set(EIGEN3_VERSION_OK FALSE)
+ else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+ set(EIGEN3_VERSION_OK TRUE)
+ endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+
+ if(NOT EIGEN3_VERSION_OK)
+
+ message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
+ "but at least version ${Eigen3_FIND_VERSION} is required")
+ endif(NOT EIGEN3_VERSION_OK)
+endmacro(_eigen3_check_version)
+
+if (EIGEN3_INCLUDE_DIR)
+
+ # in cache already
+ _eigen3_check_version()
+ set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
+
+else (EIGEN3_INCLUDE_DIR)
+
+ find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/include
+ ${KDE4_INCLUDE_DIR}
+ PATH_SUFFIXES eigen3 eigen
+ )
+
+ if(EIGEN3_INCLUDE_DIR)
+ _eigen3_check_version()
+ endif(EIGEN3_INCLUDE_DIR)
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
+
+ mark_as_advanced(EIGEN3_INCLUDE_DIR)
+
+endif(EIGEN3_INCLUDE_DIR)
+
diff --git a/cmake/FindFFTW.cmake b/cmake/FindFFTW.cmake
new file mode 100644
index 000000000..a9e9925e7
--- /dev/null
+++ b/cmake/FindFFTW.cmake
@@ -0,0 +1,119 @@
+# - Find the FFTW library
+#
+# Usage:
+# find_package(FFTW [REQUIRED] [QUIET] )
+#
+# It sets the following variables:
+# FFTW_FOUND ... true if fftw is found on the system
+# FFTW_LIBRARIES ... full path to fftw library
+# FFTW_INCLUDES ... fftw include directory
+#
+# The following variables will be checked by the function
+# FFTW_USE_STATIC_LIBS ... if true, only static libraries are found
+# FFTW_ROOT ... if set, the libraries are exclusively searched
+# under this path
+# FFTW_LIBRARY ... fftw library to use
+# FFTW_INCLUDE_DIR ... fftw include directory
+#
+
+#If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT
+if( NOT FFTW_ROOT AND ENV{FFTWDIR} )
+ set( FFTW_ROOT $ENV{FFTWDIR} )
+endif()
+
+# Check if we can use PkgConfig
+find_package(PkgConfig)
+
+#Determine from PKG
+if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT )
+ pkg_check_modules( PKG_FFTW QUIET "fftw3" )
+endif()
+
+#Check whether to search static or dynamic libs
+set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
+
+if( ${FFTW_USE_STATIC_LIBS} )
+ set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} )
+else()
+ set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
+endif()
+
+if( FFTW_ROOT )
+
+ #find libs
+ find_library(
+ FFTW_LIB
+ NAMES "fftw3"
+ PATHS ${FFTW_ROOT}
+ PATH_SUFFIXES "lib" "lib64"
+ NO_DEFAULT_PATH
+ )
+
+ find_library(
+ FFTWF_LIB
+ NAMES "fftw3f"
+ PATHS ${FFTW_ROOT}
+ PATH_SUFFIXES "lib" "lib64"
+ NO_DEFAULT_PATH
+ )
+
+ find_library(
+ FFTWL_LIB
+ NAMES "fftw3l"
+ PATHS ${FFTW_ROOT}
+ PATH_SUFFIXES "lib" "lib64"
+ NO_DEFAULT_PATH
+ )
+
+ #find includes
+ find_path(
+ FFTW_INCLUDES
+ NAMES "fftw3.h"
+ PATHS ${FFTW_ROOT}
+ PATH_SUFFIXES "include"
+ NO_DEFAULT_PATH
+ )
+
+else()
+
+ find_library(
+ FFTW_LIB
+ NAMES "fftw3"
+ PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+ )
+
+ find_library(
+ FFTWF_LIB
+ NAMES "fftw3f"
+ PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+ )
+
+
+ find_library(
+ FFTWL_LIB
+ NAMES "fftw3l"
+ PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+ )
+
+ find_path(
+ FFTW_INCLUDES
+ NAMES "fftw3.h"
+ PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
+ )
+
+endif( FFTW_ROOT )
+
+set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})
+
+if(FFTWL_LIB)
+ set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB})
+endif()
+
+set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FFTW DEFAULT_MSG
+ FFTW_INCLUDES FFTW_LIBRARIES)
+
+mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES)
+
diff --git a/cmake/FindGLEW.cmake b/cmake/FindGLEW.cmake
new file mode 100644
index 000000000..54da20f12
--- /dev/null
+++ b/cmake/FindGLEW.cmake
@@ -0,0 +1,105 @@
+# Copyright (c) 2009 Boudewijn Rempt <boud@valdyas.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+# - try to find glew library and include files
+# GLEW_INCLUDE_DIR, where to find GL/glew.h, etc.
+# GLEW_LIBRARIES, the libraries to link against
+# GLEW_FOUND, If false, do not try to use GLEW.
+# Also defined, but not for general use are:
+# GLEW_GLEW_LIBRARY = the full path to the glew library.
+
+IF (WIN32)
+
+ IF(CYGWIN)
+
+ FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h)
+
+ FIND_LIBRARY( GLEW_GLEW_LIBRARY glew32
+ ${OPENGL_LIBRARY_DIR}
+ /usr/lib/w32api
+ /usr/X11R6/lib
+ )
+
+
+ ELSE(CYGWIN)
+
+ FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
+ $ENV{GLEW_ROOT_PATH}/include
+ )
+
+ FIND_LIBRARY( GLEW_GLEW_LIBRARY
+ NAMES glew glew32
+ PATHS
+ $ENV{GLEW_ROOT_PATH}/lib
+ ${OPENGL_LIBRARY_DIR}
+ )
+
+ ENDIF(CYGWIN)
+
+ELSE (WIN32)
+
+ IF (APPLE)
+# These values for Apple could probably do with improvement.
+ FIND_PATH( GLEW_INCLUDE_DIR glew.h
+ /System/Library/Frameworks/GLEW.framework/Versions/A/Headers
+ ${OPENGL_LIBRARY_DIR}
+ )
+ SET(GLEW_GLEW_LIBRARY "-framework GLEW" CACHE STRING "GLEW library for OSX")
+ SET(GLEW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
+ ELSE (APPLE)
+
+ FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
+ /usr/include/GL
+ /usr/openwin/share/include
+ /usr/openwin/include
+ /usr/X11R6/include
+ /usr/include/X11
+ /opt/graphics/OpenGL/include
+ /opt/graphics/OpenGL/contrib/libglew
+ )
+
+ FIND_LIBRARY( GLEW_GLEW_LIBRARY GLEW
+ /usr/openwin/lib
+ /usr/X11R6/lib
+ )
+
+ ENDIF (APPLE)
+
+ENDIF (WIN32)
+
+SET( GLEW_FOUND "NO" )
+IF(GLEW_INCLUDE_DIR)
+ IF(GLEW_GLEW_LIBRARY)
+ # Is -lXi and -lXmu required on all platforms that have it?
+ # If not, we need some way to figure out what platform we are on.
+ SET( GLEW_LIBRARIES
+ ${GLEW_GLEW_LIBRARY}
+ ${GLEW_cocoa_LIBRARY}
+ )
+ SET( GLEW_FOUND "YES" )
+
+#The following deprecated settings are for backwards compatibility with CMake1.4
+ SET (GLEW_LIBRARY ${GLEW_LIBRARIES})
+ SET (GLEW_INCLUDE_PATH ${GLEW_INCLUDE_DIR})
+
+ ENDIF(GLEW_GLEW_LIBRARY)
+ENDIF(GLEW_INCLUDE_DIR)
+
+IF(GLEW_FOUND)
+ IF(NOT GLEW_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Glew: ${GLEW_LIBRARIES}")
+ ENDIF(NOT GLEW_FIND_QUIETLY)
+ELSE(GLEW_FOUND)
+ IF(GLEW_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Glew")
+ ENDIF(GLEW_FIND_REQUIRED)
+ENDIF(GLEW_FOUND)
+
+MARK_AS_ADVANCED(
+ GLEW_INCLUDE_DIR
+ GLEW_GLEW_LIBRARY
+ GLEW_Xmu_LIBRARY
+ GLEW_Xi_LIBRARY
+)
diff --git a/cmake/FindGMP.cmake b/cmake/FindGMP.cmake
new file mode 100644
index 000000000..1f0273960
--- /dev/null
+++ b/cmake/FindGMP.cmake
@@ -0,0 +1,21 @@
+# Try to find the GNU Multiple Precision Arithmetic Library (GMP)
+# See http://gmplib.org/
+
+if (GMP_INCLUDES AND GMP_LIBRARIES)
+ set(GMP_FIND_QUIETLY TRUE)
+endif (GMP_INCLUDES AND GMP_LIBRARIES)
+
+find_path(GMP_INCLUDES
+ NAMES
+ gmp.h
+ PATHS
+ $ENV{GMPDIR}
+ ${INCLUDE_INSTALL_DIR}
+)
+
+find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GMP DEFAULT_MSG
+ GMP_INCLUDES GMP_LIBRARIES)
+mark_as_advanced(GMP_INCLUDES GMP_LIBRARIES)
diff --git a/cmake/FindGSL.cmake b/cmake/FindGSL.cmake
new file mode 100644
index 000000000..bf411a7f9
--- /dev/null
+++ b/cmake/FindGSL.cmake
@@ -0,0 +1,170 @@
+# Try to find gnu scientific library GSL
+# See
+# http://www.gnu.org/software/gsl/ and
+# http://gnuwin32.sourceforge.net/packages/gsl.htm
+#
+# Once run this will define:
+#
+# GSL_FOUND = system has GSL lib
+#
+# GSL_LIBRARIES = full path to the libraries
+# on Unix/Linux with additional linker flags from "gsl-config --libs"
+#
+# CMAKE_GSL_CXX_FLAGS = Unix compiler flags for GSL, essentially "`gsl-config --cxxflags`"
+#
+# GSL_INCLUDE_DIR = where to find headers
+#
+# GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix
+# GSL_EXE_LINKER_FLAGS = rpath on Unix
+#
+# Felix Woelk 07/2004
+# Jan Woetzel
+#
+# www.mip.informatik.uni-kiel.de
+# --------------------------------
+
+IF(WIN32)
+ # JW tested with gsl-1.8, Windows XP, MSVS 7.1
+ SET(GSL_POSSIBLE_ROOT_DIRS
+ ${GSL_ROOT_DIR}
+ $ENV{GSL_ROOT_DIR}
+ ${GSL_DIR}
+ ${GSL_HOME}
+ $ENV{GSL_DIR}
+ $ENV{GSL_HOME}
+ $ENV{EXTRA}
+ "C:/Program Files/GnuWin32"
+ )
+ FIND_PATH(GSL_INCLUDE_DIR
+ NAMES gsl/gsl_cdf.h gsl/gsl_randist.h
+ PATHS ${GSL_POSSIBLE_ROOT_DIRS}
+ PATH_SUFFIXES include
+ DOC "GSL header include dir"
+ )
+
+ FIND_LIBRARY(GSL_GSL_LIBRARY
+ NAMES libgsl.dll.a gsl libgsl
+ PATHS ${GSL_POSSIBLE_ROOT_DIRS}
+ PATH_SUFFIXES lib
+ DOC "GSL library" )
+
+ if(NOT GSL_GSL_LIBRARY)
+ FIND_FILE(GSL_GSL_LIBRARY
+ NAMES libgsl.dll.a
+ PATHS ${GSL_POSSIBLE_ROOT_DIRS}
+ PATH_SUFFIXES lib
+ DOC "GSL library")
+ endif(NOT GSL_GSL_LIBRARY)
+
+ FIND_LIBRARY(GSL_GSLCBLAS_LIBRARY
+ NAMES libgslcblas.dll.a gslcblas libgslcblas
+ PATHS ${GSL_POSSIBLE_ROOT_DIRS}
+ PATH_SUFFIXES lib
+ DOC "GSL cblas library dir" )
+
+ if(NOT GSL_GSLCBLAS_LIBRARY)
+ FIND_FILE(GSL_GSLCBLAS_LIBRARY
+ NAMES libgslcblas.dll.a
+ PATHS ${GSL_POSSIBLE_ROOT_DIRS}
+ PATH_SUFFIXES lib
+ DOC "GSL library")
+ endif(NOT GSL_GSLCBLAS_LIBRARY)
+
+ SET(GSL_LIBRARIES ${GSL_GSL_LIBRARY})
+
+ #MESSAGE("DBG\n"
+ # "GSL_GSL_LIBRARY=${GSL_GSL_LIBRARY}\n"
+ # "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n"
+ # "GSL_LIBRARIES=${GSL_LIBRARIES}")
+
+
+ELSE(WIN32)
+
+ IF(UNIX)
+ SET(GSL_CONFIG_PREFER_PATH
+ "$ENV{GSL_DIR}/bin"
+ "$ENV{GSL_DIR}"
+ "$ENV{GSL_HOME}/bin"
+ "$ENV{GSL_HOME}"
+ CACHE STRING "preferred path to GSL (gsl-config)")
+ FIND_PROGRAM(GSL_CONFIG gsl-config
+ ${GSL_CONFIG_PREFER_PATH}
+ /usr/bin/
+ )
+ # MESSAGE("DBG GSL_CONFIG ${GSL_CONFIG}")
+
+ IF (GSL_CONFIG)
+ # set CXXFLAGS to be fed into CXX_FLAGS by the user:
+ SET(GSL_CXX_FLAGS "`${GSL_CONFIG} --cflags`")
+
+ # set INCLUDE_DIRS to prefix+include
+ EXEC_PROGRAM(${GSL_CONFIG}
+ ARGS --prefix
+ OUTPUT_VARIABLE GSL_PREFIX)
+ SET(GSL_INCLUDE_DIR ${GSL_PREFIX}/include CACHE STRING INTERNAL)
+
+ # set link libraries and link flags
+ #SET(GSL_LIBRARIES "`${GSL_CONFIG} --libs`")
+ EXEC_PROGRAM(${GSL_CONFIG}
+ ARGS --libs
+ OUTPUT_VARIABLE GSL_LIBRARIES )
+
+ # extract link dirs for rpath
+ EXEC_PROGRAM(${GSL_CONFIG}
+ ARGS --libs
+ OUTPUT_VARIABLE GSL_CONFIG_LIBS )
+
+ # extract version
+ EXEC_PROGRAM(${GSL_CONFIG}
+ ARGS --version
+ OUTPUT_VARIABLE GSL_FULL_VERSION )
+
+ # split version as major/minor
+ STRING(REGEX MATCH "(.)\\..*" GSL_VERSION_MAJOR_ "${GSL_FULL_VERSION}")
+ SET(GSL_VERSION_MAJOR ${CMAKE_MATCH_1})
+ STRING(REGEX MATCH ".\\.(.*)" GSL_VERSION_MINOR_ "${GSL_FULL_VERSION}")
+ SET(GSL_VERSION_MINOR ${CMAKE_MATCH_1})
+
+ # split off the link dirs (for rpath)
+ # use regular expression to match wildcard equivalent "-L*<endchar>"
+ # with <endchar> is a space or a semicolon
+ STRING(REGEX MATCHALL "[-][L]([^ ;])+"
+ GSL_LINK_DIRECTORIES_WITH_PREFIX
+ "${GSL_CONFIG_LIBS}" )
+ # MESSAGE("DBG GSL_LINK_DIRECTORIES_WITH_PREFIX=${GSL_LINK_DIRECTORIES_WITH_PREFIX}")
+
+ # remove prefix -L because we need the pure directory for LINK_DIRECTORIES
+
+ IF (GSL_LINK_DIRECTORIES_WITH_PREFIX)
+ STRING(REGEX REPLACE "[-][L]" "" GSL_LINK_DIRECTORIES ${GSL_LINK_DIRECTORIES_WITH_PREFIX} )
+ ENDIF (GSL_LINK_DIRECTORIES_WITH_PREFIX)
+ SET(GSL_EXE_LINKER_FLAGS "-Wl,-rpath,${GSL_LINK_DIRECTORIES}" CACHE STRING INTERNAL)
+ # MESSAGE("DBG GSL_LINK_DIRECTORIES=${GSL_LINK_DIRECTORIES}")
+ # MESSAGE("DBG GSL_EXE_LINKER_FLAGS=${GSL_EXE_LINKER_FLAGS}")
+
+ # ADD_DEFINITIONS("-DHAVE_GSL")
+ # SET(GSL_DEFINITIONS "-DHAVE_GSL")
+ MARK_AS_ADVANCED(
+ GSL_CXX_FLAGS
+ GSL_INCLUDE_DIR
+ GSL_LIBRARIES
+ GSL_LINK_DIRECTORIES
+ GSL_DEFINITIONS
+ )
+ MESSAGE(STATUS "Using GSL from ${GSL_PREFIX}")
+
+ ELSE(GSL_CONFIG)
+ MESSAGE("FindGSL.cmake: gsl-config not found. Please set it manually. GSL_CONFIG=${GSL_CONFIG}")
+ ENDIF(GSL_CONFIG)
+
+ ENDIF(UNIX)
+ENDIF(WIN32)
+
+
+IF(GSL_LIBRARIES)
+ IF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS)
+
+ SET(GSL_FOUND 1)
+
+ ENDIF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS)
+ENDIF(GSL_LIBRARIES)
diff --git a/cmake/FindGoogleHash.cmake b/cmake/FindGoogleHash.cmake
new file mode 100644
index 000000000..f6a81a02c
--- /dev/null
+++ b/cmake/FindGoogleHash.cmake
@@ -0,0 +1,23 @@
+
+if (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
+ set(GOOGLEHASH_FIND_QUIETLY TRUE)
+endif (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
+
+find_path(GOOGLEHASH_INCLUDES
+ NAMES
+ google/dense_hash_map
+ PATHS
+ ${INCLUDE_INSTALL_DIR}
+)
+
+if(GOOGLEHASH_INCLUDES)
+ # let's make sure it compiles with the current compiler
+ file(WRITE ${CMAKE_BINARY_DIR}/googlehash_test.cpp
+ "#include <google/sparse_hash_map>\n#include <google/dense_hash_map>\nint main(int argc, char** argv) { google::dense_hash_map<int,float> a; google::sparse_hash_map<int,float> b; return 0;}\n")
+ try_compile(GOOGLEHASH_COMPILE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/googlehash_test.cpp OUTPUT_VARIABLE GOOGLEHASH_COMPILE_RESULT)
+endif(GOOGLEHASH_INCLUDES)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GOOGLEHASH DEFAULT_MSG GOOGLEHASH_INCLUDES GOOGLEHASH_COMPILE)
+
+mark_as_advanced(GOOGLEHASH_INCLUDES)
diff --git a/cmake/FindLAPACK.cmake b/cmake/FindLAPACK.cmake
new file mode 100644
index 000000000..2fcae2199
--- /dev/null
+++ b/cmake/FindLAPACK.cmake
@@ -0,0 +1,273 @@
+# Find LAPACK library
+#
+# This module finds an installed library that implements the LAPACK
+# linear-algebra interface (see http://www.netlib.org/lapack/).
+# The approach follows mostly that taken for the autoconf macro file, acx_lapack.m4
+# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
+#
+# This module sets the following variables:
+# LAPACK_FOUND - set to true if a library implementing the LAPACK interface
+# is found
+# LAPACK_INCLUDE_DIR - Directories containing the LAPACK header files
+# LAPACK_DEFINITIONS - Compilation options to use LAPACK
+# LAPACK_LINKER_FLAGS - Linker flags to use LAPACK (excluding -l
+# and -L).
+# LAPACK_LIBRARIES_DIR - Directories containing the LAPACK libraries.
+# May be null if LAPACK_LIBRARIES contains libraries name using full path.
+# LAPACK_LIBRARIES - List of libraries to link against LAPACK interface.
+# May be null if the compiler supports auto-link (e.g. VC++).
+# LAPACK_USE_FILE - The name of the cmake module to include to compile
+# applications or libraries using LAPACK.
+#
+# This module was modified by CGAL team:
+# - find libraries for a C++ compiler, instead of Fortran
+# - added LAPACK_INCLUDE_DIR, LAPACK_DEFINITIONS and LAPACK_LIBRARIES_DIR
+# - removed LAPACK95_LIBRARIES
+
+
+include(CheckFunctionExists)
+
+# 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_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _blas _path)
+ #message("DEBUG: check_lapack_libraries(${_list} in ${_path} with ${_blas})")
+
+ # 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}} ${_blas})
+ #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}} ${_blas})
+ #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_lapack_libraries)
+
+
+#
+# main
+#
+
+# LAPACK requires BLAS
+if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+ find_package(BLAS)
+else()
+ find_package(BLAS REQUIRED)
+endif()
+
+if (NOT BLAS_FOUND)
+
+ message(STATUS "LAPACK requires BLAS.")
+ set(LAPACK_FOUND FALSE)
+
+# Is it already configured?
+elseif (LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
+
+ set(LAPACK_FOUND TRUE)
+
+else()
+
+ # reset variables
+ set( LAPACK_INCLUDE_DIR "" )
+ set( LAPACK_DEFINITIONS "" )
+ set( LAPACK_LINKER_FLAGS "" ) # unused (yet)
+ set( LAPACK_LIBRARIES "" )
+ set( LAPACK_LIBRARIES_DIR "" )
+
+ #
+ # If Unix, search for LAPACK function in possible libraries
+ #
+
+ #intel mkl lapack?
+ if(NOT LAPACK_LIBRARIES)
+ check_lapack_libraries(
+ LAPACK_DEFINITIONS
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "mkl_lapack"
+ "${BLAS_LIBRARIES}"
+ "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+ )
+ endif()
+
+ #acml lapack?
+ if(NOT LAPACK_LIBRARIES)
+ check_lapack_libraries(
+ LAPACK_DEFINITIONS
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "acml"
+ "${BLAS_LIBRARIES}"
+ "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+ )
+ endif()
+
+ # Apple LAPACK library?
+ if(NOT LAPACK_LIBRARIES)
+ check_lapack_libraries(
+ LAPACK_DEFINITIONS
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "Accelerate"
+ "${BLAS_LIBRARIES}"
+ "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+ )
+ endif()
+
+ if ( NOT LAPACK_LIBRARIES )
+ check_lapack_libraries(
+ LAPACK_DEFINITIONS
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "vecLib"
+ "${BLAS_LIBRARIES}"
+ "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+ )
+ endif ( NOT LAPACK_LIBRARIES )
+
+ # Generic LAPACK library?
+ # This configuration *must* be the last try as this library is notably slow.
+ if ( NOT LAPACK_LIBRARIES )
+ check_lapack_libraries(
+ LAPACK_DEFINITIONS
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "lapack"
+ "${BLAS_LIBRARIES}"
+ "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
+ )
+ endif()
+
+ if(LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
+ set(LAPACK_FOUND TRUE)
+ else()
+ set(LAPACK_FOUND FALSE)
+ endif()
+
+ if(NOT LAPACK_FIND_QUIETLY)
+ if(LAPACK_FOUND)
+ message(STATUS "A library with LAPACK API found.")
+ else(LAPACK_FOUND)
+ if(LAPACK_FIND_REQUIRED)
+ message(FATAL_ERROR "A required library with LAPACK API not found. Please specify library location.")
+ else()
+ message(STATUS "A library with LAPACK API not found. Please specify library location.")
+ endif()
+ endif(LAPACK_FOUND)
+ endif(NOT LAPACK_FIND_QUIETLY)
+
+ # Add variables to cache
+ set( LAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}"
+ CACHE PATH "Directories containing the LAPACK header files" FORCE )
+ set( LAPACK_DEFINITIONS "${LAPACK_DEFINITIONS}"
+ CACHE STRING "Compilation options to use LAPACK" FORCE )
+ set( LAPACK_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}"
+ CACHE STRING "Linker flags to use LAPACK" FORCE )
+ set( LAPACK_LIBRARIES "${LAPACK_LIBRARIES}"
+ CACHE FILEPATH "LAPACK libraries name" FORCE )
+ set( LAPACK_LIBRARIES_DIR "${LAPACK_LIBRARIES_DIR}"
+ CACHE PATH "Directories containing the LAPACK libraries" FORCE )
+
+ #message("DEBUG: LAPACK_INCLUDE_DIR = ${LAPACK_INCLUDE_DIR}")
+ #message("DEBUG: LAPACK_DEFINITIONS = ${LAPACK_DEFINITIONS}")
+ #message("DEBUG: LAPACK_LINKER_FLAGS = ${LAPACK_LINKER_FLAGS}")
+ #message("DEBUG: LAPACK_LIBRARIES = ${LAPACK_LIBRARIES}")
+ #message("DEBUG: LAPACK_LIBRARIES_DIR = ${LAPACK_LIBRARIES_DIR}")
+ #message("DEBUG: LAPACK_FOUND = ${LAPACK_FOUND}")
+
+endif(NOT BLAS_FOUND)
diff --git a/cmake/FindMPFR.cmake b/cmake/FindMPFR.cmake
new file mode 100644
index 000000000..aa4c2cd7d
--- /dev/null
+++ b/cmake/FindMPFR.cmake
@@ -0,0 +1,83 @@
+# Try to find the MPFR library
+# See http://www.mpfr.org/
+#
+# This module supports requiring a minimum version, e.g. you can do
+# find_package(MPFR 2.3.0)
+# to require version 2.3.0 to newer of MPFR.
+#
+# Once done this will define
+#
+# MPFR_FOUND - system has MPFR lib with correct version
+# MPFR_INCLUDES - the MPFR include directory
+# MPFR_LIBRARIES - the MPFR library
+# MPFR_VERSION - MPFR version
+
+# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
+# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
+# Copyright (c) 2010 Jitse Niesen, <jitse@maths.leeds.ac.uk>
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+# Set MPFR_INCLUDES
+
+find_path(MPFR_INCLUDES
+ NAMES
+ mpfr.h
+ PATHS
+ $ENV{GMPDIR}
+ ${INCLUDE_INSTALL_DIR}
+)
+
+# Set MPFR_FIND_VERSION to 1.0.0 if no minimum version is specified
+
+if(NOT MPFR_FIND_VERSION)
+ if(NOT MPFR_FIND_VERSION_MAJOR)
+ set(MPFR_FIND_VERSION_MAJOR 1)
+ endif(NOT MPFR_FIND_VERSION_MAJOR)
+ if(NOT MPFR_FIND_VERSION_MINOR)
+ set(MPFR_FIND_VERSION_MINOR 0)
+ endif(NOT MPFR_FIND_VERSION_MINOR)
+ if(NOT MPFR_FIND_VERSION_PATCH)
+ set(MPFR_FIND_VERSION_PATCH 0)
+ endif(NOT MPFR_FIND_VERSION_PATCH)
+
+ set(MPFR_FIND_VERSION "${MPFR_FIND_VERSION_MAJOR}.${MPFR_FIND_VERSION_MINOR}.${MPFR_FIND_VERSION_PATCH}")
+endif(NOT MPFR_FIND_VERSION)
+
+
+if(MPFR_INCLUDES)
+
+ # Set MPFR_VERSION
+
+ file(READ "${MPFR_INCLUDES}/mpfr.h" _mpfr_version_header)
+
+ string(REGEX MATCH "define[ \t]+MPFR_VERSION_MAJOR[ \t]+([0-9]+)" _mpfr_major_version_match "${_mpfr_version_header}")
+ set(MPFR_MAJOR_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "define[ \t]+MPFR_VERSION_MINOR[ \t]+([0-9]+)" _mpfr_minor_version_match "${_mpfr_version_header}")
+ set(MPFR_MINOR_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "define[ \t]+MPFR_VERSION_PATCHLEVEL[ \t]+([0-9]+)" _mpfr_patchlevel_version_match "${_mpfr_version_header}")
+ set(MPFR_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}")
+
+ set(MPFR_VERSION ${MPFR_MAJOR_VERSION}.${MPFR_MINOR_VERSION}.${MPFR_PATCHLEVEL_VERSION})
+
+ # Check whether found version exceeds minimum version
+
+ if(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION})
+ set(MPFR_VERSION_OK FALSE)
+ message(STATUS "MPFR version ${MPFR_VERSION} found in ${MPFR_INCLUDES}, "
+ "but at least version ${MPFR_FIND_VERSION} is required")
+ else(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION})
+ set(MPFR_VERSION_OK TRUE)
+ endif(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION})
+
+endif(MPFR_INCLUDES)
+
+# Set MPFR_LIBRARIES
+
+find_library(MPFR_LIBRARIES mpfr PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR})
+
+# Epilogue
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(MPFR DEFAULT_MSG
+ MPFR_INCLUDES MPFR_LIBRARIES MPFR_VERSION_OK)
+mark_as_advanced(MPFR_INCLUDES MPFR_LIBRARIES)
diff --git a/cmake/FindMetis.cmake b/cmake/FindMetis.cmake
new file mode 100644
index 000000000..e4d6ef258
--- /dev/null
+++ b/cmake/FindMetis.cmake
@@ -0,0 +1,24 @@
+# Pastix requires METIS or METIS (partitioning and reordering tools)
+
+if (METIS_INCLUDES AND METIS_LIBRARIES)
+ set(METIS_FIND_QUIETLY TRUE)
+endif (METIS_INCLUDES AND METIS_LIBRARIES)
+
+find_path(METIS_INCLUDES
+ NAMES
+ metis.h
+ PATHS
+ $ENV{METISDIR}
+ ${INCLUDE_INSTALL_DIR}
+ PATH_SUFFIXES
+ metis
+)
+
+
+find_library(METIS_LIBRARIES metis PATHS $ENV{METISDIR} ${LIB_INSTALL_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(METIS DEFAULT_MSG
+ METIS_INCLUDES METIS_LIBRARIES)
+
+mark_as_advanced(METIS_INCLUDES METIS_LIBRARIES)
diff --git a/cmake/FindPastix.cmake b/cmake/FindPastix.cmake
new file mode 100644
index 000000000..e2e6c810d
--- /dev/null
+++ b/cmake/FindPastix.cmake
@@ -0,0 +1,25 @@
+# Pastix lib requires linking to a blas library.
+# It is up to the user of this module to find a BLAS and link to it.
+# Pastix requires SCOTCH or METIS (partitioning and reordering tools) as well
+
+if (PASTIX_INCLUDES AND PASTIX_LIBRARIES)
+ set(PASTIX_FIND_QUIETLY TRUE)
+endif (PASTIX_INCLUDES AND PASTIX_LIBRARIES)
+
+find_path(PASTIX_INCLUDES
+ NAMES
+ pastix_nompi.h
+ PATHS
+ $ENV{PASTIXDIR}
+ ${INCLUDE_INSTALL_DIR}
+)
+
+find_library(PASTIX_LIBRARIES pastix PATHS $ENV{PASTIXDIR} ${LIB_INSTALL_DIR})
+
+
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PASTIX DEFAULT_MSG
+ PASTIX_INCLUDES PASTIX_LIBRARIES)
+
+mark_as_advanced(PASTIX_INCLUDES PASTIX_LIBRARIES)
diff --git a/cmake/FindScotch.cmake b/cmake/FindScotch.cmake
new file mode 100644
index 000000000..530340b16
--- /dev/null
+++ b/cmake/FindScotch.cmake
@@ -0,0 +1,24 @@
+# Pastix requires SCOTCH or METIS (partitioning and reordering tools)
+
+if (SCOTCH_INCLUDES AND SCOTCH_LIBRARIES)
+ set(SCOTCH_FIND_QUIETLY TRUE)
+endif (SCOTCH_INCLUDES AND SCOTCH_LIBRARIES)
+
+find_path(SCOTCH_INCLUDES
+ NAMES
+ scotch.h
+ PATHS
+ $ENV{SCOTCHDIR}
+ ${INCLUDE_INSTALL_DIR}
+ PATH_SUFFIXES
+ scotch
+)
+
+
+find_library(SCOTCH_LIBRARIES scotch PATHS $ENV{SCOTCHDIR} ${LIB_INSTALL_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SCOTCH DEFAULT_MSG
+ SCOTCH_INCLUDES SCOTCH_LIBRARIES)
+
+mark_as_advanced(SCOTCH_INCLUDES SCOTCH_LIBRARIES)
diff --git a/cmake/FindStandardMathLibrary.cmake b/cmake/FindStandardMathLibrary.cmake
new file mode 100644
index 000000000..711b0e4b4
--- /dev/null
+++ b/cmake/FindStandardMathLibrary.cmake
@@ -0,0 +1,64 @@
+# - Try to find how to link to the standard math library, if anything at all is needed to do.
+# On most platforms this is automatic, but for example it's not automatic on QNX.
+#
+# Once done this will define
+#
+# STANDARD_MATH_LIBRARY_FOUND - we found how to successfully link to the standard math library
+# STANDARD_MATH_LIBRARY - the name of the standard library that one has to link to.
+# -- this will be left empty if it's automatic (most platforms).
+# -- this will be set to "m" on platforms where one must explicitly
+# pass the "-lm" linker flag.
+#
+# Copyright (c) 2010 Benoit Jacob <jacob.benoit.1@gmail.com>
+# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
+
+
+include(CheckCXXSourceCompiles)
+
+# a little test program for c++ math functions.
+# notice the std:: is required on some platforms such as QNX
+
+set(find_standard_math_library_test_program
+"#include<cmath>
+int main() { std::sin(0.0); std::log(0.0f); }")
+
+# first try compiling/linking the test program without any linker flags
+
+set(CMAKE_REQUIRED_FLAGS "")
+set(CMAKE_REQUIRED_LIBRARIES "")
+CHECK_CXX_SOURCE_COMPILES(
+ "${find_standard_math_library_test_program}"
+ standard_math_library_linked_to_automatically
+)
+
+if(standard_math_library_linked_to_automatically)
+
+ # the test program linked successfully without any linker flag.
+ set(STANDARD_MATH_LIBRARY "")
+ set(STANDARD_MATH_LIBRARY_FOUND TRUE)
+
+else()
+
+ # the test program did not link successfully without any linker flag.
+ # This is a very uncommon case that so far we only saw on QNX. The next try is the
+ # standard name 'm' for the standard math library.
+
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ CHECK_CXX_SOURCE_COMPILES(
+ "${find_standard_math_library_test_program}"
+ standard_math_library_linked_to_as_m)
+
+ if(standard_math_library_linked_to_as_m)
+
+ # the test program linked successfully when linking to the 'm' library
+ set(STANDARD_MATH_LIBRARY "m")
+ set(STANDARD_MATH_LIBRARY_FOUND TRUE)
+
+ else()
+
+ # the test program still doesn't link successfully
+ set(STANDARD_MATH_LIBRARY_FOUND FALSE)
+
+ endif()
+
+endif()
diff --git a/cmake/FindSuperLU.cmake b/cmake/FindSuperLU.cmake
new file mode 100644
index 000000000..ca72b4498
--- /dev/null
+++ b/cmake/FindSuperLU.cmake
@@ -0,0 +1,25 @@
+
+# Umfpack lib usually requires linking to a blas library.
+# It is up to the user of this module to find a BLAS and link to it.
+
+if (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
+ set(SUPERLU_FIND_QUIETLY TRUE)
+endif (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
+
+find_path(SUPERLU_INCLUDES
+ NAMES
+ supermatrix.h
+ PATHS
+ $ENV{SUPERLUDIR}
+ ${INCLUDE_INSTALL_DIR}
+ PATH_SUFFIXES
+ superlu
+)
+
+find_library(SUPERLU_LIBRARIES superlu PATHS $ENV{SUPERLUDIR} ${LIB_INSTALL_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SUPERLU DEFAULT_MSG
+ SUPERLU_INCLUDES SUPERLU_LIBRARIES)
+
+mark_as_advanced(SUPERLU_INCLUDES SUPERLU_LIBRARIES)
diff --git a/cmake/FindUmfpack.cmake b/cmake/FindUmfpack.cmake
new file mode 100644
index 000000000..d42c3c4a2
--- /dev/null
+++ b/cmake/FindUmfpack.cmake
@@ -0,0 +1,50 @@
+# Umfpack lib usually requires linking to a blas library.
+# It is up to the user of this module to find a BLAS and link to it.
+
+if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
+ set(UMFPACK_FIND_QUIETLY TRUE)
+endif (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
+
+find_path(UMFPACK_INCLUDES
+ NAMES
+ umfpack.h
+ PATHS
+ $ENV{UMFPACKDIR}
+ ${INCLUDE_INSTALL_DIR}
+ PATH_SUFFIXES
+ suitesparse
+ ufsparse
+)
+
+find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
+
+if(UMFPACK_LIBRARIES)
+
+ get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
+
+ find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
+ if (AMD_LIBRARY)
+ set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
+ #else (AMD_LIBRARY)
+ # set(UMFPACK_LIBRARIES FALSE)
+ endif (AMD_LIBRARY)
+
+endif(UMFPACK_LIBRARIES)
+
+if(UMFPACK_LIBRARIES)
+
+ find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
+ if (COLAMD_LIBRARY)
+ set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
+ #else (COLAMD_LIBRARY)
+ # set(UMFPACK_LIBRARIES FALSE)
+ endif (COLAMD_LIBRARY)
+
+endif(UMFPACK_LIBRARIES)
+
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(UMFPACK DEFAULT_MSG
+ UMFPACK_INCLUDES UMFPACK_LIBRARIES)
+
+mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY)
diff --git a/cmake/RegexUtils.cmake b/cmake/RegexUtils.cmake
new file mode 100644
index 000000000..b59dfc340
--- /dev/null
+++ b/cmake/RegexUtils.cmake
@@ -0,0 +1,19 @@
+function(escape_string_as_regex _str_out _str_in)
+ STRING(REGEX REPLACE "\\\\" "\\\\\\\\" FILETEST2 "${_str_in}")
+ STRING(REGEX REPLACE "([.$+*?|-])" "\\\\\\1" FILETEST2 "${FILETEST2}")
+ STRING(REGEX REPLACE "\\^" "\\\\^" FILETEST2 "${FILETEST2}")
+ STRING(REGEX REPLACE "\\(" "\\\\(" FILETEST2 "${FILETEST2}")
+ STRING(REGEX REPLACE "\\)" "\\\\)" FILETEST2 "${FILETEST2}")
+ STRING(REGEX REPLACE "\\[" "\\\\[" FILETEST2 "${FILETEST2}")
+ STRING(REGEX REPLACE "\\]" "\\\\]" FILETEST2 "${FILETEST2}")
+ SET(${_str_out} "${FILETEST2}" PARENT_SCOPE)
+endfunction()
+
+function(test_escape_string_as_regex)
+ SET(test1 "\\.^$-+*()[]?|")
+ escape_string_as_regex(test2 "${test1}")
+ SET(testRef "\\\\\\.\\^\\$\\-\\+\\*\\(\\)\\[\\]\\?\\|")
+ if(NOT test2 STREQUAL testRef)
+ message("Error in the escape_string_for_regex function : \n ${test1} was escaped as ${test2}, should be ${testRef}")
+ endif(NOT test2 STREQUAL testRef)
+endfunction() \ No newline at end of file
diff --git a/cmake/language_support.cmake b/cmake/language_support.cmake
new file mode 100644
index 000000000..3414e6ea6
--- /dev/null
+++ b/cmake/language_support.cmake
@@ -0,0 +1,64 @@
+# cmake/modules/language_support.cmake
+#
+# Temporary additional general language support is contained within this
+# file.
+
+# This additional function definition is needed to provide a workaround for
+# CMake bug 9220.
+
+# On debian testing (cmake 2.6.2), I get return code zero when calling
+# cmake the first time, but cmake crashes when running a second time
+# as follows:
+#
+# -- The Fortran compiler identification is unknown
+# CMake Error at /usr/share/cmake-2.6/Modules/CMakeFortranInformation.cmake:7 (GET_FILENAME_COMPONENT):
+# get_filename_component called with incorrect number of arguments
+# Call Stack (most recent call first):
+# CMakeLists.txt:3 (enable_language)
+#
+# My workaround is to invoke cmake twice. If both return codes are zero,
+# it is safe to invoke ENABLE_LANGUAGE(Fortran OPTIONAL)
+
+function(workaround_9220 language language_works)
+ #message("DEBUG: language = ${language}")
+ set(text
+ "project(test NONE)
+ cmake_minimum_required(VERSION 2.6.0)
+ enable_language(${language} OPTIONAL)
+ ")
+ file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language})
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language})
+ file(WRITE ${CMAKE_BINARY_DIR}/language_tests/${language}/CMakeLists.txt
+ ${text})
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} .
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
+ RESULT_VARIABLE return_code
+ OUTPUT_QUIET
+ ERROR_QUIET
+ )
+
+ if(return_code EQUAL 0)
+ # Second run
+ execute_process (
+ COMMAND ${CMAKE_COMMAND} .
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
+ RESULT_VARIABLE return_code
+ OUTPUT_QUIET
+ ERROR_QUIET
+ )
+ if(return_code EQUAL 0)
+ set(${language_works} ON PARENT_SCOPE)
+ else(return_code EQUAL 0)
+ set(${language_works} OFF PARENT_SCOPE)
+ endif(return_code EQUAL 0)
+ else(return_code EQUAL 0)
+ set(${language_works} OFF PARENT_SCOPE)
+ endif(return_code EQUAL 0)
+endfunction(workaround_9220)
+
+# Temporary tests of the above function.
+#workaround_9220(CXX CXX_language_works)
+#message("CXX_language_works = ${CXX_language_works}")
+#workaround_9220(CXXp CXXp_language_works)
+#message("CXXp_language_works = ${CXXp_language_works}")