Skip to content

Instantly share code, notes, and snippets.

@andreasarf
Last active February 19, 2026 15:15
Show Gist options
  • Select an option

  • Save andreasarf/859cbd618fa9a05be54e28888566b886 to your computer and use it in GitHub Desktop.

Select an option

Save andreasarf/859cbd618fa9a05be54e28888566b886 to your computer and use it in GitHub Desktop.
Compile pgModeler on MacOS with Homebrew

Prerequisites

brew install postgresql qt@6 libxml2 libpq

Also update XCode from app store, open xcode and accept initial license agreement, and install xcode cli.

Update build script, pgmodeler.pri

Add line starting PGSQL_LIB to INCLUDEPATH in a macx { ... } block, preferably second block towards the end of the file provide updated build paths.

macx {
  !defined(PGSQL_LIB, var): PGSQL_LIB = /Library/PostgreSQL/14/lib/libpq.dylib
  !defined(PGSQL_INC, var): PGSQL_INC = /Library/PostgreSQL/14/include
  !defined(XML_INC, var): XML_INC = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2
  !defined(XML_LIB, var): XML_LIB = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libxml2.tbd
  INCLUDEPATH += "$$PGSQL_INC" "$$XML_INC"

  PGSQL_LIB = /opt/homebrew/opt/libpq/lib/libpq.dylib
  PGSQL_INC = /opt/homebrew/opt/libpq/include
  XML_INC = /opt/homebrew/opt/libxml2/include/libxml2
  XML_LIB = /opt/homebrew/opt/libxml2/lib/libxml2.dylib
  INCLUDEPATH += $$PGSQL_INC $$XML_INC
}

Build

git clone https://github.com/pgmodeler/pgmodeler.git
cd pgmodeler
git checkout main
git pull
git status # should be clean

which qmake # should be from homebrew install
qmake -r pgmodeler.pro -early QMAKE_DEFAULT_LIBDIRS=$(xcrun -show-sdk-path)/usr/lib
make
make install
echo $?

With a successful install and exit code 0, pgModeler.app should be under /Applications/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment