gammu 1.38.5使用native_pgsql编译时-找不到PostgreSQL [英] gammu 1.38.5 compile with native_pgsql, --Could not find PostgreSQL

查看:94
本文介绍了gammu 1.38.5使用native_pgsql编译时-找不到PostgreSQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过我在Gammu文档中找到的指示,在具有PostgreSQL本机lib支持的mac os x El Capitan上编译gammu 1.38.5.

I m trying compile gammu 1.38.5 on my mac os x El Capitan with postgresql native lib support by fellowing instruction I found in Gammu document.

我安装了PostgreSQL 9.4并将Mac OS X作为数据库服务器运行.创建了smsd数据库和用户以支持Gammu SMS网关服务. PostgreSQL已安装在Mac OSX的默认位置/Library/PostgreSQL/9.4中.包含和lib目录可以在这里找到.

I had my PostgreSQL 9.4 installed and running my Mac OS X as database server. smsd database and user was created to support Gammu SMS gateway services. PostgreSQL was installed in default location /Library/PostgreSQL/9.4 in Mac OSX. include and lib directory can be found here.

我已经将POSTGRESQL_PATH设置为/Library/PostgreSQL/9.4,然后将其导出到shell,我使用FindPostgres.cmake进行了检查,确保包含的文件libpq-fe.h在此处,然后运行cmake对其进行配置.

I had set up POSTGRESQL_PATH point to /Library/PostgreSQL/9.4 and then export it to shell, I checked with FindPostgres.cmake, make sure the included file libpq-fe.h is here and then run cmake to configure it.

我尝试将cmake与set启用的postgresql一起使用:

I tried to use cmake to with postgresql enabled by set:

sudo cmake -DWITH_MYSQL=OFF -DWITH_Postgres=ON -Wno-dev

cmake找不到我的PostgreSQL默认安装,显示:

cmake not found my postgresql default installation, shows:

-- Could not find PostgreSQL

我想也许已经在命令行中手动指定了include/lib的位置.

I thought maybe have manually specify the location of include/lib in command line.

我试图:

 sudo cmake -DWITH_MYSQL=OFF -DWITH_Postgres=ON -Wno-dev -DWITH_POSTGRES_INCLUDE_DIR=/Library/PostgreSQL/9.4/include -DWITH_POSTGRES_LIBRARY=/Library/PostgreSQL/9.4/lib

cmake仍然找不到我指定的postgresql include/lib,显示:

cmake still can not found my specified postgresql include/lib, shows:

-- Could not find PostgreSQL

并在末尾显示更多信息:

and shows more information at the end as:

CMake Warning:
  Manually-specified variables were not used by the project:

  WITH_POSTGRES_INCLUDE_DIR
  WITH_POSTGRES_LIBRARY

如果无法使用手动变量,如何将环境变量传递给cmake?

if manually variables can't be used, How I can pass the environment variables to cmake?

推荐答案

下面的方法应该起作用:

Following should work:

cmake -DPOSTGRES_CONFIG_PREFER_PATH=/Library/PostgreSQL/9.4/bin/

无论如何,查找应该在将来的版本中更好地工作,请参见 https://github.com/gammu/gammu/commit/d9d09574be1d0afa0609626d3bd6f604be31b8d4

Anyway the lookup should work better in future versions, see https://github.com/gammu/gammu/commit/d9d09574be1d0afa0609626d3bd6f604be31b8d4

这篇关于gammu 1.38.5使用native_pgsql编译时-找不到PostgreSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