0026942: Training material are not built on OCCT installed after building by cmake...
[occt.git] / samples / qt / Tutorial / Tutorial.pro
1 TEMPLATE = app
2 CONFIG += debug_and_release qt
3
4 TARGET = Tutorial
5
6 SAMPLESROOT = $$quote($$(CASROOT)/samples/qt)
7
8 HEADERS   = src/*.h \
9             $${SAMPLESROOT}/Common/src/*.h \
10             $${SAMPLESROOT}/Interface/src/*.h
11
12 SOURCES   = src/*.cxx \
13             $${SAMPLESROOT}/Common/src/*.cxx \
14             $${SAMPLESROOT}/Interface/src/*.cxx
15
16 TS_FILES  = $${SAMPLESROOT}/Common/src/Common-icon.ts \
17             $${SAMPLESROOT}/Common/src/Common-string.ts \
18             ./src/Tutorial-icon.ts \
19             ./src/Tutorial-string.ts
20
21 RES_FILES = $${SAMPLESROOT}/Common/res/* \
22             ./res/*
23
24 RES_DIR   = $$quote($$(RES_DIR))
25
26 INCLUDEPATH += $$quote($${SAMPLESROOT}/Common/src)
27 INCLUDEPATH += $$quote($${SAMPLESROOT}/Interface/src)
28 INCLUDEPATH += $$quote($$(CASROOT)/inc)
29
30 OCCT_DEFINES = $$(CSF_DEFINES)
31
32 DEFINES = $$split(OCCT_DEFINES, ;)
33
34 unix {
35     UNAME = $$system(uname -s)
36     LIBLIST = $$(LD_LIBRARY_PATH)
37     LIBPATHS = $$split(LIBLIST,":")
38     for(lib, LIBPATHS):LIBS += -L$${lib}
39
40     CONFIG(debug, debug|release) {
41         DESTDIR = ./$$UNAME/bind
42         OBJECTS_DIR = ./$$UNAME/objd
43         MOC_DIR = ./$$UNAME/mocd
44     } else {
45         DESTDIR = ./$$UNAME/bin
46         OBJECTS_DIR = ./$$UNAME/obj
47         MOC_DIR = ./$$UNAME/moc
48     }
49
50     MACOSX_USE_GLX = $$(MACOSX_USE_GLX)
51
52     !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD
53     equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX
54     DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL
55     !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
56     LIBS += -lfreeimageplus
57     LIBS += -ltbb -ltbbmalloc
58     QMAKE_CXXFLAGS += -std=gnu++11
59 }
60
61 win32 {
62     CONFIG(debug, debug|release) {
63         DEFINES += _DEBUG
64         DESTDIR = ./win$(ARCH)/$(VCVER)/bind
65         OBJECTS_DIR = ./win$(ARCH)/$(VCVER)/objd
66         MOC_DIR = ./win$(ARCH)/$(VCVER)/mocd
67         LIBS = -L$$(QTDIR)/lib;$$(CASROOT)/win$$(ARCH)/$$(VCVER)/libd
68     } else {
69         DEFINES += NDEBUG
70         DESTDIR = ./win$(ARCH)/$(VCVER)/bin
71         OBJECTS_DIR = ./win$(ARCH)/$(VCVER)/obj
72         MOC_DIR = ./win$(ARCH)/$(VCVER)/moc
73         LIBS = -L$$(QTDIR)/lib;$$(CASROOT)/win$$(ARCH)/$$(VCVER)/lib
74     }
75     DEFINES += NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
76 }
77
78 LIBS += -lTKernel -lTKMath -lTKService -lTKV3d -lTKOpenGl \
79         -lTKBRep -lTKIGES -lTKSTL -lTKVRML -lTKSTEP -lTKSTEPAttr -lTKSTEP209 \
80         -lTKSTEPBase -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \
81         -lTKXSBase -lTKShHealing -lTKHLR -lTKTopAlgo -lTKMesh -lTKPrim \
82         -lTKCDF -lTKBool -lTKBO -lTKFillet -lTKOffset \
83
84 !exists($${RES_DIR}) {
85     win32 {
86         system(mkdir $${RES_DIR})
87     } else {
88         system(mkdir -p $${RES_DIR})
89     }
90 }
91
92 lrelease.name = LRELEASE ${QMAKE_FILE_IN}
93 lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm $${RES_DIR}/${QMAKE_FILE_BASE}.qm
94 lrelease.output = ${QMAKE_FILE_BASE}.qm
95 lrelease.input = TS_FILES
96 lrelease.clean = $${RES_DIR}/${QMAKE_FILE_BASE}.qm
97 lrelease.CONFIG += no_link target_predeps
98 QMAKE_EXTRA_COMPILERS += lrelease
99
100 copy_res.name = Copy resource ${QMAKE_FILE_IN}
101 copy_res.output = ${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
102 copy_res.clean = $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
103 copy_res.input = RES_FILES
104 copy_res.CONFIG += no_link target_predeps
105 win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
106 unix:  copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR}
107 QMAKE_EXTRA_COMPILERS += copy_res
108 #QMAKE_CXXFLAGS += /wd4996
109
110 greaterThan(QT_MAJOR_VERSION, 4) {
111     QT += widgets
112