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
a5e116aa
Commit
a5e116aa
authored
Jun 16, 2016
by
Feng Xiao
Committed by
GitHub
Jun 16, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1665 from yeswalrus/cmake-package-requirements
CMake package requirements
parents
f180ef63
4150a91c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
9 deletions
+20
-9
CMakeLists.txt
cmake/CMakeLists.txt
+3
-1
examples.cmake
cmake/examples.cmake
+1
-2
protobuf-config-version.cmake.in
cmake/protobuf-config-version.cmake.in
+16
-6
No files found.
cmake/CMakeLists.txt
View file @
a5e116aa
...
@@ -20,7 +20,9 @@ else (BUILD_SHARED_LIBS)
...
@@ -20,7 +20,9 @@ else (BUILD_SHARED_LIBS)
set
(
protobuf_BUILD_SHARED_LIBS_DEFAULT OFF
)
set
(
protobuf_BUILD_SHARED_LIBS_DEFAULT OFF
)
endif
(
BUILD_SHARED_LIBS
)
endif
(
BUILD_SHARED_LIBS
)
option
(
protobuf_BUILD_SHARED_LIBS
"Build Shared Libraries"
${
protobuf_BUILD_SHARED_LIBS_DEFAULT
}
)
option
(
protobuf_BUILD_SHARED_LIBS
"Build Shared Libraries"
${
protobuf_BUILD_SHARED_LIBS_DEFAULT
}
)
option
(
protobuf_MSVC_STATIC_RUNTIME
"Link static runtime libraries"
ON
)
include
(
CMakeDependentOption
)
cmake_dependent_option
(
protobuf_MSVC_STATIC_RUNTIME
"Link static runtime libraries"
ON
"NOT protobuf_BUILD_SHARED_LIBS"
OFF
)
if
(
MSVC
)
if
(
MSVC
)
set
(
protobuf_WITH_ZLIB_DEFAULT OFF
)
set
(
protobuf_WITH_ZLIB_DEFAULT OFF
)
else
(
MSVC
)
else
(
MSVC
)
...
...
cmake/examples.cmake
View file @
a5e116aa
...
@@ -18,8 +18,7 @@ function(add_examples_build NAME)
...
@@ -18,8 +18,7 @@ function(add_examples_build NAME)
STAMP_DIR
${
NAME
}
/logs
STAMP_DIR
${
NAME
}
/logs
INSTALL_COMMAND
""
#Skip
INSTALL_COMMAND
""
#Skip
LOG_CONFIGURE 1
LOG_CONFIGURE 1
CMAKE_CACHE_ARGS
"-Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=
${
protobuf_MSVC_STATIC_RUNTIME
}
"
CMAKE_CACHE_ARGS
"-DCMAKE_BUILD_TYPE:STRING=
${
CMAKE_BUILD_TYPE
}
"
"-DCMAKE_BUILD_TYPE:STRING=
${
CMAKE_BUILD_TYPE
}
"
"-Dprotobuf_VERBOSE:BOOL=
${
protobuf_VERBOSE
}
"
"-Dprotobuf_VERBOSE:BOOL=
${
protobuf_VERBOSE
}
"
${
ARGN
}
${
ARGN
}
)
)
...
...
cmake/protobuf-config-version.cmake.in
View file @
a5e116aa
...
@@ -27,16 +27,26 @@ else()
...
@@ -27,16 +27,26 @@ else()
endif()
endif()
endif()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
# Check and save build options used to create this package
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
macro(_check_and_save_build_option OPTION VALUE)
return()
if(DEFINED ${PACKAGE_FIND_NAME}_${OPTION} AND
endif()
NOT ${PACKAGE_FIND_NAME}_${OPTION} EQUAL VALUE)
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
set(${PACKAGE_FIND_NAME}_${OPTION} ${VALUE})
endmacro()
_check_and_save_build_option(WITH_ZLIB @protobuf_WITH_ZLIB@)
_check_and_save_build_option(MSVC_STATIC_RUNTIME @protobuf_MSVC_STATIC_RUNTIME@)
_check_and_save_build_option(BUILD_SHARED_LIBS @protobuf_BUILD_SHARED_LIBS@)
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "" AND NOT "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
endif()
endif()
set(${PACKAGE_FIND_NAME}_VERSION_PRERELEASE "@protobuf_VERSION_PRERELEASE@" PARENT_SCOPE)
set(${PACKAGE_FIND_NAME}_VERSION_PRERELEASE "@protobuf_VERSION_PRERELEASE@" 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