The way cmake has been setup, it decides which version to compile for using that variable (if defined). If the variable is not defined, it locates pg_config and deduces version from it. 
We could add a default PG_CONFIG variable that links to the latest supported version. Created a JIRA for this.  

On Wed, Feb 8, 2017 at 3:10 PM, Jim Nasby <> wrote:
On 2/8/17 10:18 AM, Rahul Iyer wrote:
add `-DPOSTGRESQL_9_6_PG_CONFIG=/path/to/pg_config' with the `cmake ...`

Does that variable need to include the version number? Couldn't it just be called PG_CONFIG ?
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble!
855-TREBLE2 (855-873-2532)