blob: e96f768d79a0e119135ea1f4544bb21380375a11 (
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
45
46
47
48
49
50
51
52
53
54
|
find_package(GTest REQUIRED MODULE)
# Use this variable for tests which provide their own main().
SET(2GEOM_TESTS_SRC
#bezier-utils-test
#lin_alg_test
sbasis-text-test
root-find-test
implicitization-test
#timing-test
#rtree-performance-test
)
# Use this variable for GTest tests which should have a default main().
SET(2GEOM_GTESTS_SRC
affine-test
angle-test
bezier-test
choose-test
circle-test
convex-hull-test
coord-test
ellipse-test
elliptical-arc-test
intersection-graph-test
interval-test
line-test
nl-vector-test
parallelogram-test
path-test
point-test
polynomial-test
rect-test
sbasis-test
)
foreach(source ${2GEOM_GTESTS_SRC})
add_executable(${source} ${source}.cpp)
target_include_directories(${source} PRIVATE ${GSL_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS})
target_link_libraries(${source} 2geom GTest::Main ${GSL_LIBRARIES} ${GTK3_LIBRARIES})
add_test(NAME ${source} COMMAND ${source})
endforeach()
foreach(source ${2GEOM_TESTS_SRC})
add_executable(${source} ${source}.cpp)
target_include_directories(${source} PRIVATE ${GSL_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS})
target_link_libraries(${source} 2geom GTest::GTest ${GSL_LIBRARIES} ${GTK3_LIBRARIES})
add_test(NAME ${source} COMMAND ${source})
endforeach(source)
if(WIN32 AND 2GEOM_BUILD_SHARED)
add_custom_target(copy ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/2geom/lib2geom.dll ${CMAKE_BINARY_DIR}/src/tests/lib2geom.dll)
add_dependencies(copy 2geom)
endif()
|