From 7d79458fc5d4392f68a08b9f9bef39fc8dcec861 Mon Sep 17 00:00:00 2001 From: Walter Gray Date: Thu, 19 May 2016 14:52:04 -0700 Subject: Fix the cmake configuration file install path to be more standards compliant (See the description of cmake's config search behavior on https://cmake.org/cmake/help/v3.4/command/find_package.html) --- cmake/install.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cmake') 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) -- cgit v1.2.3