diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2015-08-12 23:07:54 -0700 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2015-08-12 23:07:54 -0700 |
commit | f818183f9b0c0c8838dd99c54923d8dd6c11d4ed (patch) | |
tree | 92013c28ab035d8bc8c8d7ca8a8a885b34fc9dc2 /cmake/protobuf-config.cmake.in | |
parent | 38a56ee4b19d72c2e9d81a08b018704d1addf561 (diff) | |
parent | 61e078e803241dc9487544ba3d5d377e16d2838b (diff) | |
download | protobuf-f818183f9b0c0c8838dd99c54923d8dd6c11d4ed.tar.gz protobuf-f818183f9b0c0c8838dd99c54923d8dd6c11d4ed.tar.bz2 protobuf-f818183f9b0c0c8838dd99c54923d8dd6c11d4ed.zip |
Merge pull request #673 from podsvirov/topic-cmake-install
Install protobuf from cmake project
Diffstat (limited to 'cmake/protobuf-config.cmake.in')
-rw-r--r-- | cmake/protobuf-config.cmake.in | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cmake/protobuf-config.cmake.in b/cmake/protobuf-config.cmake.in new file mode 100644 index 00000000..51d715cf --- /dev/null +++ b/cmake/protobuf-config.cmake.in @@ -0,0 +1,27 @@ +# Version info variables
+set(PROTOBUF_VERSION "@protobuf_VERSION@")
+set(PROTOBUF_VERSION_STRING "@protobuf_VERSION_STRING@")
+
+# Current dir
+get_filename_component(_PROTOBUF_PACKAGE_PREFIX
+ "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+# Imported targets
+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(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)
|