Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
protobuf
Commits
cba18efe
Commit
cba18efe
authored
Nov 13, 2017
by
Yangqing Jia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow one to omit building libprotoc and protoc binaries
parent
d3537c24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
CMakeLists.txt
cmake/CMakeLists.txt
+5
-2
install.cmake
cmake/install.cmake
+22
-10
No files found.
cmake/CMakeLists.txt
View file @
cba18efe
...
...
@@ -14,6 +14,7 @@ project(protobuf C CXX)
# Options
option
(
protobuf_BUILD_TESTS
"Build tests"
ON
)
option
(
protobuf_BUILD_EXAMPLES
"Build examples"
OFF
)
option
(
protobuf_BUILD_PROTOC_BINARIES
"Build libprotoc and protoc compiler"
ON
)
if
(
BUILD_SHARED_LIBS
)
set
(
protobuf_BUILD_SHARED_LIBS_DEFAULT ON
)
else
(
BUILD_SHARED_LIBS
)
...
...
@@ -184,8 +185,10 @@ endif (protobuf_UNICODE)
include
(
libprotobuf-lite.cmake
)
include
(
libprotobuf.cmake
)
include
(
libprotoc.cmake
)
include
(
protoc.cmake
)
if
(
protobuf_BUILD_PROTOC_BINARIES
)
include
(
libprotoc.cmake
)
include
(
protoc.cmake
)
endif
(
protobuf_BUILD_PROTOC_BINARIES
)
if
(
protobuf_BUILD_TESTS
)
include
(
tests.cmake
)
...
...
cmake/install.cmake
View file @
cba18efe
...
...
@@ -5,10 +5,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/protobuf-lite.pc.cmake
${
CMAKE_CURRENT_BINARY_DIR
}
/protobuf-lite.pc @ONLY
)
foreach
(
_library
libprotobuf-lite
libprotobuf
libprotoc
)
set
(
_protobuf_libraries libprotobuf-lite libprotobuf
)
if
(
protobuf_BUILD_PROTOC_BINARIES
)
list
(
APPEND _protobuf_libraries libprotoc
)
endif
(
protobuf_BUILD_PROTOC_BINARIES
)
foreach
(
_library
${
_protobuf_libraries
}
)
set_property
(
TARGET
${
_library
}
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:
${
protobuf_source_dir
}
/src>
...
...
@@ -19,8 +21,10 @@ foreach(_library
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
COMPONENT
${
_library
}
)
endforeach
()
install
(
TARGETS protoc EXPORT protobuf-targets
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
COMPONENT protoc
)
if
(
protobuf_BUILD_PROTOC_BINARIES
)
install
(
TARGETS protoc EXPORT protobuf-targets
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
COMPONENT protoc
)
endif
(
protobuf_BUILD_PROTOC_BINARIES
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/protobuf.pc
${
CMAKE_CURRENT_BINARY_DIR
}
/protobuf-lite.pc DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig"
)
...
...
@@ -101,10 +105,18 @@ configure_file(protobuf-options.cmake
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-options.cmake @ONLY
)
# Allows the build directory to be used as a find directory.
export
(
TARGETS libprotobuf-lite libprotobuf libprotoc protoc
NAMESPACE protobuf::
FILE
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-targets.cmake
)
if
(
protobuf_BUILD_PROTOC_BINARIES
)
export
(
TARGETS libprotobuf-lite libprotobuf libprotoc protoc
NAMESPACE protobuf::
FILE
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-targets.cmake
)
else
(
protobuf_BUILD_PROTOC_BINARIES
)
export
(
TARGETS libprotobuf-lite libprotobuf
NAMESPACE protobuf::
FILE
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-targets.cmake
)
endif
(
protobuf_BUILD_PROTOC_BINARIES
)
install
(
EXPORT protobuf-targets
DESTINATION
"
${
CMAKE_INSTALL_CMAKEDIR
}
"
...
...
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