summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Lundborg <magnus.lundborg@scilifelab.se>2013-01-10 13:59:37 (GMT)
committerMagnus Lundborg <magnus.lundborg@scilifelab.se>2013-01-10 13:59:37 (GMT)
commit98038743d78f912e42070fd3f0b7d7d887faa4ff (patch)
treedff9fa3a6f8323c5d870afb19f7d9697f4e3910d /src
parent0a4bda9e96c28aea6c948d2e017625a33e35b7f1 (diff)
Make builds work even if no fortran compiler is found
Diffstat (limited to 'src')
-rw-r--r--src/tests/CMakeLists.txt17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index aa0289d..de39fbe 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -19,12 +19,15 @@ target_link_libraries(md_openmp tng_io ${OpenMP_LIBS} m)
add_executable(tng_io_read_pos tng_io_read_pos.c)
target_link_libraries(tng_io_read_pos tng_io)
-enable_language(Fortran OPTIONAL)
-if(${CMAKE_Fortran_COMPILER_WORKS})
- get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
- if (Fortran_COMPILER_NAME STREQUAL "gfortran")
- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer ${OpenMP_C_FLAGS} -std=legacy")
+if(BUILD_FORTRAN)
+ # This does not work due to a bug in CMake. Remove lines below if no fortran compiler is found.
+ enable_language(Fortran OPTIONAL)
+ if(${CMAKE_Fortran_COMPILER_WORKS})
+ get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
+ if (Fortran_COMPILER_NAME STREQUAL "gfortran")
+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer ${OpenMP_C_FLAGS} -std=legacy")
+ endif()
+ add_executable(md_openmp_f md_openmp.f)
+ target_link_libraries(md_openmp_f tng_io ${OpenMP_LIBS})
endif()
- add_executable(md_openmp_f md_openmp.f)
- target_link_libraries(md_openmp_f tng_io ${OpenMP_LIBS})
endif()
contact: Jan Huwald // Impressum