commit 3ffacc05990b35757f550cbfd556de89af1ecd6d
parent 3a834566538d274ca1a7ea67f2524ad24a769487
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 1 Apr 2016 10:36:02 +0200
Use the pkg-config to check for the GSL dependency
Do not use the GSL CMake package that is actually available only since
the version 3.2 of CMake.
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(star-schiff C)
enable_testing()
@@ -28,7 +28,11 @@ find_package(RSys 0.3 REQUIRED)
find_package(StarSP 0.3 REQUIRED)
find_package(Star3D 0.3 REQUIRED)
find_package(OpenMP 1.2 REQUIRED)
-find_package(GSL REQUIRED)
+
+# The CMake GSL module requires at least CMake 3.2 that may be too recent and
+# thus unavailable. Use pkg-config instead.
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(GSL REQUIRED gsl)
include_directories(
${RSys_INCLUDE_DIR}
@@ -68,7 +72,7 @@ set_target_properties(sschiff PROPERTIES
VERSION ${VERSION}
SOVERSION ${VERSION_MAJOR})
-target_link_libraries(sschiff RSys Star3D StarSP GSL::gsl)
+target_link_libraries(sschiff RSys Star3D StarSP ${GSL_LIBRARIES})
if(CMAKE_COMPILER_IS_GNUCC)
target_link_libraries(sschiff m)
endif()