Index: third_party/protobuf/cmake/protobuf-config.cmake.in |
diff --git a/third_party/protobuf/cmake/protobuf-config.cmake.in b/third_party/protobuf/cmake/protobuf-config.cmake.in |
index a044fe5c676c4f246665b9e1a30c68507d547cc0..bb0997b88be7edc6c623af1a29128695ba5e0d43 100644 |
--- a/third_party/protobuf/cmake/protobuf-config.cmake.in |
+++ b/third_party/protobuf/cmake/protobuf-config.cmake.in |
@@ -1,13 +1,27 @@ |
-# User options |
-include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake") |
+# Version info variables |
+set(PROTOBUF_VERSION "@protobuf_VERSION@") |
+set(PROTOBUF_VERSION_STRING "@protobuf_VERSION_STRING@") |
-# Depend packages |
-@_protobuf_FIND_ZLIB@ |
+# Current dir |
+get_filename_component(_PROTOBUF_PACKAGE_PREFIX |
+ "${CMAKE_CURRENT_LIST_FILE}" PATH) |
# Imported targets |
-include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake") |
+include("${_PROTOBUF_PACKAGE_PREFIX}/protobuf-targets.cmake") |
+ |
+# Compute the installation prefix relative to this file. |
+get_filename_component(_PROTOBUF_IMPORT_PREFIX |
+ "${_PROTOBUF_PACKAGE_PREFIX}" PATH) |
+get_filename_component(_PROTOBUF_IMPORT_PREFIX |
+ "${_PROTOBUF_IMPORT_PREFIX}" PATH) |
+get_filename_component(_PROTOBUF_IMPORT_PREFIX |
+ "${_PROTOBUF_IMPORT_PREFIX}" PATH) |
# CMake FindProtobuf module compatible file |
-if(protobuf_MODULE_COMPATIBLE) |
- include("${CMAKE_CURRENT_LIST_DIR}/protobuf-module.cmake") |
+if(NOT DEFINED PROTOBUF_MODULE_COMPATIBLE OR "${PROTOBUF_MODULE_COMPATIBLE}") |
+ include("${_PROTOBUF_PACKAGE_PREFIX}/protobuf-module.cmake") |
endif() |
+ |
+# Cleanup temporary variables. |
+set(_PROTOBUF_PACKAGE_PREFIX) |
+set(_PROTOBUF_IMPORT_PREFIX) |