star-schiff

Library for estimating radiative properties
git clone git://git.meso-star.com/star-schiff.git
Log | Files | Refs | README | LICENSE

commit a747cd75010bec5589a826ea28b74369927ad16e
parent 710449c5fee92d7a98822994bf8819e203614bce
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 19 Oct 2017 18:41:17 +0200

Handle the paths listed in CMAKE_PREFIX_PATH to look for GSL

Diffstat:
Mcmake/CMakeLists.txt | 18++++++++++++++----
1 file changed, 14 insertions(+), 4 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.12) +cmake_minimum_required(VERSION 3.1) project(star-schiff C) enable_testing() @@ -28,11 +28,21 @@ find_package(RSys 0.3 REQUIRED) find_package(StarSP 0.3 REQUIRED) find_package(Star3D 0.3 REQUIRED) find_package(OpenMP 1.2 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) + +# Resolve the absolute paths of the submitted prefix paths. This is required +# by the pkg_check_modules routine to correctly handle the paths listed in +# CMAKE_PREFIX_PATH +set(_prefix_paths ${CMAKE_PREFIX_PATH}) +set(CMAKE_PREFIX_PATH) +foreach(_path ${_prefix_paths}) + get_filename_component(_abs_path ${_path} ABSOLUTE) + list(APPEND CMAKE_PREFIX_PATH ${_abs_path}) +endforeach() + +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH 1) pkg_check_modules(GSL REQUIRED gsl) +find_package(GSL REQUIRED) include_directories( ${RSys_INCLUDE_DIR}