- Ubuntu 12.04
- CMake 2.8.9
- PostgreSQL 9.2.2
我正在尝试让FindPostgreSQL
模块找到/usr/include/postgresql/libpq-fe.h
.
这是我的CMakeLists.txt
:
find_package(PostgreSQL REQUIRED)
这是我得到的错误:
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found
version "9.2.2")
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindPostgreSQL.cmake:155 (find_package_handle_standard_args)
CMakeLists.txt:7 (find_package)
我在调用之前添加了以下几行,find_package
但它似乎没有任何效果。
set(PostgreSQL_ADDITIONAL_VERSIONS "9.2.2")
set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "/usr/include/postgresql")
我也尝试用谷歌搜索,PostgreSQL_TYPE_INCLUDE_DIR
但没有找到任何东西。我还能尝试什么?