FindGSL¶
Added in version 3.2.
Finds the native GNU Scientific Library (GSL) includes and libraries.
The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License.
Imported Targets¶
If GSL is found, this module defines the following Imported Targets:
GSL::gslThe main GSL library that provides all usage requirements to use GSL.
GSL::gslcblasThe CBLAS support library used by GSL. It is linked also into the
GSL::gsltarget but provided separately for granularity.
Result Variables¶
This module will set the following variables in the project:
GSL_FOUNDTrue if GSL is found on the local system.
GSL_INCLUDE_DIRSDirectory containing GSL header files.
GSL_LIBRARIESThe GSL libraries.
GSL_VERSIONThe version of the discovered GSL installation.
Hints¶
GSL_ROOT_DIRSet this variable to a directory that contains a GSL installation.
If this variable is not set, this module will use pkg-config and default paths to find GSL. If this variable is provided, then this module expects to find libraries at
${GSL_ROOT_DIR}/liband the GSL headers at${GSL_ROOT_DIR}/include/gsl.The library directory may optionally provide Release and Debug folders. If available, the libraries named
gsld,gslblasdorcblasdare recognized as debug libraries. For Unix-like systems, this module will also usegsl-config(if found) to aid in the discovery of GSL.
Cache Variables¶
This module may set the following variables depending on platform and type of GSL installation discovered. These variables may optionally be set to help this module find the correct files:
GSL_CBLAS_LIBRARYLocation of the GSL CBLAS library.
GSL_CBLAS_LIBRARY_DEBUGLocation of the debug GSL CBLAS library (if any).
GSL_CONFIG_EXECUTABLELocation of the
gsl-configscript (if any).GSL_LIBRARYLocation of the GSL library.
GSL_LIBRARY_DEBUGLocation of the debug GSL library (if any).
Examples¶
Finding GSL and linking it to a project target:
find_package(GSL)
target_link_libraries(project_target PRIVATE GSL::gsl)