]> sigrok.org Git - pulseview.git/blobdiff - sigrok-qt2.pro
Link in libsigrok and libsigrokdecode
[pulseview.git] / sigrok-qt2.pro
index ad1d4312b5a00decbeceef1e8ef53f827684f5a1..dde53996a74f5d1d977ba6258691f13c432313f5 100644 (file)
@@ -9,6 +9,9 @@ QT       += core gui
 TARGET = sigrok-qt2
 TEMPLATE = app
 
+# The sigrok-qt version number. Define APP_VERSION macro for use in the code.
+VERSION       = 0.1.0
+DEFINES      += APP_VERSION=\\\"$$VERSION\\\"
 
 SOURCES += main.cpp\
         mainwindow.cpp
@@ -16,3 +19,19 @@ SOURCES += main.cpp\
 HEADERS  += mainwindow.h
 
 FORMS    += mainwindow.ui
+
+# libsigrok and libsigrokdecode
+# TODO: Check for the minimum versions of libsigrok/libsigrokdecode we need.
+win32 {
+       # On Windows/MinGW we need to use '--libs --static'.
+       # We also need to strip some stray '\n' characters here.
+       QMAKE_CXXFLAGS += $$system(pkg-config --cflags libsigrokdecode \
+                         libsigrok | sed s/\n//g)
+       LIBS           += $$system(pkg-config --libs --static libsigrokdecode \
+                         libsigrok | sed s/\n//g)
+} else {
+       QMAKE_CXXFLAGS += $$system(pkg-config --cflags libsigrokdecode)
+       QMAKE_CXXFLAGS += $$system(pkg-config --cflags libsigrok)
+       LIBS           += $$system(pkg-config --libs libsigrokdecode)
+       LIBS           += $$system(pkg-config --libs libsigrok)
+}