-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
35 lines (26 loc) · 1.05 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.6)
Project(fortran_project Fortran)
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/modules)
enable_testing()
add_library(dictionary_m src/dictionary_m.f90)
foreach(test_name read_write)
add_executable(${test_name} test/${test_name}.f90)
target_link_libraries(${test_name} dictionary_m)
endforeach(test_name)
add_test(NAME read_write COMMAND read_write input_dict.txt)
foreach(test_name example_from_readme test_01)
add_executable(${test_name} test/${test_name}.f90)
target_link_libraries(${test_name} dictionary_m)
add_test(NAME ${test_name} COMMAND ${test_name})
endforeach(test_name)
file(COPY test/input_dict.txt DESTINATION ${CMAKE_BINARY_DIR})
option(WITH_DOXYGEN OFF)
if(WITH_DOXYGEN)
find_package(Doxygen REQUIRED)
add_custom_target(doc
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/doc"
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxy_conf
DEPENDS ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxy_conf
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif()