Skip to content
Snippets Groups Projects
Commit e4e4eaf7 authored by Markus Blatt's avatar Markus Blatt
Browse files

Added test for GMP and inkscape.

[[Imported from SVN: r6898]]
parent e8245087
No related branches found
No related tags found
No related merge requests found
......@@ -21,3 +21,5 @@ else(Fortran_Works)
file(WRITE ${CMAKE_BINARY_DIR}/FC.h "")
endif(Fortran_Works)
find_package(GMP)
find_package(Inkscape)
# Module that checks for the GNU MP Bignum (GMP) library, include
# dirs and
#
# Variables used by this module which you may want to set:
# GMP_PATH Path list to search for GMP
#
# Sets the following variables:
# GMP_FOUND True if the GMP library was found.
#
include(CheckIncludeFileCXX)
set(GMP_SEARCH_PATH CACHE FILEPATH "User defined list of directories to search for the GNU GMP library")
# save old variables
set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
# Search for location of header gmpxx.h"
find_path(GMP_INCLUDE_DIRS "gmpxx.h" PATHS ${GMP_SEARCH_PATH} PATH_SUFFIXES include NO_DEFAULT_PATH)
#If not found fall back to default locations
find_path(GMP_INCLUDE_DIRS "gmpxx.h")
if(GMP_INCLUDE_DIRS)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE} ${GMP_INCLUDE_DIRS})
check_include_files("gmpxx.h" GMP_FOUND)
find_library(GMP_LIB gmp PATHS ${GMP_SEARCH_PATH} PATH_SUFFIXES lib NODEFAULT_PATH DOC "GNU GMP library")
find_library(GMP_LIB gmp)
find_library(GMPXX_LIB gmpxx PATHS ${GMP_SEARCH_PATH} NODEFAULT_PATH DOC DOC "GNU GMPXX library")
find_library(GMPXX_LIB gmpxx)
if(GMP_LIB AND GMPXX_LIB)
set(GMP_FOUND "GMP_FOUND-NOTFOUND")
check_symbol_exists(__gmpz_abs ${GMP_LIB} GMP_FOUND)
if(GMP_FOUND)
set(GMP_LIBRARIES ${GMP_LIB} ${GMPXX_LIB} CACHE INTERNAL)
set(GMP_COMPILE_FLAGS "-DENABLE_GMP")
endif(GMP_FOUND)
else()
set(GMP_FOUND "GMP_FOUND-NOTFOUND")
endif()
set(HAVE_GMP GMP_FOUND)
endif(GMP_INCLUDE_DIRS)
# restore values
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
mark_as_advanced(GMP_LIB GMP_LIBXX)
function(dune_add_gmp_flags _targets)
if(GMP_FOUND)
foreach(_target ${_targets})
target_link_libraries(${_target} ${GMP_LIBRARIES})
set_property(TARGET ${_target} APPEND_STRING COMPILE_FLAGS "-DENABLE_GMP=1")
foreach(_path ${GMP_INCLUDE_DIRS})
set_property(TARGET ${_target} APPEND_STRING COMPILE_FLAGS "-I${_path}")
endforeach(_path ${GMP_INCLUDE_DIRS})
endif(GMP_FOUND)
endfunction(dune_add_gmp_flags)
# Module thaat checks for inkscape
#
# Sets the following variables
#
# INSCAPE: Path to inkscape to generate .png's form .svg's
#
find_program(INKSCAPE inkscape DOC "Path to inkscape to generate .png's form .svg'")
......@@ -64,6 +64,10 @@
deprecated MPI_CPPFLAGS) */
#cmakedefine HAVE_MPI ENABLE_MPI
/* Define if you have the GNU GMP library. The value should be ENABLE_GMP
to facilitate activating and deactivating GMP using compile flags. */
#cmakedefine HAVE_GMP ENABLE_GMP
/* Define to 1 if nullptr is supported */
#cmakedefine HAVE_NULLPTR 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment