adaptation of autocmake for the static linking

This commit is contained in:
Miro ILIAS
2015-08-02 19:00:34 +02:00
parent 44832b57a7
commit 7150ae9793
9 changed files with 84 additions and 18 deletions

View File

@ -18,13 +18,13 @@ option(ENABLE_STATIC_LINKING "Enable static libraries linking" OFF)
if(ENABLE_STATIC_LINKING)
if(DEFINED CMAKE_Fortran_COMPILER_ID)
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static")
set(CMAKE_Fortran_FLAGS "-static ${CMAKE_Fortran_FLAGS}")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -static-libgcc -static-intel")
set(CMAKE_Fortran_FLAGS "-static -static-libgcc -static-intel ${CMAKE_Fortran_FLAGS}")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Bstatic")
set(CMAKE_Fortran_FLAGS "-Bstatic ${CMAKE_Fortran_FLAGS}")
endif()
endif()