Skip to content

Commit

Permalink
blink1control: replace homegrown IMAP/POP client with libcurl-based o…
Browse files Browse the repository at this point in the history
…ne (but IMAP only supported currently); huge cleanup started on UI for Mail, IFTT, etc lists by using standard QtQuick controls like ComboBox; upgraded to latest Qt substrate
  • Loading branch information
todbot committed Sep 5, 2015
1 parent 3806ca6 commit ae0f38b
Show file tree
Hide file tree
Showing 40 changed files with 10,840 additions and 932 deletions.
93 changes: 63 additions & 30 deletions qt/blink1control/blink1control.pro
@@ -1,4 +1,4 @@
#-------------------------------------------------
#--*-makefile-*-----------------------------------
# Blink1Control Qt master build file
#
# Windows build requirements:
Expand All @@ -24,7 +24,7 @@ QT += core gui widgets network quick qml
TARGET = Blink1Control
TEMPLATE = app

VERSION = 1.95
VERSION = 1.97
BLINK1CONTROL_VERSION = "v$$VERSION"
# note: need to update version in Blink1Control.iss too

Expand Down Expand Up @@ -56,75 +56,108 @@ SOURCES += main.cpp\
blink1input.cpp \
datainput.cpp \
bigbuttons.cpp \
email.cpp \
simplecrypt.cpp \
hardwaremonitor.cpp \
Cursorshapearea.cpp \
httpserver.cpp \
mainapp.cpp
mainapp.cpp \
emailcurl.cpp

HEADERS += mainwindow.h \
blink1pattern.h \
blink1input.h \
datainput.h \
bigbuttons.h \
email.h \
simplecrypt.h \
hardwaremonitor.h \
httpserver.h \
mainapp.h \
cursorshapearea.h
cursorshapearea.h \
emailcurl.h

OBJECTIVE_SOURCES += \
osxFixes.mm
osxFixes.mm

#FORMS += mainwindow.ui

RESOURCES += \
myresources.qrc


# for blink1-lib
# note: be sure to compile blink1-lib beforhard with:
# blink1-lib begin
# note: be sure to compile blink1-lib beforhand with:
# cd blink1/commandline && make lib"
# for Windows, that will build both MinGW & MSVC compatible libs
BLINK1_LIB_DIR=$$PWD/../../commandline
#message("BLINK1_LIB_DIR=$$BLINK1_LIB_DIR")

macx: LIBS += -L$$BLINK1_LIB_DIR -lBlink1
win32-g++: LIBS += $$BLINK1_LIB_DIR/blink1-lib.dll
win32-msvc*: LIBS += $$BLINK1_LIB_DIR/blink1-lib.lib
unix:!macx: LIBS += $$BLINK1_LIB_DIR/libblink1.so

DEFINES += BLINK1CONTROL_VERSION=\\\"$$BLINK1CONTROL_VERSION\\\"
#message("DEFINES = $$DEFINES")

QMAKE_CXXFLAGS += -DUSE_HIDAPI # not QMAKE_CFLAGS += -DUSE_HIDAPI
INCLUDEPATH += $$BLINK1_LIB_DIR
DEPENDPATH += $$BLINK1_LIB_DIR

# blink1-lib end

# curl begin
macx {
DEFINES += CURL_STATICLIB
LIBS += $$PWD/libcurl-mac/lib/libcurl.a -lssl -lcrypto -lssl -lcrypto -lz -lldap -lz
INCLUDEPATH += $$PWD/libcurl-mac/include
}
win32 {
#LIBS += -L$$PWD/libcurl-win/bin -n'
lcurl
#LIBS += -L$$PWD/libcurl-win/bin -lcurl -lwldap32 -lws2_32
#DEFINES += CURL_STATICLIB
LIBS += $$PWD/libcurl-win/lib/libcurldll.a
#LIBS += $$PWD/libcurl-win/lib/lib
INCLUDEPATH += $$PWD/libcurl-win/include

# FIXME: to-do
}
# curl end


# installtion stuff begin

