# $Id$
#
# Author Jiri Bittner
#
# Common definition file for all qmake VRUT projects (.pro)
# Contains basic compiler/linker setup for various platforms
# Handles dependency on the vrut library for all modules
# handles automatic _d suffix for debug builds
# 


CONFIG  += release rtti unicode wx29
#unicode wx29
#CONFIG  -= release
#CONFIG  += debug rtti wx29


CONFIG	+=  thread
CONFIG	-= qt 

#warn_off

_64bit =

DEFINES+=_UNICODE UNICODE VRUT_CORE_STATIC

QMAKE_LIBDIR += $$VRUT/bin
INCLUDEPATH+=$$VRUT/core

CONFIG(debug) {
OBJECTS_DIR=_debug
#!CONFIG(staticlib) {
# replace the name of the target for debug builds
TARGET=$$join(TARGET,"", "", "_d")
message(Building $$TARGET)
#}
} else {
OBJECTS_DIR=_release
}

CONFIG(release) {
DEFINES+=NDEBUG
}

win32 {

INCLUDEPATH += $(WXWIN)$(_64bit)/include $(WXWIN)$$_64bit/lib/vc_lib/mswud $(GLUT)$$_64bit/include $(CPPUNIT)$$_64bit/include $(GLEW)/include

LIBPATH += $(GLUT)$$_64bit/lib $(WXWIN)$$_64bit/lib/vc_lib $(CPPUNIT)$$_64bit/lib $(GLEW)/lib

DEFINES+=__WINDOWS__ _CRT_SECURE_NO_WARNINGS _CRT_SECURE_NO_DEPRECATE

#QMAKE_CXXFLAGS+=/EHsc /Ox /nologo /c /TP /errorReport:prompt /MD -Zc:wchar_t
QMAKE_CXXFLAGS+=/EHsc /MP -Zc:wchar_t /Zi

#/MP

# $$ note - for vs2003 -Zc:wchar_t has to be commented out


#QMAKE_LFLAGS+=/NOLOGO /LARGEADDRESSAWARE /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:WINDOWS
QMAKE_LFLAGS+=/NOLOGO /LARGEADDRESSAWARE /OPT:REF /INCREMENTAL:NO /DEBUG

!CONFIG(staticlib) {

CONFIG(release) {
LIBS+=-lvrut
} else {
LIBS+=-lvrut_d
}
}

contains(CONFIG, wx29) {

CONFIG(release) {
LIBS += wxpng.lib wxzlib.lib wxjpeg.lib wxtiff.lib wxmsw29u_core.lib \
	wxbase29u.lib wxmsw29u_gl.lib wxmsw29u_aui.lib wxbase29u_net.lib wxmsw29u_adv.lib wxmsw29u_qa.lib  wxmsw29u_richtext.lib  wxmsw29u_xrc.lib wxmsw29u_media.lib wxmsw29u_html.lib wxbase29u_xml.lib wxexpat.lib \
	user32.lib ole32.lib gdi32.lib shell32.lib comctl32.lib advapi32.lib comdlg32.lib Rpcrt4.lib \
	winmm.lib wsock32.lib kernel32.lib winspool.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
} else {
LIBS += wxpngd.lib wxzlibd.lib wxjpegd.lib wxtiffd.lib \
	wxmsw29ud_core.lib wxbase29ud.lib wxmsw29ud_gl.lib wxmsw29ud_aui.lib wxbase29ud_net.lib  wxmsw29ud_adv.lib \
wxmsw29ud_qa.lib  wxmsw29ud_richtext.lib  wxmsw29ud_xrc.lib \
wxmsw29ud_media.lib wxmsw29ud_html.lib wxbase29ud_xml.lib wxexpat.lib \
	kernel32.lib user32.lib gdi32.lib comdlg32.lib comctl32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib rpcrt4.lib \
	winmm.lib wsock32.lib winspool.lib uuid.lib odbc32.lib odbccp32.lib
}

} else {
CONFIG(release) {
LIBS += wxpng.lib wxzlib.lib wxjpeg.lib wxtiff.lib wxmsw28u_core.lib \
	wxbase28u.lib wxmsw28u_gl.lib wxmsw28u_aui.lib wxbase28u_net.lib wxmsw28u_adv.lib wxmsw28u_qa.lib  wxmsw28u_richtext.lib  wxmsw28u_xrc.lib wxmsw28u_media.lib wxmsw28u_html.lib wxbase28u_xml.lib wxexpat.lib \
	user32.lib ole32.lib gdi32.lib shell32.lib comctl32.lib advapi32.lib comdlg32.lib Rpcrt4.lib \
	winmm.lib wsock32.lib kernel32.lib winspool.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
} else {
LIBS += wxpngd.lib wxzlibd.lib wxjpegd.lib wxtiffd.lib \
	wxmsw28ud_core.lib wxbase28ud.lib wxmsw28ud_gl.lib wxmsw28ud_aui.lib wxbase28ud_net.lib wxmsw28ud_dbgrid.lib wxmsw28ud_adv.lib \
wxmsw28ud_qa.lib  wxmsw28ud_richtext.lib  wxmsw28ud_xrc.lib \
wxmsw28ud_media.lib wxmsw28ud_html.lib wxbase28ud_xml.lib wxexpat.lib \
	kernel32.lib user32.lib gdi32.lib comdlg32.lib comctl32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib rpcrt4.lib \
	winmm.lib wsock32.lib winspool.lib uuid.lib odbc32.lib odbccp32.lib
}
}

#wxmsw28u_dbgrid.lib 

!CONFIG(staticlib) {
# here we are not building vrut.lib

CONFIG(release) {

POST_TARGETDEPS+=$$VRUT/bin/vrut.lib

} else {

POST_TARGETDEPS+=$$VRUT/bin/vrut_d.lib

}

}
}

win32:LIBS+=-lglew32s
win32:QMAKE_LFLAGS+=/NODEFAULTLIB:LIBC

unix {

#INCLUDEPATH += 

#LIBPATH += 

#LIBS += -lwx_gtk2u_gl-2.8

DEFINES+=FREEGLUT

QMAKE_CXXFLAGS+=`wx-config --cxxflags`

#-c -O3 -fPIC

LIBS+= -fPIC -pthread `wx-config --libs` -lwx_gtk2u_gl-2.8 -lGLEW -lGL -lGLU -lglut


!CONFIG(staticlib) {
# here we are not building vrut.lib

CONFIG(release) {

POST_TARGETDEPS+=$$VRUT/bin/libvrut.a
LIBS+=-lvrut
} else {

POST_TARGETDEPS+=$$VRUT/bin/libvrut_d.a
LIBS+=-lvrut_d
}

}

}
