[Cmake-commits] CMake branch, next, updated. v3.0.1-5077-g5d9d4ac
Chuck Atkins
chuck.atkins at kitware.com
Sun Aug 31 20:37:49 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 5d9d4acb8c4170d6c8b5071acee4638916082a9b (commit)
via 5e62e9006a5d7282b617ca26d4f03345ecf8dc91 (commit)
via 5d7ce7a488912cc8f76eb9fe254070fc9d214fd7 (commit)
from 7dca291596e6cca454f6b97830d5611b8c9fb522 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d9d4acb8c4170d6c8b5071acee4638916082a9b
commit 5d9d4acb8c4170d6c8b5071acee4638916082a9b
Merge: 7dca291 5e62e90
Author: Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Sun Aug 31 20:37:48 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Aug 31 20:37:48 2014 -0400
Merge topic 'fix-findpostgres-for-multilib' into next
5e62e900 Fix FindPostgreSQL for pg_config in multilib configurations.
5d7ce7a4 CMake Nightly Date Stamp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5e62e9006a5d7282b617ca26d4f03345ecf8dc91
commit 5e62e9006a5d7282b617ca26d4f03345ecf8dc91
Author: Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Sun Aug 31 19:52:04 2014 -0400
Commit: Chuck Atkins <chuck.atkins at kitware.com>
CommitDate: Sun Aug 31 19:52:04 2014 -0400
Fix FindPostgreSQL for pg_config in multilib configurations.
Some platforms, Fedora 20 and RHEL 7 in particular, will have multiple
pg_config_${arch}.h files all included by the top level pg_config.h.
This checks all of the available pg_config*.h headers for version
information.
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index f13dea8..97666c8 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -145,12 +145,22 @@ find_library( PostgreSQL_LIBRARY
)
get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH)
-if (PostgreSQL_INCLUDE_DIR AND EXISTS "${PostgreSQL_INCLUDE_DIR}/pg_config.h")
- file(STRINGS "${PostgreSQL_INCLUDE_DIR}/pg_config.h" pgsql_version_str
- REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
-
- string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
- PostgreSQL_VERSION_STRING "${pgsql_version_str}")
+if (PostgreSQL_INCLUDE_DIR)
+ # Some platforms include multiple pg_config.hs for multi-lib configurations
+ # This is a temporary workaround. A better solution would be to compile
+ # a dummy c file and extract the value of the symbol.
+ file(GLOB _PG_CONFIG_HEADERS "${PostgreSQL_INCLUDE_DIR}/pg_config*.h")
+ foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
+ if(EXISTS "${_PG_CONFIG_HEADER}")
+ file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str
+ REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
+ if(pgsql_version_str)
+ string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*"
+ "\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}")
+ break()
+ endif()
+ endif()
+ endforeach()
unset(pgsql_version_str)
endif()
-----------------------------------------------------------------------
Summary of changes:
Modules/FindPostgreSQL.cmake | 22 ++++++++++++++++------
Source/CMakeVersion.cmake | 2 +-
2 files changed, 17 insertions(+), 7 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list