Commit beca1f52 authored by Feng Xiao's avatar Feng Xiao

Merge pull request #1575 from wal-rus/cmake-install-msvc

Make cmake configuration file install path configurable
parents c034ba76 7d79458f
...@@ -83,9 +83,15 @@ foreach(_file ${nobase_dist_proto_DATA}) ...@@ -83,9 +83,15 @@ foreach(_file ${nobase_dist_proto_DATA})
endforeach() endforeach()
# Export configuration # 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 install(EXPORT protobuf-targets
DESTINATION "lib/cmake/protobuf" DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
COMPONENT protobuf-export) COMPONENT protobuf-export)
configure_file(protobuf-config.cmake.in configure_file(protobuf-config.cmake.in
...@@ -99,5 +105,5 @@ install(FILES ...@@ -99,5 +105,5 @@ install(FILES
"${protobuf_BINARY_DIR}/protobuf-config.cmake" "${protobuf_BINARY_DIR}/protobuf-config.cmake"
"${protobuf_BINARY_DIR}/protobuf-config-version.cmake" "${protobuf_BINARY_DIR}/protobuf-config-version.cmake"
"${protobuf_BINARY_DIR}/protobuf-module.cmake" "${protobuf_BINARY_DIR}/protobuf-module.cmake"
DESTINATION "lib/cmake/protobuf" DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
COMPONENT protobuf-export) COMPONENT protobuf-export)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment