get_target_property() called with non-existent target "pb_libprotobuf"

  alpine, c++, cmake, mysql-connector, protobuf-c

I am trying to install MySQL connector C++ from its source code in my alpine:3.14 image it complains something about libprotobuf which I have installed the library using both the apk add protobuf-dev and also from its source code, but I cannot get rid of this error, the output of the compilation for compiling the MySQL connector is a following, and also I have googled it and apparently there is no post/question about this error in the internet!

/dep/mysql-connector-cpp/build # cmake -DCMAKE_BUILD_TYPE=Release -DWITH_JDBC=ON ..
-- BIG_ENDIAN: 0
Building version 8.0.26
Building on system: Linux-5.4.0-86-generic (x86_64)
Using cmake generator: Unix Makefiles
Using toolset: 
Building 64bit code
Building shared connector library
Configuring CDK as part of MySQL_CONCPP project
-- Looking for SSL library.
-- found OpenSSL headers at: /usr/include
-- OpenSSL library: /usr/lib/libssl.so
-- OpenSSL crypto library: /usr/lib/libcrypto.so
-- Using OpenSSL version: 1.1.1l
-- found required X509 extensions
-- Setting up Protobuf.
==== Configuring Protobuf build using cmake generator: Unix Makefiles   -DCMAKE_SYSTEM_NAME=Linux;-DCMAKE_SYSTEM_VERSION=5.4.0-86-generic
-- BIG_ENDIAN: 0
-- Configuring done
-- Generating done
-- Build files have been written to: /dep/mysql-connector-cpp/cdk/protobuf
==== Protobuf build configured.
CMake Error at cdk/cmake/DepFindProtobuf.cmake:155 (include):
  include could not find requested file:

    /dep/mysql-connector-cpp/build/cdk/protobuf/exports.cmake
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_libprotobuf".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_libprotobuf".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_libprotobuf".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_libprotobuf".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_libprotobuf".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target
  "pb_libprotobuf-lite".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target
  "pb_libprotobuf-lite".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target
  "pb_libprotobuf-lite".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target
  "pb_libprotobuf-lite".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target
  "pb_libprotobuf-lite".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_protoc".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_protoc".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_protoc".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_protoc".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


CMake Error at cdk/cmake/DepFindProtobuf.cmake:189 (get_target_property):
  get_target_property() called with non-existent target "pb_protoc".
Call Stack (most recent call first):
  cdk/cmake/dependency.cmake:42 (include)
  cdk/CMakeLists.txt:97 (find_dependency)


Processor Count: 4
-- Setting up RapidJSON.
Skipping second declaration of config option: THROW_AS_ASSERT (found in: /dep/mysql-connector-cpp/cdk/CMakeLists.txt)
CMake Deprecation Warning at cdk/extra/zlib/CMakeLists.txt:24 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at cdk/extra/zlib/CMakeLists.txt:37 (CMAKE_POLICY):
  The OLD behavior for policy CMP0075 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at cdk/extra/zstd/CMakeLists.txt:11 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- ZSTD_LEGACY_SUPPORT not defined!
CMake Deprecation Warning at cdk/core/CMakeLists.txt:30 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Wrote configuration header: /dep/mysql-connector-cpp/build/cdk/include/mysql/cdk/config.h
Legacy library soversion: 9
Looking for MySQL Client library:
-- libs:  -lmariadb
-- libs search path: 
  version: 10.5.5
  include path: /usr/include/mysql
  library location: /usr/lib/libmysqlclient.so
  dependencies search path: -L/usr/lib -L/usr/lib/private
  dependencies: mariadb
-- Using static libmysql binding
Preparing to merge SHARED library: connector-jdbc (jdbc)
Connector legacy library name: mysqlcppconn
Preparing to merge SHARED library: connector (xapi;devapi)
Connector library name: mysqlcppconn8
Building version 8.0.26
Generating INFO_SRC
Generating INFO_BIN
Install location: /usr/local/mysql/connector-c++-
Connector libraries will be installed at: lib64

Project configuration options:

: BUILD_STATIC: OFF
Build static version of connector library

: WITH_SSL: system
Either 'system' to use system-wide OpenSSL library, or custom OpenSSL location. (default : system)

: WITH_JDBC: ON
Whether to build a variant of connector library which implements legacy JDBC API

: WITH_MYSQL: 
Base location of (monolithic) MySQL installation.

: WITH_BOOST: 
Boost install location

-- Configuring incomplete, errors occurred!
See also "/dep/mysql-connector-cpp/build/CMakeFiles/CMakeOutput.log".
See also "/dep/mysql-connector-cpp/build/CMakeFiles/CMakeError.log".

I even cleaned the previous runs and did ldconfig but nothing helped! Can anybody know what I am missing here?

Source: Windows Questions C++

LEAVE A COMMENT