Skip to content
Browse files
Fix build on Linux when compiled with FORCE_STATIC_LIBS (#46086)
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

Co-authored-by: Martin Dobias <>
  • Loading branch information
qgis-bot and wonder-sk committed Nov 17, 2021
1 parent 955fcb8 commit e524574d0e25995fb0c9a543dd96aeb4e2ade727
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 e524574

Please sign in to comment.