forked from dmitry-kabanov/mardi-open-interfaces-new-attempt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (32 loc) · 1.3 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
cmake_minimum_required(VERSION 3.18)
project(oif-toy-example LANGUAGES C CXX)
set(CMAKE_C_STANDARD 11)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("Disable optimizations for Debug build type")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
endif()
# DOWNLOAD_EXTRACT_TIMESTAMP = TRUE
cmake_policy(SET CMP0135 NEW)
add_subdirectory(src/oif)
add_subdirectory(examples)
# -----------------------------------------------------------------------------
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(test_qeq tests/oif/backend_c/test_qeq.cpp)
target_link_libraries(test_qeq GTest::gtest_main oif_backend_c)
target_link_libraries(test_qeq GTest::gtest_main oif_backend_c_qeq)
target_include_directories(test_qeq PUBLIC include)
target_include_directories(test_qeq PUBLIC ${CMAKE_SOURCE_DIR})
target_compile_features(test_qeq PUBLIC cxx_std_11)
set_target_properties(test_qeq PROPERTIES CXX_EXTENSIONS OFF)
include(GoogleTest)
gtest_discover_tests(test_qeq)
include(CTest)
add_test(NAME test_qeq COMMAND test_qeq)