Source release 17.1.0
This commit is contained in:
14
third_party/protobuf/cmake/install.cmake
vendored
14
third_party/protobuf/cmake/install.cmake
vendored
@@ -6,9 +6,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
|
||||
|
||||
set(_protobuf_libraries libprotobuf-lite libprotobuf)
|
||||
if (protobuf_BUILD_PROTOC_BINARIES)
|
||||
if (protobuf_BUILD_LIBPROTOC)
|
||||
list(APPEND _protobuf_libraries libprotoc)
|
||||
endif (protobuf_BUILD_PROTOC_BINARIES)
|
||||
endif (protobuf_BUILD_LIBPROTOC)
|
||||
|
||||
foreach(_library ${_protobuf_libraries})
|
||||
set_property(TARGET ${_library}
|
||||
@@ -30,7 +30,8 @@ endforeach()
|
||||
|
||||
if (protobuf_BUILD_PROTOC_BINARIES)
|
||||
install(TARGETS protoc EXPORT protobuf-targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc
|
||||
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
|
||||
if (UNIX AND NOT APPLE)
|
||||
set_property(TARGET protoc
|
||||
PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
|
||||
@@ -102,12 +103,16 @@ endforeach()
|
||||
|
||||
# Install configuration
|
||||
set(_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files")
|
||||
set(_exampledir_desc "Directory relative to CMAKE_INSTALL_DATA to install examples")
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/protobuf" CACHE STRING "${_cmakedir_desc}")
|
||||
set(CMAKE_INSTALL_EXAMPLEDIR "${CMAKE_INSTALL_DATADIR}/protobuf/examples" CACHE STRING "${_exampledir_desc}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}")
|
||||
set(CMAKE_INSTALL_EXAMPLEDIR "examples" CACHE STRING "${_exampledir_desc}")
|
||||
endif()
|
||||
mark_as_advanced(CMAKE_INSTALL_CMAKEDIR)
|
||||
mark_as_advanced(CMAKE_INSTALL_EXAMPLEDIR)
|
||||
|
||||
configure_file(protobuf-config.cmake.in
|
||||
${CMAKE_INSTALL_CMAKEDIR}/protobuf-config.cmake @ONLY)
|
||||
@@ -145,6 +150,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/
|
||||
|
||||
option(protobuf_INSTALL_EXAMPLES "Install the examples folder" OFF)
|
||||
if(protobuf_INSTALL_EXAMPLES)
|
||||
install(DIRECTORY ../examples/ DESTINATION examples
|
||||
install(DIRECTORY ../examples/
|
||||
DESTINATION "${CMAKE_INSTALL_EXAMPLEDIR}"
|
||||
COMPONENT protobuf-examples)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user