From: Arnaud Giersch Date: Mon, 12 Nov 2012 17:05:26 +0000 (+0100) Subject: Define macro if it's missing. X-Git-Tag: v3_9_rc1~91^2~115 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/996f82a2b67e49a58b1de059bc44143e17a25ff6?hp=5a56032a41336f0ae76fe5d8845599b403f73688 Define macro if it's missing. CMAKE_FORCE_Fortran_COMPILER does not exist with cmake before 2.8.1. See http://www.cmake.org/Bug/view.php?id=10032 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b0a1e69eb6..ad5b8da83c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,20 @@ if (NOT DEFINED enable_smpi OR enable_smpi) # smpi is enabled by default # CMAKE_FORCE_Fortran_COMPILER to bypass checks for a working # compiler (smpiff don't exist at configure time). include(CMakeForceCompiler) + if(NOT COMMAND CMAKE_FORCE_Fortran_COMPILER) + MACRO(CMAKE_FORCE_Fortran_COMPILER compiler id) + SET(CMAKE_Fortran_COMPILER "${compiler}") + SET(CMAKE_Fortran_COMPILER_ID_RUN TRUE) + SET(CMAKE_Fortran_COMPILER_ID ${id}) + SET(CMAKE_Fortran_COMPILER_WORKS TRUE) + SET(CMAKE_Fortran_COMPILER_FORCED TRUE) + + # Set old compiler id variables. + IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + SET(CMAKE_COMPILER_IS_GNUG77 1) + ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + ENDMACRO(CMAKE_FORCE_Fortran_COMPILER) + endif() CMAKE_FORCE_Fortran_COMPILER(smpiff smpiff) enable_language(Fortran OPTIONAL) endif()