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
0dca3cc5
Commit
0dca3cc5
authored
Aug 03, 2016
by
Feng Xiao
Committed by
GitHub
Aug 03, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1865 from podsvirov/topic-cmake-project
CMake: Improvements and Bugfixes
parents
dedd8aec
eefd1fdd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
CMakeLists.txt
cmake/CMakeLists.txt
+2
-0
libprotobuf.cmake
cmake/libprotobuf.cmake
+4
-1
protobuf-config.cmake.in
cmake/protobuf-config.cmake.in
+3
-0
protobuf-module.cmake.in
cmake/protobuf-module.cmake.in
+0
-1
No files found.
cmake/CMakeLists.txt
View file @
0dca3cc5
...
...
@@ -86,6 +86,7 @@ if (CMAKE_USE_PTHREADS_INIT)
add_definitions
(
-DHAVE_PTHREAD
)
endif
(
CMAKE_USE_PTHREADS_INIT
)
set
(
_protobuf_FIND_ZLIB
)
if
(
protobuf_WITH_ZLIB
)
find_package
(
ZLIB
)
if
(
ZLIB_FOUND
)
...
...
@@ -96,6 +97,7 @@ if (protobuf_WITH_ZLIB)
# Using imported target if exists
if
(
TARGET ZLIB::ZLIB
)
set
(
ZLIB_LIBRARIES ZLIB::ZLIB
)
set
(
_protobuf_FIND_ZLIB
"if(NOT ZLIB_FOUND)
\n
find_package(ZLIB)
\n
endif()"
)
endif
(
TARGET ZLIB::ZLIB
)
else
(
ZLIB_FOUND
)
set
(
HAVE_ZLIB 0
)
...
...
cmake/libprotobuf.cmake
View file @
0dca3cc5
...
...
@@ -56,7 +56,10 @@ set(libprotobuf_files
add_library
(
libprotobuf
${
protobuf_SHARED_OR_STATIC
}
${
libprotobuf_lite_files
}
${
libprotobuf_files
}
)
target_link_libraries
(
libprotobuf
${
CMAKE_THREAD_LIBS_INIT
}
${
ZLIB_LIBRARIES
}
)
target_link_libraries
(
libprotobuf
${
CMAKE_THREAD_LIBS_INIT
}
)
if
(
protobuf_WITH_ZLIB
)
target_link_libraries
(
libprotobuf
${
ZLIB_LIBRARIES
}
)
endif
()
target_include_directories
(
libprotobuf PUBLIC
${
protobuf_source_dir
}
/src
)
if
(
MSVC AND protobuf_BUILD_SHARED_LIBS
)
target_compile_definitions
(
libprotobuf
...
...
cmake/protobuf-config.cmake.in
View file @
0dca3cc5
# User options
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake")
# Depend packages
@_protobuf_FIND_ZLIB@
# Imported targets
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake")
...
...
cmake/protobuf-module.cmake.in
View file @
0dca3cc5
...
...
@@ -147,7 +147,6 @@ function(_protobuf_find_libraries name filename)
LOCATION_RELEASE)
get_target_property(${name}_LIBRARY_DEBUG protobuf::lib${filename}
LOCATION_DEBUG)
endif()
select_library_configurations(${name})
set(${name}_LIBRARY ${${name}_LIBRARY} PARENT_SCOPE)
...
...
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