Skip to content

Commit

Permalink
Fix the cmake configuration file install path to be more standards co…
Browse files Browse the repository at this point in the history
…mpliant (See the description of cmake's config search behavior on https://cmake.org/cmake/help/v3.4/command/find_package.html)
  • Loading branch information
Walter Gray committed May 19, 2016
1 parent c034ba7 commit 7d79458
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

0 comments on commit 7d79458

Please sign in to comment.