diff --git a/cmake/install.cmake b/cmake/install.cmake index 9dd6e77..3c2e769 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -127,24 +127,20 @@ configure_file(protobuf-options.cmake if (protobuf_BUILD_PROTOC_BINARIES) export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc NAMESPACE protobuf:: - FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake + FILE ${CMAKE_CURRENT_BINARY_DIR}/protobuf-targets.cmake ) else (protobuf_BUILD_PROTOC_BINARIES) export(TARGETS libprotobuf-lite libprotobuf NAMESPACE protobuf:: - FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake + FILE ${CMAKE_CURRENT_BINARY_DIR}/protobuf-targets.cmake ) endif (protobuf_BUILD_PROTOC_BINARIES) install(EXPORT protobuf-targets DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" + FILE protobuf-targets.cmake NAMESPACE protobuf:: - COMPONENT protobuf-export) - -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/ - DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" COMPONENT protobuf-export - PATTERN protobuf-targets.cmake EXCLUDE ) option(protobuf_INSTALL_EXAMPLES "Install the examples folder" OFF)