Skip to content

Instantly share code, notes, and snippets.

@MOZGIII
Last active December 26, 2015 08:39
Show Gist options
  • Save MOZGIII/7124158 to your computer and use it in GitHub Desktop.
Save MOZGIII/7124158 to your computer and use it in GitHub Desktop.
qmake helper to link swipl with qt
# Set swipl binary
isEmpty(SWIPL_BINARY) {
SWIPL_BINARY="swipl"
}
# Load options from swipl
isEmpty(PLDUMP) {
PLDUMP = $$system(\"$$SWIPL_BINARY\" --dump-runtime-variables)
}
# Set SWI-Prolog options
isEmpty(PLBASE) { PLBASE = $$system( 'echo \'$$PLDUMP\' | grep -o -P "(?<=PLBASE=\\\").+?(?=\\\")"' ) }
isEmpty(PLARCH) { PLARCH = $$system( 'echo \'$$PLDUMP\' | grep -o -P "(?<=PLARCH=\\\").+?(?=\\\")"' ) }
isEmpty(PLLIB) { PLLIB = $$system( 'echo \'$$PLDUMP\' | grep -o -P "(?<=PLLIB=\\\").+?(?=\\\")"' ) }
# Include SWI-Prolog
INCLUDEPATH += "$$PLBASE/include"
LIBS += "-L'$$quote('$$PLBASE/lib/$$PLARCH')'"
LIBS += "-L'$$quote('$$PLBASE/lib')'"
LIBS += $$PLLIB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment