Cmake не удалось найти библиотеки PostgreSQL При компиляции SOCI

#c #sql #postgresql #soci

Вопрос:

  • ОС: Windows 10
  • Компилятор: Visual Studio 2019
  • Версия SOCI: 4.0.2
  • Версия PostgreSQL: 13
  • Версия CMake 3.20.3

Я не слишком знаком с CMake, так что потерпите, если я делаю что-то неосведомленное и неправильно.

Шаги:

  1. Загрузите и выполните postgresql-13.3-2-windows-x64.exe
  2. Загрузите и выполните pgadmin4-5.3-x64.exe
  3. Скачать и извлечь SOCI 4.0.2
  4. Создайте каталог сборки в SOCI 4.0.2
  5. Вызовите следующее из cmd в каталоге сборки:
 cmake -G "Visual Studio 16 2019" .. -DWITH_BOOST=OFF -DWITH_POSTGRESQL=ON -DPOSTGRESQL_INCLUDE_DIR:STRING="c:/Program Files/PostgreSQL/13/include" -DPOSTGRESQL_LIBRARIES:STRING="c:/Program Files/PostgreSQL/13/lib" -DSOCI_STATIC=ON -DSOCI_SHARED=OFF
 

Я получил следующий результат

 CMake Deprecation Warning at CMakeLists.txt:13 (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.


-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.29.30037.0
-- The CXX compiler identification is MSVC 19.29.30037.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test SOCI_HAVE_VISIBILITY_SUPPORT
-- Performing Test SOCI_HAVE_VISIBILITY_SUPPORT - Failed
-- Looking for _M_AMD64
-- Looking for _M_AMD64 - found
-- Looking for _M_IX86
-- Looking for _M_IX86 - not found
-- Configuring SOCI:
-- SOCI_VERSION                             = 4.0.2
-- SOCI_ABI_VERSION                         = 4_0
-- SOCI_SHARED                              = OFF
-- SOCI_STATIC                              = ON
-- SOCI_TESTS                               = ON
-- SOCI_ASAN                                = OFF
-- SOCI_CXX11                               = OFF
-- LIB_SUFFIX                               = 64
-- Looking for SOCI dependencies:
-- Threads:
-- CMAKE_THREAD_LIBS_INIT                   =
-- Boost: disabled, since WITH_BOOST=OFF
-- MySQL:
-- Performing Test HAVE_MYSQL_OPT_EMBEDDED_CONNECTION
-- Performing Test HAVE_MYSQL_OPT_EMBEDDED_CONNECTION - Failed
-- MySQL not found.
-- MySQL Embedded not found.
-- WARNING: MySQL libraries not found, some features will be disabled.
-- ODBC:
-- ODBC_INCLUDE_DIR                         =
-- ODBC_LIBRARIES                           = odbc32.lib
-- Oracle:
-- ORACLE_HOME=
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (ORACLE)
  does not match the name of the calling package (Oracle).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/modules/FindOracle.cmake:84 (find_package_handle_standard_args)
  cmake/dependencies/Oracle.cmake:3 (find_package)
  cmake/SociDependencies.cmake:79 (include)
  CMakeLists.txt:129 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- None of the supported Oracle versions (19;18;12;11;10) could be found, consider updating ORACLE_VERSIONS if the version you use is not among them.
-- WARNING: Oracle libraries not found, some features will be disabled.
-- PostgreSQL:
-- WARNING: PostgreSQL libraries not found, some features will be disabled.
-- SQLite3:
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (SQLITE3)
  does not match the name of the calling package (SQLite3).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/modules/FindSQLite3.cmake:57 (find_package_handle_standard_args)
  cmake/dependencies/SQLite3.cmake:3 (find_package)
  cmake/SociDependencies.cmake:79 (include)
  CMakeLists.txt:129 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- SQLite3 not found (SQLITE3_INCLUDE_DIR=SQLITE3_INCLUDE_DIR-NOTFOUND, SQLITE3_LIBRARY=SQLITE3_LIBRARY-NOTFOUND.
-- WARNING: SQLite3 libraries not found, some features will be disabled.
-- Firebird:
-- SOCI_FIREBIRD_EMBEDDED                   = OFF
-- WARNING: Firebird libraries not found, some features will be disabled.
-- DB2:
-- WARNING: DB2 libraries not found, some features will be disabled.
-- Configuring SOCI core library:
-- SOCI_CORE_TARGET                         = soci_core
-- SOCI_CORE_TARGET_OUTPUT_NAME             = soci_core_4_0
-- SOCI_CORE_DEPS_LIBS                      =
-- SOCI_CORE_INCLUDE_DIRS                   = C:/Users/Hbagh/Downloads/soci-4.0.2/build C:/Users/Hbagh/Downloads/soci-4.0.2/include C:/Users/Hbagh/Downloads/soci-4.0.2/build/include C:/Users/Hbagh/Downloads/soci-4.0.2/include/private C:/Users/Hbagh/Downloads/soci-4.0.2/build/src/core
-- WITH_BOOST                               = OFF
-- COMPILE_DEFINITIONS                      = _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNING _SCL_SECURE_NO_WARNINGS SOCI_ABI_VERSION="4_0" DBUG_OFF SOCI_LIB_PREFIX="soci_" SOCI_LIB_SUFFIX=".dll" SOCI_DEBUG_POSTFIX=""
--
-- Configuring SOCI backend libraries:
-- MySQL not found.
-- MySQL Embedded not found.
-- ORACLE_HOME=
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (ORACLE)
  does not match the name of the calling package (Oracle).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/modules/FindOracle.cmake:84 (find_package_handle_standard_args)
  src/backends/CMakeLists.txt:17 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- None of the supported Oracle versions (19;18;12;11;10) could be found, consider updating ORACLE_VERSIONS if the version you use is not among them.
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (SQLITE3)
  does not match the name of the calling package (SQLite3).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/modules/FindSQLite3.cmake:57 (find_package_handle_standard_args)
  src/backends/CMakeLists.txt:17 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- SQLite3 not found (SQLITE3_INCLUDE_DIR=SQLITE3_INCLUDE_DIR-NOTFOUND, SQLITE3_LIBRARY=SQLITE3_LIBRARY-NOTFOUND.
-- Empty - SOCI backend skeleton for new backends development
-- SOCI_EMPTY                               = ON
-- SOCI_EMPTY_TARGET                        = soci_empty
-- SOCI_EMPTY_OUTPUT_NAME                   = soci_empty_4_0
-- SOCI_EMPTY_COMPILE_DEFINITIONS           = _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNING _SCL_SECURE_NO_WARNINGS SOCI_ABI_VERSION="4_0" DBUG_OFF DBUG_OFF
-- SOCI_EMPTY_INCLUDE_DIRECTORIES           = C:/Users/Hbagh/Downloads/soci-4.0.2/build C:/Users/Hbagh/Downloads/soci-4.0.2/include C:/Users/Hbagh/Downloads/soci-4.0.2/build/include C:/Users/Hbagh/Downloads/soci-4.0.2/include/private C:/Users/Hbagh/Downloads/soci-4.0.2/include/private
-- ODBC - SOCI backend for ODBC
-- SOCI_ODBC                                = ON
-- SOCI_ODBC_TARGET                         = soci_odbc
-- SOCI_ODBC_OUTPUT_NAME                    = soci_odbc_4_0
-- SOCI_ODBC_COMPILE_DEFINITIONS            = _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNING _SCL_SECURE_NO_WARNINGS SOCI_ABI_VERSION="4_0" DBUG_OFF DBUG_OFF
-- SOCI_ODBC_INCLUDE_DIRECTORIES            = C:/Users/Hbagh/Downloads/soci-4.0.2/build C:/Users/Hbagh/Downloads/soci-4.0.2/include C:/Users/Hbagh/Downloads/soci-4.0.2/build/include C:/Users/Hbagh/Downloads/soci-4.0.2/include/private C:/Users/Hbagh/Downloads/soci-4.0.2/include/private
--
-- Configuring SOCI tests:
-- SOCI_EMPTY_TEST_CONNSTR                  = dummy
-- SOCI_ODBC_TEST_ACCESS_CONNSTR            = FILEDSN=C:/Users/Hbagh/Downloads/soci-4.0.2/tests/odbc/test-access.dsn
-- SOCI_ODBC_TEST_MSSQL_CONNSTR             = FILEDSN=C:/Users/Hbagh/Downloads/soci-4.0.2/tests/odbc/test-mssql.dsn
-- SOCI_ODBC_TEST_MYSQL_CONNSTR             = FILEDSN=C:/Users/Hbagh/Downloads/soci-4.0.2/tests/odbc/test-mysql.dsn
-- SOCI_ODBC_TEST_POSTGRESQL_CONNSTR        = FILEDSN=C:/Users/Hbagh/Downloads/soci-4.0.2/tests/odbc/test-postgresql-win64.dsn
-- ODBC DB2 test disabled.
--
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    POSTGRESQL_LIBRARIES


-- Build files have been written to: C:/Users/Hbagh/Downloads/soci-4.0.2/build
 

Мне бросается в глаза следующее:

 -- PostgreSQL:
-- WARNING: PostgreSQL libraries not found, some features will be disabled.
 
 CMake Warning:
  Manually-specified variables were not used by the project:

    POSTGRESQL_LIBRARIES
 

Комментарии:

1. «Загрузите и выполните postgresql-13.3-2-windows-x64.exe «. «Ни одна из поддерживаемых версий Oracle ( 19;18;12;11;10 ) может быть найдено» Может быть значительным, нет?

2. Поправьте меня, если я ошибаюсь, но разве oracle не имеет собственной системы sql, которая не имеет к этому отношения?

3. Вполне может быть, да. Я просто указал на очевидное.

4. В любом случае спасибо, что попытались помочь.