aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng Xiao <xiaofeng@google.com>2016-05-20 11:45:01 -0700
committerFeng Xiao <xiaofeng@google.com>2016-05-20 11:45:01 -0700
commitbeca1f52ef36dba5f3caf7310d96ccf04ea8a6f2 (patch)
tree0cc17b5fadb69e95db279a93b4838ab60fb631e4
parentc034ba768f244930a476e484334e69b9a6f26931 (diff)
parent7d79458fc5d4392f68a08b9f9bef39fc8dcec861 (diff)
downloadprotobuf-beca1f52ef36dba5f3caf7310d96ccf04ea8a6f2.tar.gz
protobuf-beca1f52ef36dba5f3caf7310d96ccf04ea8a6f2.tar.bz2
protobuf-beca1f52ef36dba5f3caf7310d96ccf04ea8a6f2.zip
Merge pull request #1575 from wal-rus/cmake-install-msvc
Make cmake configuration file install path configurable
-rw-r--r--cmake/install.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmake/install.cmake b/cmake/install.cmake
index dbb4265d..e0962659 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -83,9 +83,15 @@ foreach(_file ${nobase_dist_proto_DATA})
endforeach()
# Export 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")
+else()
+ set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}")
+endif()
install(EXPORT protobuf-targets
- DESTINATION "lib/cmake/protobuf"
+ DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
COMPONENT protobuf-export)
configure_file(protobuf-config.cmake.in
@@ -99,5 +105,5 @@ install(FILES
"${protobuf_BINARY_DIR}/protobuf-config.cmake"
"${protobuf_BINARY_DIR}/protobuf-config-version.cmake"
"${protobuf_BINARY_DIR}/protobuf-module.cmake"
- DESTINATION "lib/cmake/protobuf"
+ DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
COMPONENT protobuf-export)