Skip to content

Commit 8c72b2c

Browse files
committed
Reinstate workaround for problem in CMake PostgreSQL module
The workaround removed in 00c80c7 is actually needed, because the CMake module that implements the find_package for PostgreSQL needs the PostgreSQL server libraries installed. But we don't need those libraries at all (just the client libraries). See also https://stackoverflow.com/questions/13920383/findpostgresql-cmake-wont-work-on-ubuntu
1 parent 139818c commit 8c72b2c

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/actions/build-and-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
1616

1717
- name: configure
1818
run: |
19-
CMAKE_OPTIONS="-DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include -LA -DBUILD_TESTS=ON"
19+
CMAKE_OPTIONS="-LA -DBUILD_TESTS=ON"
2020
if [ -z "${LUA_VERSION}" ]; then
2121
CMAKE_OPTIONS="$CMAKE_OPTIONS -DWITH_LUA=OFF"
2222
else

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ option(EXTERNAL_LIBOSMIUM "Do not use the bundled libosmium" OFF)
5252
option(EXTERNAL_PROTOZERO "Do not use the bundled protozero" OFF)
5353
option(EXTERNAL_FMT "Do not use the bundled fmt" OFF)
5454

55+
if (NOT WIN32 AND NOT APPLE)
56+
# No need for this path, just a workaround to make cmake work on all systems.
57+
# Without this we need the PostgreSQL server libraries installed.
58+
# https://stackoverflow.com/questions/13920383/findpostgresql-cmake-wont-work-on-ubuntu
59+
set(PostgreSQL_TYPE_INCLUDE_DIR /usr/include)
60+
endif()
61+
5562
set(MINIMUM_POSTGRESQL_SERVER_VERSION "9.3")
5663
set(MINIMUM_POSTGRESQL_SERVER_VERSION_NUM "90300")
5764

0 commit comments

Comments
 (0)