Commit 7876490e authored by jclamber's avatar jclamber

update fortran detection

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@190 ce2cc22f-6084-46ce-a062-084b172ee5dc
parent f90688b0
...@@ -25,6 +25,10 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake) ...@@ -25,6 +25,10 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
# load setup flags # load setup flags
include(SetupFlags) include(SetupFlags)
if ( ${CMAKE_ENABLE_FORTRAN} )
enable_language(Fortran OPTIONAL)
endif()
# contains the full path to the top level directory of your build tree # contains the full path to the top level directory of your build tree
MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} ) MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} )
...@@ -67,7 +71,7 @@ FILE(GLOB LIBSOURCES src/*.cc) ...@@ -67,7 +71,7 @@ FILE(GLOB LIBSOURCES src/*.cc)
SET(LIBRARY_OUTPUT_PATH lib) SET(LIBRARY_OUTPUT_PATH lib)
# compilation options # compilation options
#dd_definitions(-Wall ${OPT} -Wswitch -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE ${DNOSQLITE3})
add_definitions(${OPT} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE ${DNOSQLITE3}) add_definitions(${OPT} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE ${DNOSQLITE3})
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${WARNCPP} ) SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${WARNCPP} )
SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${WARNC} ) SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${WARNC} )
...@@ -89,15 +93,18 @@ endif(OSX) ...@@ -89,15 +93,18 @@ endif(OSX)
if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$") if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND) set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)
endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$") endif(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
enable_language(Fortran OPTIONAL) #enable_language(Fortran OPTIONAL)
message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}")
if (CMAKE_Fortran_COMPILER) if (CMAKE_Fortran_COMPILER)
SET(CMAKE_Fortran_COMPILER gfortran) message(STATUS "CMAKE_Fortran_COMPILER_WORKS = ${CMAKE_Fortran_COMPILER_WORKS}")
MESSAGE(STATUS "Fortran compiler : " ${CMAKE_Fortran_COMPILER}) MESSAGE(STATUS "Fortran compiler : " ${CMAKE_Fortran_COMPILER})
endif() endif()
# Enable Fortran support #if (CMAKE_Fortran_COMPILER)
#ENABLE_LANGUAGE(Fortran) # SET(CMAKE_Fortran_COMPILER gfortran)
# MESSAGE(STATUS "Fortran compiler : " ${CMAKE_Fortran_COMPILER})
#endif()
#if (${CMAKE_Fortran_COMPILER} STREQUAL CMAKE_Fortran_COMPILER-NOTFOUND) #if (${CMAKE_Fortran_COMPILER} STREQUAL CMAKE_Fortran_COMPILER-NOTFOUND)
# MESSAGE(STATUS "NO FORTRAN") # MESSAGE(STATUS "NO FORTRAN")
#else () #else ()
......
...@@ -25,6 +25,11 @@ if ( NOT SETUP_FLAGS_INCLUDED ) ...@@ -25,6 +25,11 @@ if ( NOT SETUP_FLAGS_INCLUDED )
typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Debug ) typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Debug )
endif() endif()
# Enable fortran language detection by default
if ( NOT CMAKE_ENABLE_FORTRAN )
MESSAGE ("NOOOOOOOOOOOOOT")
typed_cache_set ( STRING "Try to enable FORTRAN" CMAKE_ENABLE_FORTRAN 1 )
endif()
# set optimizer flag # set optimizer flag
if ( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) if ( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
typed_cache_set (STRING "Optimizer" OPT "-g -ggdb") typed_cache_set (STRING "Optimizer" OPT "-g -ggdb")
...@@ -33,7 +38,6 @@ if ( NOT SETUP_FLAGS_INCLUDED ) ...@@ -33,7 +38,6 @@ if ( NOT SETUP_FLAGS_INCLUDED )
endif () endif ()
#typed_cache_set (STRING "compilation warnings" WARNCPP "-Waddress -Warray-bounds -Wc++0x-compat -Wchar-subscripts -Wenum-compare -Wcomment -Wformat -Wmain -Wmissing-braces -Wparentheses -Wreorder -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wvolatile-register-var")
typed_cache_set (STRING "compilation warnings" WARNCPP "-Wall") typed_cache_set (STRING "compilation warnings" WARNCPP "-Wall")
# check C compiler flags # check C compiler flags
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment