generated from hbenl/vscode-example-test-adapter
-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
30 lines (26 loc) · 1.06 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
cmake_minimum_required(VERSION 3.10)
project(testrunner)
# CppUTest
include(FetchContent)
FetchContent_Declare(
CppUTest
GIT_REPOSITORY https://github.com/cpputest/cpputest.git
GIT_TAG latest-passing-build # or use release tag, eg. v3.8
)
# Set this to ON if you want to have the CppUTests in your project as well.
set(TESTS OFF CACHE BOOL "Switch off CppUTest Test build")
FetchContent_MakeAvailable(CppUTest)
add_executable(testrunner test/basicTests.cpp)
add_dependencies(testrunner CppUTest)
target_link_libraries(testrunner PRIVATE CppUTest)
set_target_properties(testrunner PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/bin
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/bin
)
add_executable(testrunner2 test/secondTests.cpp)
add_dependencies(testrunner2 CppUTest)
target_link_libraries(testrunner2 PRIVATE CppUTest)
set_target_properties(testrunner2 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/bin/tests
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/bin/tests
)