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
6f65467d
Commit
6f65467d
authored
Sep 04, 2017
by
Harris Hancock
Committed by
Harris Hancock
Nov 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make CMake package config backward compatible with FindCapnProto module
parent
dd2430ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
+48
-2
CapnProtoConfig.cmake.in
c++/cmake/CapnProtoConfig.cmake.in
+48
-2
No files found.
c++/cmake/CapnProtoConfig.cmake.in
View file @
6f65467d
# Cap'n Proto CMake Package Configuration
#
# When configured and installed, this file enables client projects to find Cap'n Proto using
# CMake's find_package() command. It adds imported targets in the CapnProto:: namespace, such as
# CapnProto::kj, CapnProto::capnp, etc. (one target for each file in pkgconfig/*.pc.in), defines
# the capnp_generate_cpp() function, and exposes some variables for compatibility with the original
# FindCapnProto.cmake module.
#
# Example usage:
# find_package(CapnProto)
# capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS schema.capnp)
...
...
@@ -5,8 +13,26 @@
# add_executable(foo main.cpp ${CAPNP_SRCS})
# target_link_libraries(foo CapnProto::capnp)
#
# If you are using RPC features, use 'CapnProto::capnp-rpc'
# in target_link_libraries call.
# If you are using RPC features, use 'CapnProto::capnp-rpc' in the target_link_libraries() call.
#
# Paths to `capnp` and `capnpc-c++` are exposed in the following variables:
# CAPNP_EXECUTABLE
# Path to the `capnp` tool (can be set to override).
# CAPNPC_CXX_EXECUTABLE
# Path to the `capnpc-c++` tool (can be set to override).
#
# For FindCapnProto.cmake compatibility, the following variables are also provided. Please prefer
# using the imported targets in new CMake code.
# CAPNP_INCLUDE_DIRS
# Include directories for the library's headers.
# CANP_LIBRARIES
# The Cap'n Proto library paths.
# CAPNP_LIBRARIES_LITE
# Paths to only the 'lite' libraries.
# CAPNP_DEFINITIONS
# Compiler definitions required for building with the library.
# CAPNP_FOUND
# Set if the libraries have been located (prefer using CapnProto_FOUND in new code).
#
@PACKAGE_INIT@
...
...
@@ -25,3 +51,23 @@ endif()
include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/CapnProtoMacros.cmake")
# FindCapnProto.cmake provides dependency information via several CAPNP_-prefixed variables. New
# code should not rely on these variables, but prefer linking directly to the imported targets we
# now provide. However, we should still set these variables to ease the transition for projects
# which currently depend on the find-module.
set(CAPNP_INCLUDE_DIRS ${CAPNP_INCLUDE_DIRECTORY})
# No need to list all libraries, just the leaves of the dependency tree.
set(CAPNP_LIBRARIES_LITE CapnProto::capnp)
set(CAPNP_LIBRARIES CapnProto::capnp-rpc CapnProto::capnp-json
CapnProto::kj-http CapnProto::kj-test)
set(CAPNP_DEFINITIONS)
if(TARGET CapnProto::capnp AND NOT TARGET CapnProto::capnp-rpc)
set(CAPNP_DEFINITIONS -DCAPNP_LITE)
endif()
set(CAPNP_FOUND ${CapnProto_FOUND})
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