-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
103 lines (82 loc) · 2.89 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
cmake_minimum_required (VERSION 3.13)
project(optflow LANGUAGES C)
enable_testing()
option(fortran "use fortran" true)
if(fortran)
enable_language(Fortran)
endif()
set(CMAKE_C_STANDARD 99)
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Werror=array-bounds;-Wno-unused-variable;-Wno-unused-result;-Wno-implicit-int>")
endif()
if(WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel")
set(math_lib)
else()
set(math_lib m)
endif()
if(fortran)
find_package(BLAS)
if(BLAS_FOUND)
add_library(linpack OBJECT SOFTWARE/dsvdc.f)
target_link_libraries(linpack PUBLIC ${BLAS_LIBRARIES})
add_executable(fleet FLEET/fleet.c)
target_link_libraries(fleet PRIVATE linpack ${math_lib})
add_test(NAME Fleet
COMMAND fleet new2rastertreet. 2. 9 0.05
${PROJECT_SOURCE_DIR}/TESTDATA/TREE_DATA/TRANS
${PROJECT_SOURCE_DIR}/out ${PROJECT_SOURCE_DIR}/out)
add_executable(singh SINGH/singh.c)
target_link_libraries(singh PRIVATE linpack)
target_include_directories(singh PRIVATE SOFTWARE)
add_test(NAME Singh
COMMAND singh new2binarytreet. 20
${PROJECT_SOURCE_DIR}/TESTDATA/TREE_DATA/TRANS
${PROJECT_SOURCE_DIR}/out -B 150 150
-i 25 -n 2 -w 2 -N 4)
endif()
endif()
add_executable(flow2ps SOFTWARE/psflow.c)
target_link_libraries(flow2ps PRIVATE ${math_lib})
add_executable(anandan ANANDAN/anandan.c)
target_link_libraries(anandan PRIVATE ${math_lib})
add_test(NAME Anandan
COMMAND anandan
${PROJECT_SOURCE_DIR}/TESTDATA/TREE_DATA/TRANS
${PROJECT_SOURCE_DIR}/out/
new2binarytreet. -N 9 10 -W 5 -L 3 -I 15)
add_executable(horn HORN/horn.c)
target_link_libraries(horn PRIVATE ${math_lib})
target_include_directories(horn PRIVATE SOFTWARE)
add_test(NAME HornSchunck
COMMAND horn new2binarytreet. 0.5 1.5 20 100
${PROJECT_SOURCE_DIR}/TESTDATA/TREE_DATA/TRANS
${PROJECT_SOURCE_DIR}/out/
-B 150 150 -MH -T 5.0)
add_executable(lucas LUCAS/lucas.c)
target_link_libraries(lucas PRIVATE ${math_lib})
target_include_directories(lucas PRIVATE SOFTWARE)
add_test(NAME LucasKanade
COMMAND lucas new2binarytreet. 1.5 20 1.0
${PROJECT_SOURCE_DIR}/TESTDATA/TREE_DATA/TRANS
${PROJECT_SOURCE_DIR}/out/
-B 150 150)
add_executable(nagel NAGEL/nagel.c)
target_link_libraries(nagel PRIVATE ${math_lib})
add_test(NAME Nagel
COMMAND nagel
${PROJECT_SOURCE_DIR}/TESTDATA/TREE_DATA/TRANS
${PROJECT_SOURCE_DIR}/out/
newbinarytreet. -SG 1.5 -TG 1.5 -M 20 -A 0.5 -I 100 -B 150 150 -F 5.0)
add_executable(uras URAS/uras.c)
target_link_libraries(uras PRIVATE ${math_lib})
add_test(NAME Uras
COMMAND uras
${PROJECT_SOURCE_DIR}/TESTDATA/TREE_DATA/TRANS
${PROJECT_SOURCE_DIR}/out/
new2binarytreet. -SG 3.0 -TG 1.5 -M 9 -R 1 -F 0.5)
set_property(TEST Anandan Nagel Uras PROPERTY DISABLED true)
# SIGABRT
# --- auto-ignore build directory
if(NOT EXISTS ${PROJECT_BINARY_DIR}/.gitignore)
file(WRITE ${PROJECT_BINARY_DIR}/.gitignore "*")
endif()