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
23fef56e
Commit
23fef56e
authored
Jun 06, 2016
by
Walter Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace handwritten protobuf-targets with exported version.
parent
09f6a5c1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
39 deletions
+24
-39
CMakeLists.txt
cmake/CMakeLists.txt
+1
-1
install.cmake
cmake/install.cmake
+23
-21
protobuf-targets.cmake
cmake/protobuf-targets.cmake
+0
-17
No files found.
cmake/CMakeLists.txt
View file @
23fef56e
...
...
@@ -31,7 +31,7 @@ set(protobuf_DEBUG_POSTFIX "d"
CACHE STRING
"Default debug postfix"
)
mark_as_advanced
(
protobuf_DEBUG_POSTFIX
)
# User options
include
(
"
${
CMAKE_CURRENT_LIST_DIR
}
/protobuf-options.cmake"
)
include
(
protobuf-options.cmake
)
# Path to main configure script
set
(
protobuf_CONFIGURE_SCRIPT
"../configure.ac"
)
...
...
cmake/install.cmake
View file @
23fef56e
...
...
@@ -6,6 +6,7 @@ foreach(_library
libprotoc
)
set_property
(
TARGET
${
_library
}
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:
${
protobuf_source_dir
}
/src>
$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>
)
install
(
TARGETS
${
_library
}
EXPORT protobuf-targets
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
COMPONENT
${
_library
}
...
...
@@ -80,7 +81,7 @@ foreach(_file ${nobase_dist_proto_DATA})
endif
()
endforeach
()
#
Export
configuration
#
Install
configuration
set
(
_cmakedir_desc
"Directory relative to CMAKE_INSTALL to install the cmake configuration files"
)
if
(
NOT MSVC
)
set
(
CMAKE_INSTALL_CMAKEDIR
"
${
CMAKE_INSTALL_LIBDIR
}
/cmake/protobuf"
CACHE STRING
"
${
_cmakedir_desc
}
"
)
...
...
@@ -89,33 +90,34 @@ else()
endif
()
mark_as_advanced
(
CMAKE_INSTALL_CMAKEDIR
)
# Import configuration
install
(
EXPORT protobuf-targets
DESTINATION
"
${
CMAKE_INSTALL_CMAKEDIR
}
"
NAMESPACE protobuf::
COMPONENT protobuf-export
)
configure_file
(
protobuf-config.cmake.in
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-config.cmake @ONLY
)
configure_file
(
protobuf-config-version.cmake.in
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-config-version.cmake @ONLY
)
configure_file
(
protobuf-module.cmake.in
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-module.cmake @ONLY
)
configure_file
(
protobuf-options.cmake
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-options.cmake @ONLY
)
# Build tree import configuration (for import from subprojects)
if
(
NOT EXISTS
"
${
protobuf_DIR
}
"
)
set
(
protobuf_DIR
"
${
protobuf_BINARY_DIR
}
/
${
CMAKE_INSTALL_CMAKEDIR
}
"
)
set
(
Protobuf_DIR
"
${
protobuf_DIR
}
"
)
file
(
COPY
"
${
CMAKE_CURRENT_LIST_DIR
}
/protobuf-options.cmake"
"
${
CMAKE_CURRENT_LIST_DIR
}
/protobuf-targets.cmake"
DESTINATION
"
${
protobuf_DIR
}
"
)
endif
()
# 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
)
install
(
FILES
"
${
CMAKE_CURRENT_LIST_DIR
}
/protobuf-options.cmake"
"
${
protobuf_BINARY_DIR
}
/
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-config.cmake"
"
${
protobuf_BINARY_DIR
}
/
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-config-version.cmake"
"
${
protobuf_BINARY_DIR
}
/
${
CMAKE_INSTALL_CMAKEDIR
}
/protobuf-module.cmake"
install
(
EXPORT protobuf-targets
DESTINATION
"
${
CMAKE_INSTALL_CMAKEDIR
}
"
NAMESPACE protobuf::
COMPONENT protobuf-export
)
install
(
DIRECTORY
${
CMAKE_BINARY_DIR
}
/
${
CMAKE_INSTALL_CMAKEDIR
}
/
DESTINATION
"
${
CMAKE_INSTALL_CMAKEDIR
}
"
COMPONENT protobuf-export
PATTERN protobuf-targets.cmake EXCLUDE
)
option
(
protobuf_INSTALL_EXAMPLES
"Install the examples folder"
OFF
)
if
(
protobuf_INSTALL_EXAMPLES
)
install
(
DIRECTORY ../examples/ DESTINATION examples
COMPONENT protobuf-examples
)
endif
()
cmake/protobuf-targets.cmake
deleted
100644 → 0
View file @
09f6a5c1
# Library aliases
foreach
(
_library
libprotobuf-lite
libprotobuf
libprotoc
)
if
(
TARGET
${
_library
}
AND NOT TARGET protobuf::
${
_library
}
)
add_library
(
protobuf::
${
_library
}
ALIAS
${
_library
}
)
endif
()
endforeach
()
# Executable aliases
foreach
(
_executable
protoc
)
if
(
TARGET
${
_executable
}
AND NOT TARGET protobuf::
${
_executable
}
)
add_executable
(
protobuf::
${
_executable
}
ALIAS
${
_executable
}
)
endif
()
endforeach
()
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