Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
07b2b9c1
Commit
07b2b9c1
authored
Oct 27, 2017
by
Harris Hancock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update example CMake usage to best practices
parent
3a2f34c2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
CapnProtoConfig.cmake.in
c++/cmake/CapnProtoConfig.cmake.in
+2
-2
CapnProtoMacros.cmake
c++/cmake/CapnProtoMacros.cmake
+4
-4
CMakeLists.txt
c++/samples/CMakeLists.txt
+3
-3
No files found.
c++/cmake/CapnProtoConfig.cmake.in
View file @
07b2b9c1
...
@@ -9,9 +9,9 @@
...
@@ -9,9 +9,9 @@
# Example usage:
# Example usage:
# find_package(CapnProto)
# find_package(CapnProto)
# capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS schema.capnp)
# capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS schema.capnp)
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
# add_executable(foo main.cpp ${CAPNP_SRCS})
# add_executable(foo main.cpp ${CAPNP_SRCS})
# target_link_libraries(foo CapnProto::capnp)
# target_link_libraries(foo PRIVATE CapnProto::capnp)
# target_include_directories(foo PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
#
#
# If you are using RPC features, use 'CapnProto::capnp-rpc' in the target_link_libraries() call.
# If you are using RPC features, use 'CapnProto::capnp-rpc' in the target_link_libraries() call.
#
#
...
...
c++/cmake/CapnProtoMacros.cmake
View file @
07b2b9c1
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
# Example usage:
# Example usage:
# find_package(CapnProto)
# find_package(CapnProto)
# capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS schema.capnp)
# capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS schema.capnp)
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
# add_executable(foo main.cpp ${CAPNP_SRCS})
# add_executable(foo main.cpp ${CAPNP_SRCS})
# target_link_libraries(foo CapnProto::capnp-rpc)
# target_link_libraries(foo PRIVATE CapnProto::capnp-rpc)
# target_include_directories(foo PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
#
#
# If you are
using not using the RPC features you can us
e
# If you are
not using the RPC features you can use 'CapnProto::capnp' in th
e
#
'CapnProto::capnp' in
target_link_libraries call
# target_link_libraries call
#
#
# Configuration variables (optional):
# Configuration variables (optional):
# CAPNPC_OUTPUT_DIR
# CAPNPC_OUTPUT_DIR
...
...
c++/samples/CMakeLists.txt
View file @
07b2b9c1
...
@@ -23,7 +23,7 @@ find_package(CapnProto CONFIG REQUIRED)
...
@@ -23,7 +23,7 @@ find_package(CapnProto CONFIG REQUIRED)
capnp_generate_cpp
(
addressbookSources addressbookHeaders addressbook.capnp
)
capnp_generate_cpp
(
addressbookSources addressbookHeaders addressbook.capnp
)
add_executable
(
addressbook addressbook.c++
${
addressbookSources
}
)
add_executable
(
addressbook addressbook.c++
${
addressbookSources
}
)
target_link_libraries
(
addressbook CapnProto::capnp
)
target_link_libraries
(
addressbook
PRIVATE
CapnProto::capnp
)
target_include_directories
(
addressbook PRIVATE
${
CMAKE_CURRENT_BINARY_DIR
}
)
target_include_directories
(
addressbook PRIVATE
${
CMAKE_CURRENT_BINARY_DIR
}
)
# Don't build the rpc sample if find_package() found an installation of Cap'n Proto lite.
# Don't build the rpc sample if find_package() found an installation of Cap'n Proto lite.
...
@@ -31,8 +31,8 @@ if(TARGET CapnProto::capnp-rpc)
...
@@ -31,8 +31,8 @@ if(TARGET CapnProto::capnp-rpc)
capnp_generate_cpp
(
calculatorSources calculatorHeaders calculator.capnp
)
capnp_generate_cpp
(
calculatorSources calculatorHeaders calculator.capnp
)
add_executable
(
calculator-client calculator-client.c++
${
calculatorSources
}
)
add_executable
(
calculator-client calculator-client.c++
${
calculatorSources
}
)
add_executable
(
calculator-server calculator-server.c++
${
calculatorSources
}
)
add_executable
(
calculator-server calculator-server.c++
${
calculatorSources
}
)
target_link_libraries
(
calculator-client CapnProto::capnp-rpc
)
target_link_libraries
(
calculator-client
PRIVATE
CapnProto::capnp-rpc
)
target_link_libraries
(
calculator-server CapnProto::capnp-rpc
)
target_link_libraries
(
calculator-server
PRIVATE
CapnProto::capnp-rpc
)
target_include_directories
(
calculator-client PRIVATE
${
CMAKE_CURRENT_BINARY_DIR
}
)
target_include_directories
(
calculator-client PRIVATE
${
CMAKE_CURRENT_BINARY_DIR
}
)
target_include_directories
(
calculator-server PRIVATE
${
CMAKE_CURRENT_BINARY_DIR
}
)
target_include_directories
(
calculator-server PRIVATE
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
()
endif
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment