0029571: Samples: build qt samples together with OCCT
[occt.git] / samples / qt / FuncDemo / FuncDemo.pro
1 TEMPLATE = app
2 CONFIG += debug_and_release qt
3
4 TARGET = FuncDemo
5
6 SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
7
8 HEADERS = src/*.h
9 SOURCES = src/*.cpp
10
11 INCLUDEPATH += $$quote($$(CSF_OCCTIncludePath))
12
13 OCCT_DEFINES = $$(CSF_DEFINES)
14
15 DEFINES = $$split(OCCT_DEFINES, ;)
16
17 RESOURCES += ./src/FuncDemo.qrc
18
19 unix {
20     UNAME = $$system(uname -s)
21     LIBLIST = $$(LD_LIBRARY_PATH)
22     LIBPATHS = $$split(LIBLIST,":")
23     for(lib, LIBPATHS):LIBS += -L$${lib}
24
25     CONFIG(debug, debug|release) {
26         DESTDIR = ./$$UNAME/bind
27         OBJECTS_DIR = ./$$UNAME/objd
28         MOC_DIR = ./src
29     } else {
30         DESTDIR = ./$$UNAME/bin
31         OBJECTS_DIR = ./$$UNAME/obj
32         MOC_DIR = ./src
33     }
34
35     MACOSX_USE_GLX = $$(MACOSX_USE_GLX)
36
37     !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD
38     equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX
39     DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL
40     !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
41     QMAKE_CXXFLAGS += -std=gnu++11
42 }
43
44 win32 {
45     CONFIG(debug, debug|release) {
46         DEFINES += _DEBUG
47         DESTDIR = ./win$(ARCH)/$(VCVER)/bind
48         OBJECTS_DIR = ./win$(ARCH)/$(VCVER)/objd
49         MOC_DIR = ./src
50     } else {
51         DEFINES += NDEBUG
52         DESTDIR = ./win$(ARCH)/$(VCVER)/bin
53         OBJECTS_DIR = ./win$(ARCH)/$(VCVER)/obj
54         MOC_DIR = ./src
55     }
56     LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath)
57 }
58
59 LIBS += -lTKernel -lTKMath -lTKBRep -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \
60         -lTKTopAlgo -lTKMesh -lTKPrim -lTKCDF -lTKLCAF -lTKCAF -lTKBO
61
62 lrelease.name = LRELEASE ${QMAKE_FILE_IN}
63 lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm $${RES_DIR}/${QMAKE_FILE_BASE}.qm
64 lrelease.output = ${QMAKE_FILE_BASE}.qm
65 lrelease.input = TS_FILES
66 lrelease.clean = $${RES_DIR}/${QMAKE_FILE_BASE}.qm
67 lrelease.CONFIG += no_link target_predeps
68 QMAKE_EXTRA_COMPILERS += lrelease
69
70 copy_res.name = Copy resource ${QMAKE_FILE_IN}
71 copy_res.output = ${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
72 copy_res.clean = $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
73 copy_res.input = RES_FILES
74 copy_res.CONFIG += no_link target_predeps
75 win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
76 unix:  copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR}
77 QMAKE_EXTRA_COMPILERS += copy_res
78 QMAKE_EXTRA_COMPILERS += copy_res
79
80 greaterThan(QT_MAJOR_VERSION, 4) {
81     QT += widgets
82 }