-
Notifications
You must be signed in to change notification settings - Fork 261
/
CMakeLists.txt
103 lines (94 loc) · 2.94 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
##################### tests/CMakeLists.txt (libopenshot) ######################
# @brief CMake build file for libopenshot (used to generate makefiles)
# @author Jonathan Thomas <jonathan@openshot.org>
#
# @section LICENSE
#
# Copyright (c) 2008-2019 OpenShot Studios, LLC
# <http://www.openshotstudios.com/>. This file is part of
# OpenShot Library (libopenshot), an open-source project dedicated to
# delivering high quality video editing and animation solutions to the
# world. For more information visit <http://www.openshot.org/>.
#
# OpenShot Library (libopenshot) is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# OpenShot Library (libopenshot) is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
################################################################################
# Test media path, used by unit tests for input data
file(TO_NATIVE_PATH "${PROJECT_SOURCE_DIR}/examples/" TEST_MEDIA_PATH)
################# BLACKMAGIC DECKLINK ###################
if(ENABLE_BLACKMAGIC)
# Find BlackMagic DeckLinkAPI libraries
find_package(BlackMagic)
if(BLACKMAGIC_FOUND)
# Include Blackmagic headers (needed for compile)
include_directories(${BLACKMAGIC_INCLUDE_DIR})
endif()
endif()
###
### TEST SOURCE FILES
###
set(OPENSHOT_TESTS
CacheDisk
CacheMemory
Clip
Color
Coordinate
DummyReader
ReaderBase
ImageWriter
FFmpegReader
FFmpegWriter
Fraction
Frame
FrameMapper
KeyFrame
Point
QtImageReader
Settings
Timeline
)
###
### OPENCV RELATED TEST FILES
###
if(ENABLE_OPENCV)
list(APPEND OPENSHOT_TESTS
CVTracker
CVStabilizer
# CVObjectDetection
)
endif()
###
### Catch2 unit tests
###
if (TESTS_ENABLED)
include(Catch)
include(CTest)
# Create object library for test executable main(),
# to avoid recompiling for every test
add_library(catch-main OBJECT catch_main.cpp)
foreach(tname ${OPENSHOT_TESTS})
add_executable(openshot-${tname}-test ${tname}.cpp $<TARGET_OBJECTS:catch-main>)
target_compile_definitions(openshot-${tname}-test PRIVATE
TEST_MEDIA_PATH="${TEST_MEDIA_PATH}"
)
target_link_libraries(openshot-${tname}-test Catch2::Catch2 openshot)
# Automatically configure CTest targets from Catch2 test cases
catch_discover_tests(
openshot-${tname}-test
TEST_PREFIX ${tname}:
)
list(APPEND CATCH2_TEST_TARGETS openshot-${tname}-test)
endforeach()
# Export target list for coverage use
set(UNIT_TEST_TARGETS ${CATCH2_TEST_TARGETS} PARENT_SCOPE)
endif()