diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index f861e39..3debd0e 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -146,6 +146,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V") set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler") + list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS LAHEY) # Lahey/Fujitsu.. + set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_LAHEY "--version") + set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_LAHEY "Lahey/Fujitsu Fortran 95 Compiler") + # Try to identify the compiler. set(CMAKE_Fortran_COMPILER_ID) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) diff --git a/Modules/Compiler/LAHEY-Fortran.cmake b/Modules/Compiler/LAHEY-Fortran.cmake new file mode 100644 index 0000000..7d77d5f --- /dev/null +++ b/Modules/Compiler/LAHEY-Fortran.cmake @@ -0,0 +1,8 @@ +include(Compiler/LAHEY) +__compiler_lahey(Fortran) + + +set(CMAKE_Fortran_MODDIR_FLAG "--mod ") +set(CMAKE_Fortran_MODPATH_FLAG "-M ") +set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fix") +set(CMAKE_Fortran_FORMAT_FREE_FLAG "-nfix") diff --git a/Modules/Compiler/LAHEY.cmake b/Modules/Compiler/LAHEY.cmake new file mode 100644 index 0000000..c8bc219 --- /dev/null +++ b/Modules/Compiler/LAHEY.cmake @@ -0,0 +1,31 @@ + +#============================================================================= +# Copyright 2002-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__COMPILER_LAHEY) + return() +endif() +set(__COMPILER_LAHEY 1) + +macro(__compiler_lahey lang) + # Feature flags. + set(CMAKE_${lang}_VERBOSE_FLAG "--verbose") + + # Initial configuration flags. + set(CMAKE_${lang}_FLAGS_INIT "") + set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g -o0") + set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-os") + set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-o2") + set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-g -o2") +endmacro() diff --git a/Modules/Platform/Linux-LAHEY-Fortran.cmake b/Modules/Platform/Linux-LAHEY-Fortran.cmake new file mode 100644 index 0000000..7db7c6c --- /dev/null +++ b/Modules/Platform/Linux-LAHEY-Fortran.cmake @@ -0,0 +1,11 @@ +set(CMAKE_Fortran_VERBOSE_FLAG "-Wl,-v") # Runs gcc under the hood. + +# Need one "-Wl," level to send flag through to gcc. +# Use "-Xlinker" to get through gcc to real linker. +set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "--shared") +set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-Wl,-rpath,") +set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":") +set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG "-Wl,-rpath-link,-Xlinker,") +set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-soname,") +# We want to link statically to lf95 specific libraries in all cases.. +set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "--staticlink")