mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0029571: Samples: build qt samples together with OCCT
Extending CMake procedure by 'BUILD_MODULE_QtSamples' variable to switch on qt samples build. Implementation required: - union of occt_toolkit_tool.cmake and occt_toolkit.cmake files; - correction of qt samples sources by adding path to Qt 'plugins' folder. It helps to avoid definition of additional variable (QT_QPA_PLATFORM_PLUGIN_PATH) when staring sample.bat for qt samples; - executable processing is extended in cmake procedure by providing 'EXECUTABLE_PROJECT' variable. Now we need not specify custom processing for DRAWEXE in occt_toolkit.cmake
This commit is contained in:
11
samples/qt/Tutorial/CMakeLists.txt
Normal file
11
samples/qt/Tutorial/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
project(Tutorial)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
|
||||
include_directories("${CMAKE_SOURCE_DIR}/${RELATIVE_DIR}/Interface/src")
|
||||
include_directories("${CMAKE_SOURCE_DIR}/${RELATIVE_DIR}/Common/src")
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
|
||||
|
||||
ADD_DEFINITIONS(-DNO_COMMONSAMPLE_EXPORTS -DNO_IESAMPLE_EXPORTS)
|
||||
|
||||
|
29
samples/qt/Tutorial/EXTERNLIB
Normal file
29
samples/qt/Tutorial/EXTERNLIB
Normal file
@@ -0,0 +1,29 @@
|
||||
TKBRep
|
||||
TKBool
|
||||
TKBO
|
||||
TKCDF
|
||||
TKFillet
|
||||
TKG2d
|
||||
TKG3d
|
||||
TKGeomAlgo
|
||||
TKGeomBase
|
||||
TKernel
|
||||
TKHLR
|
||||
TKIGES
|
||||
TKMath
|
||||
TKMesh
|
||||
TKOffset
|
||||
TKOpenGl
|
||||
TKPrim
|
||||
TKService
|
||||
TKShHealing
|
||||
TKSTEP
|
||||
TKSTEP209
|
||||
TKSTEPAttr
|
||||
TKSTEPBase
|
||||
TKSTL
|
||||
TKTopAlgo
|
||||
TKV3d
|
||||
TKVRML
|
||||
TKXSBase
|
||||
|
2
samples/qt/Tutorial/FILES
Normal file
2
samples/qt/Tutorial/FILES
Normal file
@@ -0,0 +1,2 @@
|
||||
EXTERNLIB
|
||||
PACKAGES
|
2
samples/qt/Tutorial/PACKAGES
Normal file
2
samples/qt/Tutorial/PACKAGES
Normal file
@@ -0,0 +1,2 @@
|
||||
Tutorial/src
|
||||
Common/src
|
@@ -9,4 +9,3 @@ set "CSF_ResourcesDefaults=%RES_DIR%"
|
||||
set "CSF_TutorialResourcesDefaults=%RES_DIR%"
|
||||
|
||||
set "PATH=%QTDIR%/bin;%PATH%"
|
||||
set "QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins\platforms"
|
@@ -1,6 +1,8 @@
|
||||
#include "ApplicationTut.h"
|
||||
#include "DocumentTut.h"
|
||||
|
||||
#include <OSD_Environment.hxx>
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QStatusBar>
|
||||
#include <QMdiSubWindow>
|
||||
@@ -59,7 +61,8 @@ void ApplicationTut::onMakeBottleAction()
|
||||
|
||||
QString ApplicationTut::getTutResourceDir()
|
||||
{
|
||||
static QString resDir (qgetenv ("CSF_TutorialResourcesDefaults").constData());
|
||||
static QString resDir (OSD_Environment ("CSF_TutorialResourcesDefaults").Value().ToCString());
|
||||
if (resDir.isEmpty())
|
||||
resDir = QString (OSD_Environment ("CSF_OCCTResourcePath").Value().ToCString()) + "/samples";
|
||||
return resDir;
|
||||
}
|
||||
|
||||
|
8
samples/qt/Tutorial/src/FILES
Normal file
8
samples/qt/Tutorial/src/FILES
Normal file
@@ -0,0 +1,8 @@
|
||||
ApplicationTut.cxx
|
||||
ApplicationTut.h
|
||||
DocumentTut.cxx
|
||||
DocumentTut.h
|
||||
Main.cxx
|
||||
MakeBottle.cxx
|
||||
Tutorial-icon.ts
|
||||
Tutorial-string.ts
|
@@ -1,10 +1,17 @@
|
||||
#include "ApplicationTut.h"
|
||||
|
||||
#include <OSD_Environment.hxx>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QTranslator>
|
||||
|
||||
int main ( int argc, char* argv[] )
|
||||
{
|
||||
#if QT_VERSION > 0x050000
|
||||
TCollection_AsciiString aPlugindsDirName = OSD_Environment ("QTDIR").Value();
|
||||
if (!aPlugindsDirName.IsEmpty())
|
||||
QApplication::addLibraryPath (QString (aPlugindsDirName.ToCString()) + "/plugins");
|
||||
#endif
|
||||
QApplication a( argc, argv );
|
||||
|
||||
QString resDir = ApplicationCommonWindow::getResourceDir();
|
||||
|
Reference in New Issue
Block a user