Use PATH_SUFFIXES to search more common packaging locations.
On Windows, we can use suffixes to search in the standard Program Files
locations without hard-coding the C:/ path.
On Ubuntu/Debian, starting with PostgreSQL 9.3 the header file pg_type.h
is moved to a separate package (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
While at it, use separate PATH_SUFFIXES variables for library, type and
include (this is merely an optimization).
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.
Instead of directly passing $ENV{SOMEVAR} to a find_* call pass in ENV SOMEVAR.
This will make sure the paths will get correctly handled through different
platforms, especially on Windows.
Also fixes one place where paths with windows delimiters (\) were hardcoded to
use forward slashes.
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block. This is no longer the preferred style.
Run the following shell code:
for c in else endif endforeach endfunction endmacro endwhile; do
echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed