From 496ffd4005ef8a608930761cda5588c8472cdf0f Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Thu, 27 Mar 2025 16:59:53 +0000 Subject: [PATCH] Configuration - Issue to start Draw debugging in VS #465 Fixed path for DRAWEXE project configuration in CMakeLists.txt Updated plugin file search path to use CSF_OCCTResourcePath --- CMakeLists.txt | 2 +- adm/templates/DRAWEXE.vcxproj.user.in | 2 ++ src/Draw/TKDraw/Draw/Draw.cxx | 4 ++-- src/Draw/TKDraw/Draw/Draw_PloadCommands.cxx | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b1db71f73..5def27cf3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1240,7 +1240,7 @@ if (MSVC AND 3RDPARTY_DLL_DIRS) set (X_COMPILER_BITNESS "Win32") endif() - OCCT_CONFIGURE ("adm/templates/DRAWEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/src/DRAWEXE/DRAWEXE.vcxproj.user") + OCCT_CONFIGURE ("adm/templates/DRAWEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/src/Draw/DRAWEXE/DRAWEXE.vcxproj.user") endif() endif() diff --git a/adm/templates/DRAWEXE.vcxproj.user.in b/adm/templates/DRAWEXE.vcxproj.user.in index cd1545304a..c9b4cbd4f0 100644 --- a/adm/templates/DRAWEXE.vcxproj.user.in +++ b/adm/templates/DRAWEXE.vcxproj.user.in @@ -4,6 +4,7 @@ CASROOT=@CMAKE_SOURCE_DIR@ CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@ CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resources +DRAWHOME=@CMAKE_SOURCE_DIR@/resources/DrawResources CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests @@ -29,6 +30,7 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH% CASROOT=@CMAKE_SOURCE_DIR@ CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@ +DRAWHOME=@CMAKE_SOURCE_DIR@/resources/DrawResources CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resources CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples diff --git a/src/Draw/TKDraw/Draw/Draw.cxx b/src/Draw/TKDraw/Draw/Draw.cxx index 32160fa707..184152728e 100644 --- a/src/Draw/TKDraw/Draw/Draw.cxx +++ b/src/Draw/TKDraw/Draw/Draw.cxx @@ -452,10 +452,10 @@ void Draw_Appli(int argc, char** argv, const FDraw_InitAppli Draw_InitAppli) else { TCollection_AsciiString aDrawHome; - TCollection_AsciiString aCasRoot(OSD_Environment("CASROOT").Value()); + TCollection_AsciiString aCasRoot(OSD_Environment("CSF_OCCTResourcePath").Value()); if (!aCasRoot.IsEmpty()) { - aDrawHome = aCasRoot + "/src/DrawResources"; + aDrawHome = aCasRoot + "/DrawResources"; } else { diff --git a/src/Draw/TKDraw/Draw/Draw_PloadCommands.cxx b/src/Draw/TKDraw/Draw/Draw_PloadCommands.cxx index 45a3af0699..73625dadcb 100644 --- a/src/Draw/TKDraw/Draw/Draw_PloadCommands.cxx +++ b/src/Draw/TKDraw/Draw/Draw_PloadCommands.cxx @@ -60,17 +60,17 @@ static Standard_Boolean findPluginFile(TCollection_AsciiString& thePluginName, } else { - // now try by CASROOT - thePluginDir = OSD_Environment("CASROOT").Value(); + // now try by CSF_OCCTResourcePath + thePluginDir = OSD_Environment("CSF_OCCTResourcePath").Value(); if (!thePluginDir.IsEmpty()) { - thePluginDir += "/src/DrawResources"; + thePluginDir += "/DrawResources"; aToSetCSFVariable = Standard_True; // CSF variable to be set later } else { Message::SendFail() << "Failed to load plugin: Neither " << aCSFVariable - << ", nor CASROOT variables have been set"; + << ", nor CSF_OCCTResourcePath variables have been set"; return Standard_False; } }