To change the path of libprotobuf.a library from /lib64/ to /usr/local/lib

20 views
Skip to first unread message

RAHUL RAJ D N

unread,
May 18, 2021, 1:26:14 PM5/18/21
to grpc.io
Hi  All.
With the gRPC installed, I have libprotobuf.a in the lib64/ folder. But I want the libprotobuf.a library to be used from /usr/local/lib. I tried changing the libprotobuf path as shown here in the /lib64/cmake/protobuf/protobuf-targets-noconfig.cmake file.

# Import target "protobuf::libprotobuf" for configuration "" set_property(TARGET protobuf::libprotobuf APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) set_target_properties(protobuf::libprotobuf PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX" IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/usr/local/lib/libprotobuf.a" ) list(APPEND _IMPORT_CHECK_TARGETS protobuf::libprotobuf ) list(APPEND _IMPORT_CHECK_FILES_FOR_protobuf::libprotobuf "${_IMPORT_PREFIX}/usr/local/lib/libprotobuf.a" )

But I get the following error while building grpc program :

[root#]: cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../..
-- Found Protobuf: /bin/protoc-3.15.2.0 (found version "3.15.2.0") -- Using protobuf 3.15.2.0 -- Using gRPC 1.37.1 -- Configuring done
CMake Error at CMakeLists.txt:153 (add_executable):
 Target "server" links to target "protobuf::/usr/local/lib/libprotobuf" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?
 CMake Error at CMakeLists.txt:153 (add_executable):
 Target "client" links to target "protobuf::/usr/local/lib/libprotobuf" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

Can anyone please say what all changes to be done in the CMakelists.txt and *.cmake files ? Thank you!!

Reply all
Reply to author
Forward
0 new messages