FindPostgreSQL fails to find exact version of PG 9.6 since cmake 3.14
set (POSTGRES_VERSION 9.6)
set (POSTGRES_INCLUDE_DIR "/usr/pgsql-9.6/include")
set (POSTGRES_DIRS "/usr/pgsql-9.6" ${POSTGRES_INCLUDE_DIR})
find_package (PostgreSQL ${POSTGRES_VERSION} EXACT REQUIRED)
- If I use the above configuration cmake 3.14.6 fails because of the version is determined as 9.615.
- If I use the above configuration cmake 3.13.5 finds the package because of the version is determined as 9.6.15.
The problem is introduce with commit 575e2cc3 in module FindPostgreSQL.cmake With this commit backward compatibility is lost as the version scheme og PG changed after version 9.6 (to 10 and above).
The package should check if pgsql less than 10 is installed and use the old way (check value of PG_VERSION) to find the version. If not the new method (check value of PG_VERSION_NUM and calculate major and minor version) can be used.
Edited by S. Schu