summaryrefslogtreecommitdiffstats
path: root/Tests/FindProtobuf/Test/CMakeLists.txt
blob: 8b6e38a8e1230e3497dd6f00a6d094b3174174f3 (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
cmake_minimum_required(VERSION 3.4)
project(TestFindProtobuf CXX)
include(CTest)

find_package(Protobuf REQUIRED)

add_executable(test_tgt main.cxx)
target_link_libraries(test_tgt protobuf::libprotobuf)
add_test(NAME test_tgt COMMAND test_tgt)

add_executable(test_var main.cxx)
target_include_directories(test_var PRIVATE ${Protobuf_INCLUDE_DIRS})
target_link_libraries(test_var PRIVATE ${Protobuf_LIBRARIES})
add_test(NAME test_var COMMAND test_var)

add_executable(test_tgt_lite main.cxx)
target_link_libraries(test_tgt_lite protobuf::libprotobuf-lite)
add_test(NAME test_tgt_lite COMMAND test_tgt_lite)

add_executable(test_var_lite main.cxx)
target_include_directories(test_var_lite PRIVATE ${Protobuf_INCLUDE_DIRS})
target_link_libraries(test_var_lite PRIVATE ${Protobuf_LITE_LIBRARIES})
add_test(NAME test_var_lite COMMAND test_var_lite)

add_executable(test_tgt_protoc main-protoc.cxx)
target_link_libraries(test_tgt_protoc protobuf::libprotoc)
add_test(NAME test_tgt_protoc COMMAND test_tgt_protoc)

add_executable(test_var_protoc main-protoc.cxx)
target_include_directories(test_var_protoc PRIVATE ${Protobuf_INCLUDE_DIRS})
target_link_libraries(test_var_protoc PRIVATE ${Protobuf_PROTOC_LIBRARIES})
add_test(NAME test_var_protoc COMMAND test_var_protoc)