File: CMakeLists.txt

package info (click to toggle)
libtgowt 0~git20210627.91d836d%2Bdfsg-3~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 121,624 kB
  • sloc: cpp: 1,001,903; ansic: 438,839; asm: 59,305; java: 38,075; python: 17,273; sh: 8,094; objc: 4,256; perl: 1,924; pascal: 1,103; makefile: 958; cs: 471; javascript: 286; xml: 276
file content (40 lines) | stat: -rw-r--r-- 999 bytes parent folder | download | duplicates (3)
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
find_package(Protobuf REQUIRED)

add_library(proto OBJECT)
init_target(proto)
add_library(tg_owt::proto ALIAS proto)

target_compile_definitions(proto
PRIVATE
    HAVE_CONFIG_H
)

set(proto_files
    ${webrtc_loc}/logging/rtc_event_log/rtc_event_log.proto
    ${webrtc_loc}/logging/rtc_event_log/rtc_event_log2.proto
)

protobuf_generate_cpp(proto_sources proto_headers ${proto_files})
set_source_files_properties(${proto_sources} ${proto_headers} PROPERTIES GENERATED TRUE)

target_sources(proto
PRIVATE
    ${proto_headers}
    ${proto_sources}
)

# CMAKE_CURRENT_BINARY_DIR is always used by protobuf_generate_cpp
# to place the generated files. It cannot be changed or overridden.
# We have to push it to the main project because the generated sources
# and headers will be used as include files.
target_include_directories(proto
INTERFACE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
PRIVATE
    ${Protobuf_INCLUDE_DIRS}
)

target_link_libraries(proto
PRIVATE
    ${Protobuf_LIBRARIES}
)