[CMake] FindPostgreSQL.cmake won't work on ubuntu

2012-12-17 Thread Ilia Choly

* Ubuntu 12.04
* CMake 2.8.9
* Postgresql 9.2.2

I'm trying to get the `FindPostgreSQL` module to find 
`/usr/include/postgresql/libpq-fe.h`.


Here's what I have in my `CMakeLists.txt`:

find_package(PostgreSQL REQUIRED)

This is the error I get:

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)


I added the following lines before calling `find_package` but it didn't 
seem to have any effect.


set(PostgreSQL_ADDITIONAL_VERSIONS "9.2.2")
set(PostgreSQL_ADDITIONAL_SEARCH_PATHS 
${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "/usr/include/postgresql")


I also tried googling for `PostgreSQL_TYPE_INCLUDE_DIR` but didn't find 
anything.

I'm very new to cmake, what else can I try?

- icholy
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindPostgreSQL.cmake won't work on ubuntu

2012-12-17 Thread Matthew Woehlke

On 2012-12-17 14:55, Ilia Choly wrote:

I'm trying to get the `FindPostgreSQL` module to find
`/usr/include/postgresql/libpq-fe.h`.

This is the error I get:

 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")


Is pg_config in your PATH? (Do you have the necessary -dev package(s) 
installed?)


From a cursory look at the find module, it looks like having pg_config 
in your path should be all that is needed.


--
Matthew

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindPostgreSQL.cmake won't work on ubuntu

2012-12-17 Thread Rolf Eike Beer
Ilia Choly wrote:
> * Ubuntu 12.04
> * CMake 2.8.9
> * Postgresql 9.2.2

Maybe the usual multiarch breakage? http://cmake.org/Bug/view.php?id=13378

Eike
-- 


signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] FindPostgreSQL.cmake won't work on ubuntu

2012-12-18 Thread Ilia Choly

On 12-12-17 03:11 PM, Matthew Woehlke wrote:

On 2012-12-17 14:55, Ilia Choly wrote:

I'm trying to get the `FindPostgreSQL` module to find
`/usr/include/postgresql/libpq-fe.h`.

This is the error I get:

 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")


Is pg_config in your PATH? (Do you have the necessary -dev package(s) 
installed?)


From a cursory look at the find module, it looks like having pg_config 
in your path should be all that is needed.




The pg_config binary is in my path but looking at he module it doesn't 
look like it's being used.


After a bit more debugging I figured out that it's getting stuck here 
trying to find pg_type.h
This file is located in /usr/include/postgresql/catalog/pg_types.h but 
the module is expecting to find it in 
/usr/postgresql/server/catalog/pg_types.h


find_path(PostgreSQL_TYPE_INCLUDE_DIR
  NAMES catalog/pg_type.h
  PATHS
   # Look in other places.
   ${PostgreSQL_ROOT_DIRECTORIES}
  PATH_SUFFIXES
pgsql/server
postgresql/server
include/server
  # Help the user find it if we cannot.
  DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
)

It works if I add postgresql to the PATH_SUFFIXES

- icholy

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake