157 lines
3.6 KiB
Prolog
157 lines
3.6 KiB
Prolog
#
|
|
# Singe 2
|
|
# Copyright (C) 2019 Scott Duensing <scott@kangaroopunch.com>
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License
|
|
# as published by the Free Software Foundation; either version 2
|
|
# of the License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
#
|
|
|
|
# We're just a boring old C app
|
|
TEMPLATE = app
|
|
CONFIG += console
|
|
CONFIG -= app_bundle
|
|
CONFIG -= qt
|
|
|
|
# Keep binaries to themselves
|
|
DESTDIR = $$OUT_PWD/build
|
|
|
|
# Macro to copy files to target
|
|
defineTest(copyToDestDir) {
|
|
files = $$1
|
|
for(FILE, files) {
|
|
DDIR = $$DESTDIR
|
|
win32:FILE ~= s,/,\\,g
|
|
win32:DDIR ~= s,/,\\,g
|
|
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
|
|
}
|
|
export(QMAKE_POST_LINK)
|
|
}
|
|
|
|
# Macro to copy files to subdirectory of target
|
|
defineTest(copyToDestDirSub) {
|
|
files = $$1
|
|
sub = $$2
|
|
mkpath($$DESTDIR/$$sub)
|
|
for(FILE, files) {
|
|
DDIR = $$DESTDIR/$$sub
|
|
win32:FILE ~= s,/,\\,g
|
|
win32:DDIR ~= s,/,\\,g
|
|
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
|
|
}
|
|
export(QMAKE_POST_LINK)
|
|
}
|
|
|
|
# Make Visual C shut up about stupidness
|
|
win32 {
|
|
DEFINES *= \
|
|
_CRT_SECURE_NO_WARNINGS \
|
|
_CRT_NONSTDC_NO_DEPRECATE
|
|
MSVC_VER = $$(VisualStudioVersion)
|
|
if(equals(MSVC_VER, 14.0)|greaterThan(MSVC_VER, 14.0)) {
|
|
message("Timespec is defined")
|
|
DEFINES *= HAVE_STRUCT_TIMESPEC
|
|
}
|
|
}
|
|
|
|
# Determine Bitness - This is just broken
|
|
win32 {
|
|
contains(QMAKE_HOST.arch, x86_64) {
|
|
CONFIG *= bits64
|
|
} else {
|
|
CONFIG *= bits32
|
|
}
|
|
} else {
|
|
*-64 | *_64 {
|
|
CONFIG *= bits64
|
|
} else {
|
|
CONFIG *= bits32
|
|
}
|
|
}
|
|
BITNESS="64"
|
|
bits32:BITNESS="32"
|
|
# HACK HACK HACK due to above
|
|
BITNESS="64"
|
|
CONFIG -= bits32
|
|
CONFIG += bits64
|
|
|
|
# === Third Party Builds ===
|
|
|
|
BUILDTHIRDARGS = \"$$PWD/thirdparty\" \"$$OUT_PWD/../thirdparty-build\" $$BITNESS
|
|
win32 {
|
|
BUILDTHIRD.commands = cmd.exe /c $$PWD\\thirdparty\\build.bat $$BUILDTHIRDARGS
|
|
} else {
|
|
BUILDTHIRD.commands = bash $$PWD/thirdparty/build.sh $$BUILDTHIRDARGS
|
|
}
|
|
BUILDTHIRD.target = this
|
|
PRE_TARGETDEPS += this
|
|
QMAKE_EXTRA_TARGETS += BUILDTHIRD
|
|
|
|
# === ManyMouse ===
|
|
|
|
MANYMOUSE_INCLUDES = \
|
|
$$PWD/thirdparty/manymouse
|
|
|
|
MANYMOUSE_HEADERS = \
|
|
$$PWD/thirdparty/manymouse/manymouse.h
|
|
|
|
MANYMOUSE_SOURCES = \
|
|
$$PWD/thirdparty/manymouse/linux_evdev.c \
|
|
$$PWD/thirdparty/manymouse/macosx_hidmanager.c \
|
|
$$PWD/thirdparty/manymouse/macosx_hidutilities.c \
|
|
$$PWD/thirdparty/manymouse/manymouse.c \
|
|
$$PWD/thirdparty/manymouse/windows_wminput.c \
|
|
$$PWD/thirdparty/manymouse/x11_xinput2.c
|
|
|
|
# === SINGE ===
|
|
|
|
INCLUDEPATH += \
|
|
$$PWD/../thirdparty-build/$$BITNESS/installed/include \
|
|
$$MANYMOUSE_INCLUDES
|
|
|
|
HEADERS += \
|
|
stddclmr.h \
|
|
$$MANYMOUSE_HEADERS
|
|
|
|
SOURCES += \
|
|
main.c \
|
|
$$MANYMOUSE_SOURCES
|
|
|
|
LIBS += \
|
|
-L$$PWD/../thirdparty-build/$$BITNESS/installed/lib \
|
|
-l:libSDL2.a \
|
|
-l:libSDL2_image.a \
|
|
-l:libSDL2_mixer.a \
|
|
-l:libSDL2_ttf.a \
|
|
-l:libfreetype.a \
|
|
-l:liblua.a \
|
|
-l:libffms2.a \
|
|
-l:libavformat.a \
|
|
-l:libavcodec.a \
|
|
-l:libswscale.a \
|
|
-l:libavutil.a \
|
|
-l:libswresample.a \
|
|
-l:libz.a \
|
|
-l:liblzma.a \
|
|
-l:libbz2.a \
|
|
-lpthread \
|
|
-lXv \
|
|
-lX11 \
|
|
-lXext \
|
|
-lm \
|
|
-ldl
|
|
|
|
OTHER_FILES += \
|
|
thirdparty/build.sh \
|
|
thirdparty/build.bat
|
|
|