From d7303226f2df7ed6b1d2578ecaa94216a34c25ac Mon Sep 17 00:00:00 2001 From: reyoung Date: Thu, 30 Mar 2017 13:37:50 +0800 Subject: [PATCH] Adapt old cmake --- cmake/external/openblas.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/external/openblas.cmake b/cmake/external/openblas.cmake index 58d70a27fd..62ad2bbc23 100644 --- a/cmake/external/openblas.cmake +++ b/cmake/external/openblas.cmake @@ -29,6 +29,10 @@ IF(NOT ${CBLAS_FOUND}) IF(CMAKE_COMPILER_IS_GNUCC) ENABLE_LANGUAGE(Fortran) + if (NOT CMAKE_Fortran_COMPILER_VERSION) + # cmake version is too old, we cannot get fortran version, using CXX version instead. + set(CMAKE_Fortran_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) + endif() string(REGEX MATCHALL "[0-9]+" Fortran_VERSION ${CMAKE_Fortran_COMPILER_VERSION}) list(GET Fortran_VERSION 0 Fortran_MAJOR) list(GET Fortran_VERSION 1 Fortran_MINOR) -- GitLab