-
Notifications
You must be signed in to change notification settings - Fork 0
/
SDLNGL.pro
79 lines (74 loc) · 2.96 KB
/
SDLNGL.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# This specifies the exe name
TARGET=SDLTTF
# where to put the .o files
OBJECTS_DIR=obj
# core Qt Libs to use add more here if needed.
QT+=gui opengl core
macx:DEFINES += GL_SILENCE_DEPRECATION
# as I want to support 4.8 and 5 this will set a flag for some of the mac stuff
# mainly in the types.h file for the setMacVisual which is native in Qt5
isEqual(QT_MAJOR_VERSION, 5) {
cache()
DEFINES +=QT5BUILD
}
# this demo uses SDL so add the paths using the sdl2-config tool
QMAKE_CXXFLAGS+=$$system(sdl2-config --cflags)
message(output from sdl2-config --cflags added to CXXFLAGS= $$QMAKE_CXXFLAGS)
LIBS+=$$system(sdl2-config --libs)
message(output from sdl2-config --libs added to LIB=$$LIBS)
macx:LIBS+=$$system(sdl2-config --static-libs)
LIBS+=-lSDL2_ttf
win32 :{
message(Make sure that SDL2 is installed using vcpkg install SDL2 )
# message("package dir is" $$VCPK)
INCLUDEPATH += $$(HOMEDRIVE)\\$$(HOMEPATH)\vcpkg\installed\x86-windows\include\SDL2
PRE_TARGETDEPS+=$$(HOMEDRIVE)\\$$(HOMEPATH)\vcpkg\installed\x86-windows\lib\SDL2.lib
LIBS+=-L$$(HOMEDRIVE)\\$$(HOMEPATH)\vcpkg\installed\x86-windows\lib\ -lSDL2
PRE_TARGETDEPS+=$$(HOMEDRIVE)\\$$(HOMEPATH)\vcpkg\installed\x86-windows\lib\SDL2_ttf.lib
LIBS+=-L$$(HOMEDRIVE)\\$$(HOMEPATH)\vcpkg\installed\x86-windows\lib\ -lSDL2_ttf
}
# where to put moc auto generated files
MOC_DIR=moc
# on a mac we don't create a .app bundle file ( for ease of multiplatform use)
CONFIG-=app_bundle
# Auto include all .cpp files in the project src directory (can specifiy individually if required)
SOURCES+= $$PWD/src/*.cpp
# same for the .h files
HEADERS+= $$PWD/include/*.h
# and add the include dir into the search path for Qt and make
INCLUDEPATH +=./include
# where our exe is going to live (root of project)
DESTDIR=./
# add the glsl shader files
OTHER_FILES+= shaders/*.glsl \
README.md
# were are going to default to a console app
CONFIG += console
# note each command you add needs a ; as it will be run as a single line
# first check if we are shadow building or not easiest way is to check out against current
!equals(PWD, $${OUT_PWD}){
copydata.commands = echo "creating destination dirs" ;
# now make a dir
copydata.commands += mkdir -p $$OUT_PWD/shaders ;
copydata.commands += mkdir -p $$OUT_PWD/font ;
copydata.commands += echo "copying files" ;
# then copy the files
copydata.commands += $(COPY_DIR) $$PWD/shaders/* $$OUT_PWD/shaders/ ;
copydata.commands += $(COPY_DIR) $$PWD/font/* $$OUT_PWD/font/ ;
# now make sure the first target is built before copy
first.depends = $(first) copydata
export(first.depends)
export(copydata.commands)
# now add it as an extra target
QMAKE_EXTRA_TARGETS += first copydata
}
NGLPATH=$$(NGLDIR)
isEmpty(NGLPATH){ # note brace must be here
!win32:message("including $HOME/NGL")
!win32:include($(HOME)/NGL/UseNGL.pri)
win32:include($(HOMEDRIVE)\$(HOMEPATH)\NGL\UseNGL.pri)
}
else{ # note brace must be here
message("Using custom NGL location")
include($(NGLDIR)/UseNGL.pri)
}