macx {
QMAKE_OBJECTIVE_CFLAGS += $${QMAKE_CXXFLAGS}
LIBS += -framework AppKit -framework Foundation
MYAPPDIR=$$OUT_PWD/$${TARGET}.app/Contents/MacOS
BLINK1LIBPATH = $$BLINK1_LIB_DIR/libBlink1.dylib
QMAKE_POST_LINK += $(COPY) $$BLINK1LIBPATH $$MYAPPDIR
#message( "MYAPPDIR = $$MYAPPDIR" )
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8
QMAKE_OBJECTIVE_CFLAGS += $${QMAKE_CXXFLAGS}
LIBS += -framework AppKit -framework Foundation
APPDIR = $$OUT_PWD/$${TARGET}.app/Contents/MacOS
#message( "APPDIR = $$APPDIR" )
#QMAKE_POST_LINK += $(COPY) $$BLINK1LIB $$MYAPPDIR
#LIBS += -framework Foundation
BLINK1LIB = $$BLINK1_LIB_DIR/libBlink1.dylib
copyblink1lib.commands = @echo Copying blink1lib... && $(INSTALL_DIR) \"$$BLINK1LIB\" \"$$APPDIR\"
QMAKE_EXTRA_TARGETS += copyblink1lib
first.depends += copyblink1lib
}

unix:!macx {
BLINK1LIBPATH = $$BLINK1_LIB_DIR/libblink1.so
QMAKE_PRE_LINK += $(COPY) $$BLINK1LIBPATH $$OUT_PWD
BLINK1LIB = $$BLINK1_LIB_DIR/libblink1.so
copyblink1lib.commands = @echo Copying blink1lib... && $(INSTALL_DIR) \"$$BLINK1LIB\" \"$$OUT_PWD\"
QMAKE_EXTRA_TARGETS += copyblink1lib
first.depends += copyblink1lib
}

win32 {
CONFIG(release, debug|release): MYAPPDIR=$$OUT_PWD/release
CONFIG(debug, debug|release): MYAPPDIR=$$OUT_PWD/debug
BLINK1LIBPATH = $$clean_path($$BLINK1_LIB_DIR/blink1-lib.dll)
QMAKE_PRE_LINK += $(COPY) $$shell_path($$BLINK1LIBPATH) $$shell_path($$MYAPPDIR)
#message( "MYAPPDIR = $$MYAPPDIR , DESTDIR = $(DESTDIR), helpfolder = $$helpfolder" )
#QMAKE_CXXFLAGS += /arch:IA32 # turn off avx optimizations
CONFIG(release, debug|release): APPDIR=$$OUT_PWD/release
CONFIG(debug, debug|release): APPDIR=$$OUT_PWD/debug
BLINK1LIB = $$shell_path($$BLINK1_LIB_DIR/blink1-lib.dll)
CURLLIBS = $$shell_path($$PWD/libcurl-win/bin/*.dll)
DLLDIR = $$shell_path($$APPDIR)
copyblink1lib.commands = @echo Copying blink1lib... && $(INSTALL_DIR) \"$$BLINK1LIB\" \"$$DLLDIR\"
#copyblink1lib.depends = $$DLLDIR/blink1-lib.dll #(this doesnt' work)
copycurllibs.commands = @echo Copying curllibs... && $(INSTALL_DIR) \"$$CURLLIBS\" \"$$DLLDIR\"
QMAKE_EXTRA_TARGETS += copyblink1lib copycurllibs
# enable this for production, too slow during development
first.depends += copyblink1lib copycurllibs
}

# for XP, see:
Expand All @@ -133,10 +166,10 @@ win32 {
# but still doesn't work fully, errors like:
# "strnlen could not be located in msvcrt.dll"
#win32 {
# QMAKE_LFLAGS += /SUBSYSTEM:CONSOLE,5.01
# QMAKE_CXX += /D_USING_V110_SDK71_
# LIBS *= -L"%ProgramFiles(x86)%/Microsoft SDKs/Windows/7.1A/Lib"
# INCLUDEPATH += "%ProgramFiles(x86)%/Microsoft SDKs/Windows/7.1A/Include"
# QMAKE_LFLAGS += /SUBSYSTEM:CONSOLE,5.01
# QMAKE_CXX += /D_USING_V110_SDK71_
# LIBS *= -L"%ProgramFiles(x86)%/Microsoft SDKs/Windows/7.1A/Lib"
# INCLUDEPATH += "%ProgramFiles(x86)%/Microsoft SDKs/Windows/7.1A/Include"
#}


Expand All @@ -146,7 +179,7 @@ OTHER_FILES += \
help/index.html

win32{
RC_FILE =blink1.rc
RC_FILE = blink1.rc
# CONFIG += embed_manifest_exe
}
#ICON = images/blink1-icon01.ico
Expand Down

0 comments on commit ae0f38b

Please sign in to comment.