From 262b6a10005025df562f9256dfde3d52e24eeb7a Mon Sep 17 00:00:00 2001 From: yangfl Date: Sun, 14 Jun 2020 12:48:01 +0800 Subject: [PATCH 05/11] CMakeLists.txt: use system gsl --- CMakeLists.txt | 8 ++++++-- willuslib/gslpolyfit.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca9d2defb280..ffc5019fb692 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,8 +61,12 @@ endif(JASPER_FOUND) set(HAVE_GHOSTSCRIPT 1) -# willus.h -# HAVE_GSL_LIB +pkg_check_modules(GSL gsl) +if(GSL_FOUND) + set(HAVE_GSL_LIB 1) + include_directories(SYSTEM ${GSL_INCLUDEDIR}) + set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${GSL_LDFLAGS}) +endif(GSL_FOUND) # libfreetype6 (>= 2.3.9), libjbig2dec0, libjpeg8 (>= 8c), libx11-6, libxext6, zlib1g (>= 1:1.2.0) diff --git a/willuslib/gslpolyfit.c b/willuslib/gslpolyfit.c index 5d2b6fbb85cc..b34f4b5b8083 100644 --- a/willuslib/gslpolyfit.c +++ b/willuslib/gslpolyfit.c @@ -24,7 +24,7 @@ #include #include "willus.h" #ifdef HAVE_GSL_LIB -#include +#include #endif void gslpolyfit(double *x,double *y0,int n,int d,double *c0) -- 2.43.0