blob: 4a63c544ffe177f91d97a1080d495893e54e0c3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
if(NOT OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif()
include_directories(${TRAJECTORY_SOURCE_DIR}/src/lib)
link_directories(${TRAJECTORY_BINARY_DIR}/src/lib)
set(EXAMPLE_FILES_DIR ${CMAKE_BINARY_DIR}/example_files/ CACHE STRING "Directory where to find input test files and save output files.")
configure_file(tng_io_testing.h.in ${CMAKE_BINARY_DIR}/generated/tng_io_testing.h)
include_directories(${CMAKE_BINARY_DIR}/generated/)
add_executable(tng_testing tng_io_testing.c)
target_link_libraries(tng_testing tng_io)
if(HAVE_INTTYPES_H)
set_target_properties(tng_testing PROPERTIES COMPILE_DEFINITIONS USE_STD_INTTYPES_H=1)
endif()
if(OPENMP_FOUND)
add_executable(md_openmp md_openmp.c)
target_link_libraries(md_openmp tng_io ${OpenMP_LIBS} m)
endif()
add_executable(tng_io_read_pos tng_io_read_pos.c)
target_link_libraries(tng_io_read_pos tng_io)
add_executable(tng_parallel_read tng_parallel_read.c)
target_link_libraries(tng_parallel_read tng_io)
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()
if(OPENMP_FOUND)
add_executable(md_openmp_f md_openmp.f)
target_link_libraries(md_openmp_f tng_io ${OpenMP_LIBS})
endif()
endif()
endif()
|