Skip to content
Browse files
Fix build on Linux when compiled with FORCE_STATIC_LIBS
In #44326 the build system changes made POSTGRES_INCLUDE_DIR a PRIVATE include, so this
include directory does not get propagated, but then qgis_core fails to build due to transitive
include of libpq-fe.h:

In file included from ../src/providers/postgres/qgspostgresprovider.h:23,
                 from ../src/core/providers/qgsproviderregistry.cpp:58:
../src/providers/postgres/qgspostgresconn.h:35:10: fatal error: libpq-fe.h: No such file or directory

On other platforms such as Mac this does not seem to be an issue, because PostgreSQL include
directory is the same as other include directories, but at least on Ubuntu the include directory
is /usr/include/postgresql
  • Loading branch information
wonder-sk committed Nov 17, 2021
1 parent ad4810c commit 5cd7625cfe9111be62f7221aa3428456ba121abd
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/providers/postgres/CMakeLists.txt
@@ -40,7 +40,7 @@ set(PG_HDRS
# static library
add_library (provider_postgres_a STATIC ${PG_SRCS} ${PG_HDRS})

target_include_directories(provider_postgres_a SYSTEM PRIVATE
target_include_directories(provider_postgres_a SYSTEM PUBLIC

0 comments on commit 5cd7625

Please sign in to comment.