summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/thrift/test/c_glib/CMakeLists.txt
blob: 98173155bdeaf43da0a5e8c5d45641af984dae4f (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Contains the thrift specific LINK_AGAINST_THRIFT_LIBRARY
include(ThriftMacros)

find_package(GLIB REQUIRED COMPONENTS gobject)
include_directories(SYSTEM "${GLIB_INCLUDE_DIR}")
include_directories(SYSTEM "${GLIBCONFIG_INCLUDE_DIR}")

#Make sure gen-c_glib files can be included
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/gen-c_glib")
include_directories("${PROJECT_SOURCE_DIR}/lib/c_glib/src")

set(crosstestgencglib_SOURCES
	gen-c_glib/t_test_second_service.c
	gen-c_glib/t_test_second_service.h
	gen-c_glib/t_test_thrift_test.c
	gen-c_glib/t_test_thrift_test.h
	gen-c_glib/t_test_thrift_test_types.c
	gen-c_glib/t_test_thrift_test_types.h
)
add_library(crosstestgencglib STATIC ${crosstestgencglib_SOURCES})
LINK_AGAINST_THRIFT_LIBRARY(crosstestgencglib thrift_c_glib)

add_executable(test_server src/test_server.c src/thrift_test_handler.c src/thrift_second_service_handler.c)
target_link_libraries(test_server crosstestgencglib)

add_executable(test_client src/test_client.c)
target_link_libraries(test_client crosstestgencglib)

#
# Common thrift code generation rules
#

add_custom_command(OUTPUT gen-c_glib/t_test_second_service.c  gen-c_glib/t_test_second_service.h  gen-c_glib/t_test_thrift_test.c  gen-c_glib/t_test_thrift_test.h  gen-c_glib/t_test_thrift_test_types.c  gen-c_glib/t_test_thrift_test_types.h
    COMMAND ${THRIFT_COMPILER} --gen c_glib -r ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift
)