[cmake-developers] [FindPostgreSQL.cmake] Add support for PostgreSQL 9.3 and 9.4 on Debian/Ubuntu
Tamar Kranenburg
info at takar.nl
Sat May 30 09:27:33 EDT 2015
Hello,
Attached is my second attempt to add support for PostgreSQL 9.3 and 9.4 on Debian/Ubuntu. Additionally the module does not use a static path anymore when targeting windows platform.
Github:
https://github.com/Kitware/CMake/compare/master...takar:fix_findpostgresql <https://github.com/Kitware/CMake/compare/master...takar:fix_findpostgresql>
Summary of changes:
- Use PATH_SUFFIXES instead of PATHS when using find_path or find_library
- Generate additional search paths for linux to find pg_type.h
- Use separate PATH_SUFFIXES variables for library, type and include (this is just an optimization)
- Whitespace corrections
Motivation:
On Ubuntu/Debian, starting with PostgreSQL 9.3 the header file pg_type.h is moved to a separate package (i.e. from libpq-dev to postgresql-server-dev) and consequently the file pg_type.h is moved to a new location:
> /usr/include/postgresql/<version>/server/catalog/pg_type.h
The additional suffixes for pg_type.h are generated by looping over the PostgreSQL_KNOWN_VERSIONS variable. This has the additional advantage that a user may add custom versions or change the priority (when running multiple pgsql servers) by prepending additional versions.
This patch was tested on the following platforms:
- Windows 7 64b + Cmake 32b + MinGW 32b + PostgreSQL 9.3 & 9.4
- Debian 7 (wheezy) + PostgreSQL 9.1
- Debian 8 (jessie) + PostgreSQL 9.4
- Mac OSX 10.10.3 (Yosemite) + Homebrew + PostgreSQL 9.4.1
Furthermore, I confirmed that under windows the location of the header files and libraries is consistent in all PostgreSQL 8.0+ versions.
I’m open for any suggestions you may have.
Best regards,
Tamar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150530/37541c48/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-module-FindPostgreSQL-for-PG-9.4-9.3-and-9.2-und.patch
Type: application/octet-stream
Size: 6331 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150530/37541c48/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150530/37541c48/attachment-0003.html>
More information about the cmake-developers
mailing list