0023821: Improve qmake project files for Qt samples
[occt.git] / samples / qt / Tutorial / Tutorial.pro
CommitLineData
7fd59977 1TEMPLATE = app
2CONFIG += debug_and_release qt
fad8962a 3QT += qt3support
7fd59977 4
5TARGET = Tutorial
6
fad8962a 7SAMPLESROOT = $$(CASROOT)/samples/qt
7fd59977 8
fad8962a 9HEADERS = src/*.h \
10 $${SAMPLESROOT}/Common/src/*.h \
11 $${SAMPLESROOT}/Interface/src/*.h
7fd59977 12
fad8962a 13SOURCES = src/*.cxx \
14 $${SAMPLESROOT}/Common/src/*.cxx \
15 $${SAMPLESROOT}/Interface/src/*.cxx
16
17TS_FILES = $${SAMPLESROOT}/Common/src/Common-icon.ts \
18 $${SAMPLESROOT}/Common/src/Common-string.ts \
19 ./src/Tutorial-icon.ts \
20 ./src/Tutorial-string.ts
21
22RES_FILES = $${SAMPLESROOT}/Common/res/* \
23 ./res/*
24
25RES_DIR = $$quote($$(RES_DIR))
26
27INCLUDEPATH += $$quote($${SAMPLESROOT}/Common/src)
28INCLUDEPATH += $$quote($${SAMPLESROOT}/Interface/src)
7fd59977 29
30DEFINES = CSFDB
31
32unix {
90ac6145 33 UNAME = $$system(uname -s)
7a53e886 34 INCLUDES = $$(CSF_OPT_INC)
35 PATHS = $$split(INCLUDES,":")
36 for(path, PATHS):INCLUDEPATH += $${path}
37 LIBLIST = $$(LD_LIBRARY_PATH)
38 LIBPATHS = $$split(LIBLIST,":")
39 for(lib, LIBPATHS):LIBS += -L$${lib}
90ac6145 40
7fd59977 41 CONFIG(debug, debug|release) {
90ac6145 42 DESTDIR = ./$$UNAME/bind
43 OBJECTS_DIR = ./$$UNAME/objd
44 MOC_DIR = ./$$UNAME/srcd
7fd59977 45 } else {
90ac6145 46 DESTDIR = ./$$UNAME/bin
47 OBJECTS_DIR = ./$$UNAME/obj
48 MOC_DIR = ./$$UNAME/src
7fd59977 49 }
5f9575b3 50
51 MACOSX_USE_GLX = $$(MACOSX_USE_GLX)
52
53 !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD
54 !macx | equals(MACOSX_USE_GLX, true): DEFINES += LIN LININTEL
dc3fe572 55 equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX
5f9575b3 56 DEFINES += OCC_CONVERT_SIGNALS HAVE_CONFIG_H HAVE_WOK_CONFIG_H QT_NO_STL
57 !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
58 LIBS += -lfreeimageplus
59 LIBS += -ltbb -ltbbmalloc
7fd59977 60}
61
62win32 {
7a53e886 63 INCLUDES = $$(CSF_OPT_INC)
64 PATHS = $$split(INCLUDES,";")
65 for(path, PATHS):INCLUDEPATH += $${path}
66
7fd59977 67 CONFIG(debug, debug|release) {
68 DEFINES += _DEBUG
8854dbb4 69 !contains(QMAKE_HOST.arch, x86_64) {
cc5ac00d 70 LIBS = -L$(CSF_OPT_LIB32D)
fc3a37cd 71 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1310) {
8854dbb4 72 DESTDIR = ./win32/vc7/bind
73 OBJECTS_DIR = ./win32/vc7/objd
74 MOC_DIR = ./win32/vc7/srcd
8854dbb4 75 }
76 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
77 DESTDIR = ./win32/vc8/bind
78 OBJECTS_DIR = ./win32/vc8/objd
79 MOC_DIR = ./win32/vc8/srcd
8854dbb4 80 }
81 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
82 DESTDIR = ./win32/vc9/bind
83 OBJECTS_DIR = ./win32/vc9/objd
84 MOC_DIR = ./win32/vc9/srcd
8854dbb4 85 }
86 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
87 DESTDIR = ./win32/vc10/bind
88 OBJECTS_DIR = ./win32/vc10/objd
89 MOC_DIR = ./win32/vc10/srcd
8854dbb4 90 }
fc3a37cd 91 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
92 DESTDIR = ./win32/vc11/bind
93 OBJECTS_DIR = ./win32/vc11/objd
94 MOC_DIR = ./win32/vc11/srcd
95 }
8854dbb4 96 } else {
cc5ac00d 97 LIBS = -L$(CSF_OPT_LIB64D)
fc3a37cd 98 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
8854dbb4 99 DESTDIR = ./win64/vc8/bind
100 OBJECTS_DIR = ./win64/vc8/objd
101 MOC_DIR = ./win64/vc8/srcd
8854dbb4 102 }
103 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
104 DESTDIR = ./win64/vc9/bind
105 OBJECTS_DIR = ./win64/vc9/objd
106 MOC_DIR = ./win64/vc9/srcd
8854dbb4 107 }
108 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
109 DESTDIR = ./win64/vc10/bind
110 OBJECTS_DIR = ./win64/vc10/objd
111 MOC_DIR = ./win64/vc10/srcd
8854dbb4 112 }
fc3a37cd 113 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
114 DESTDIR = ./win64/vc11/bind
115 OBJECTS_DIR = ./win64/vc11/objd
116 MOC_DIR = ./win64/vc11/srcd
117 }
8854dbb4 118 }
7fd59977 119 } else {
120 DEFINES += NDEBUG
8854dbb4 121 !contains(QMAKE_HOST.arch, x86_64) {
cc5ac00d 122 LIBS = -L$(CSF_OPT_LIB32)
fc3a37cd 123 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1310) {
8854dbb4 124 DESTDIR = ./win32/vc7/bin
125 OBJECTS_DIR = ./win32/vc7/obj
126 MOC_DIR = ./win32/vc7/src
8854dbb4 127 }
128 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
129 DESTDIR = ./win32/vc8/bin
130 OBJECTS_DIR = ./win32/vc8/obj
131 MOC_DIR = ./win32/vc8/src
8854dbb4 132 }
133 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
134 DESTDIR = ./win32/vc9/bin
135 OBJECTS_DIR = ./win32/vc9/obj
136 MOC_DIR = ./win32/vc9/src
8854dbb4 137 }
138 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
139 DESTDIR = ./win32/vc10/bin
140 OBJECTS_DIR = ./win32/vc10/obj
141 MOC_DIR = ./win32/vc10/src
8854dbb4 142 }
fc3a37cd 143 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
144 DESTDIR = ./win32/vc11/bin
145 OBJECTS_DIR = ./win32/vc11/obj
146 MOC_DIR = ./win32/vc11/src
147 }
8854dbb4 148 } else {
cc5ac00d 149 LIBS = -L$(CSF_OPT_LIB64)
fc3a37cd 150 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
8854dbb4 151 DESTDIR = ./win64/vc8/bin
152 OBJECTS_DIR = ./win64/vc8/obj
153 MOC_DIR = ./win64/vc8/src
8854dbb4 154 }
155 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
156 DESTDIR = ./win64/vc9/bin
157 OBJECTS_DIR = ./win64/vc9/obj
158 MOC_DIR = ./win64/vc9/src
8854dbb4 159 }
160 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
161 DESTDIR = ./win64/vc10/bin
162 OBJECTS_DIR = ./win64/vc10/obj
163 MOC_DIR = ./win64/vc10/src
8854dbb4 164 }
fc3a37cd 165 contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
166 DESTDIR = ./win64/vc11/bin
167 OBJECTS_DIR = ./win64/vc11/obj
168 MOC_DIR = ./win64/vc11/src
169 }
8854dbb4 170 }
7fd59977 171 }
172 DEFINES +=WNT WIN32 NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
173}
8854dbb4 174
fad8962a 175LIBS += -lTKernel -lPTKernel -lTKMath -lTKService -lTKV3d \
7a53e886 176 -lTKBRep -lTKIGES -lTKSTL -lTKVRML -lTKSTEP -lTKSTEPAttr -lTKSTEP209 \
177 -lTKSTEPBase -lTKShapeSchema -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \
178 -lTKXSBase -lTKPShape -lTKShHealing -lTKHLR -lTKTopAlgo -lTKMesh -lTKPrim \
179 -lTKCDF -lTKBool -lTKBO -lTKFillet -lTKOffset \
7fd59977 180
fad8962a 181!exists($${RES_DIR}) {
182 win32 {
183 system(mkdir $${RES_DIR})
184 } else {
185 system(mkdir -p $${RES_DIR})
186 }
187}
188
3f0a1ac7 189lrelease.name = LRELEASE ${QMAKE_FILE_IN}
fad8962a 190lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm $${RES_DIR}/${QMAKE_FILE_BASE}.qm
191lrelease.output = ${QMAKE_FILE_BASE}.qm
3346c3f9 192lrelease.input = TS_FILES
fad8962a 193lrelease.clean = $${RES_DIR}/${QMAKE_FILE_BASE}.qm
7fd59977 194lrelease.CONFIG += no_link target_predeps
fad8962a 195QMAKE_EXTRA_COMPILERS += lrelease
196
197copy_res.name = Copy resource ${QMAKE_FILE_IN}
198copy_res.output = ${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
199copy_res.clean = $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
200copy_res.input = RES_FILES
201copy_res.CONFIG += no_link target_predeps
202win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
203unix: copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR}
204QMAKE_EXTRA_COMPILERS += copy_res
205