From 13bb7dd748cb5ee51b09529d60a9ca756c0ca919 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 26 Apr 2016 19:39:15 +0200 Subject: [PATCH] add GSL library as an optional dependency --- cmake/configure/configure_gsl.cmake | 20 +++++++++++++++ cmake/modules/FindGSL.cmake | 39 +++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 cmake/configure/configure_gsl.cmake create mode 100644 cmake/modules/FindGSL.cmake diff --git a/cmake/configure/configure_gsl.cmake b/cmake/configure/configure_gsl.cmake new file mode 100644 index 0000000000..53568bd4ed --- /dev/null +++ b/cmake/configure/configure_gsl.cmake @@ -0,0 +1,20 @@ +## --------------------------------------------------------------------- +## +## Copyright (C) 2012 - 2015 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +# +# Configuration for the GSL library: +# + +CONFIGURE_FEATURE(GSL) diff --git a/cmake/modules/FindGSL.cmake b/cmake/modules/FindGSL.cmake new file mode 100644 index 0000000000..d34649bb27 --- /dev/null +++ b/cmake/modules/FindGSL.cmake @@ -0,0 +1,39 @@ +## --------------------------------------------------------------------- +## +## Copyright (C) 2012 - 2015 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +# +# Try to find the GSL library +# +# This module exports +# +# GSL_LIBRARIES +# GSL_LINKER_FLAGS +# + +SET(GSL_DIR "" CACHE PATH "An optional hint to an GSL installation") +SET_IF_EMPTY(GSL_DIR "$ENV{GSL_DIR}") + +DEAL_II_FIND_LIBRARY(GSL_LIBRARY + NAMES gsl + HINTS ${GSL_DIR} + PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib + ) + + +DEAL_II_PACKAGE_HANDLE(GSL + LIBRARIES + REQUIRED GSL_LIBRARY + CLEAR GSL_LIBRARY + ) -- 2.39.5