c ++ - PostgreSQL libpq windows 10 CMake mangler PostgreSQL\_LIBRARY

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg rer for at opsætte et CMake-projekt under Windows 10 ved hjælp af PostgreSQL.


Når jeg forsøger at find\_package


find\_package(PostgreSQL REQUIRED)


Jeg får følgende fejl


  Could NOT find PostgreSQL (missing: PostgreSQL\_LIBRARY) (found version
  "10.4")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.8/Modules/FindPackageHandleStandardArgs.cmake:377 (\_FPHSA\_FAILURE\_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.8/Modules/FindPostgreSQL.cmake:175 (find\_package\_handle\_standard\_args)
  server/CMakeLists.txt:13 (find\_package)


Det ser ud som om det har fundet '10.4' version, men det mangler PostgreSQL\_LIBRARY.


Hvordan kan jeg ordne det?

Bedste reference


Min FindPostgreSQL.cmake har denne note:


# Note:
# PostgreSQL\_ADDITIONAL\_VERSIONS is a variable that can be used to set the
# version number of the implementation of PostgreSQL.
# In Windows the default installation of PostgreSQL uses that as part of the path.
# E.g C:Program FilesPostgreSQL8.4.
# Currently, the following version numbers are known to this module:
# "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0"
#
# To use this variable just do something like this:
# set(PostgreSQL\_ADDITIONAL\_VERSIONS "9.2" "8.4.4")
# before calling find\_package(PostgreSQL) in your CMakeLists.txt file.
# This will mean that the versions you set here will be found first in the order
# specified before the default ones are searched.
#
# ----------------------------------------------------------------------------
# You may need to manually set:
#  PostgreSQL\_INCLUDE\_DIR  - the path to where the PostgreSQL include files are.
#  PostgreSQL\_LIBRARY\_DIR  - The path to where the PostgreSQL library files are.
# If FindPostgreSQL.cmake cannot find the include files or the library files.


HTH


Mike