-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
54 lines (41 loc) · 1.2 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.5)
enable_language(Fortran)
project(forgex
VERSION 3.4
DESCRIPTION "Fortran Regular Expression"
LANGUAGES Fortran
)
message("Project: ${PROJECT_NAME}")
message("Description: ${PROJECT_DESCRIPTION}")
add_subdirectory(src)
### TESTS settings
set(TEST_API_DIR test/test_api)
set(TEST_AST_DIR test/test_ast)
set(TEST_API_CASES
test_case_001
test_case_002
test_case_003
test_case_004
test_case_005
test_case_006
test_case_007
)
set(TEST_AST_CASES
ast_case_001
ast_case_002
)
foreach(TEST ${TEST_API_CASES})
add_executable(${TEST} ${TEST_API_DIR}/${TEST}.f90)
target_sources(${TEST} PRIVATE src/test_m.f90)
target_include_directories(${TEST} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
target_link_libraries(${TEST} PRIVATE forgex)
add_test(NAME Forgex_${TEST} COMMAND ${TEST})
endforeach()
foreach(TEST ${TEST_AST_CASES})
add_executable(${TEST} ${TEST_AST_DIR}/${TEST}.f90)
target_sources(${TEST} PRIVATE src/test_m.f90)
target_include_directories(${TEST} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
target_link_libraries(${TEST} PRIVATE forgex)
add_test(NAME Forgex_${TEST} COMMAND ${TEST})
endforeach()
enable_testing()