forked from nv-morpheus/MRC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
91 lines (77 loc) · 2.27 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# SPDX-FileCopyrightText: Copyright (c) 2018-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed 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.
list(APPEND CMAKE_MESSAGE_CONTEXT "nvrpc")
# Keep all source files sorted!!!
add_library(nvrpc
src/executor.cc
src/server.cc
)
add_library(nvrpc-client
src/client/client_executor.cc
)
add_library(${PROJECT_NAME}::nvrpc ALIAS nvrpc)
add_library(${PROJECT_NAME}::nvrpc-client ALIAS nvrpc-client)
target_link_libraries(nvrpc
PUBLIC
Boost::fiber
Boost::context
glog::glog
gRPC::grpc++
gRPC::grpc
gRPC::gpr
)
target_link_libraries(nvrpc-client
PUBLIC
Boost::fiber
Boost::context
glog::glog
gRPC::grpc++
gRPC::grpc
gRPC::gpr
)
target_include_directories(nvrpc
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_include_directories(nvrpc-client
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
set_target_properties(nvrpc PROPERTIES OUTPUT_NAME ${PROJECT_NAME}_nvrpc)
set_target_properties(nvrpc-client PROPERTIES OUTPUT_NAME nvrpc-client)
install(
TARGETS nvrpc
EXPORT ${PROJECT_NAME}-core-exports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
TARGETS nvrpc-client
EXPORT ${PROJECT_NAME}-core-exports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
if(SRF_BUILD_TESTS)
add_subdirectory(tests)
endif()
list(POP_BACK CMAKE_MESSAGE_CONTEXT)