Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve FindPostgreSQL.cmake #1185

Merged
merged 1 commit into from
Feb 25, 2019
Merged

Improve FindPostgreSQL.cmake #1185

merged 1 commit into from
Feb 25, 2019

Conversation

tbussmann
Copy link
Contributor

Fixes #1157.

Changes proposed in this pull request:

  • Prefer the path given by pg_config when searching for POSTGRESQL_EXECUTABLE by changing the search order to avoid matching an unrelated executable

@pgRouting/admins

This PR is the minimal required change to the logic to fix building on Mac in several typical constellations. I would however rather prefer the following bigger change:

  • remove all the 'guesses' of fixed-paths and environment variables
  • exclusively rely on the output of pg_config, find that according to PATH, overridable by POSTGRESQL_BIN

Reason:

  • we already are depending on a working pg_config, otherwise POSTGRESQL_LIBRARIES and POSTGRESQL_VERSION_STRING could not be set, and POSTGRESQL_FOUND would result FALSE
  • with the individual searching / guessing logic it is possible to find POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIESand POSTGRESQL_EXECUTABLE belonging to different installations which cannot work
  • it is already possible to specify -DPOSTGRESQL_BIN=... to point to a particular installation not in path of which pg_config would then control the other directories

Con:

  • no longer possible to magically build against a installation with a broken pg_config - this would now require to explicitly specify all of POSTGRESQL_INCLUDE_DIR, POSTGRESQL_LIBRARIES, POSTGRESQL_EXECUTABLE, POSTGRESQL_VERSION_STRING as cmake parameters

If you agree, I'll update the PR to reflect the wider change.

Prefer the path given by `pg_config` when searching for POSTGRESQL_EXECUTABLE by changing the search order to avoid matching an unrelated executable (see pgRouting#1157)
@cvvergara cvvergara added this to the Release 2.7.0 milestone Feb 25, 2019
@cvvergara cvvergara merged commit 2489391 into pgRouting:master Feb 25, 2019
@cvvergara cvvergara modified the milestones: Release 2.7.0, Release 2.6.3 Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installation problem in macOS
2 participants