MantisBT - Community
View Issue Details
0029410Community[OCCT] OCCT:DRAWpublic2018-01-02 21:532020-09-11 15:43
abv 
apn 
normalminor 
newopen 
 
[OCCT] 7.6.0* 
0029410: DRAW - make DRAWEXE usable without environment settings
Historically DRAW depends on environment variables and thus can be launched successfully only by the script which sets these variables according to the current setting (draw.bat or draw.sh).

This is not convenient: it is expected that executable (DRAWEXE) should be able to run correctly if started directly, without any pre-set variables.

To achieve this, we need to find good replacement of environment variables for two kinds of paths:

1. Paths to DRAW plugin binaries. Now command pload searches for these using standard paths supported by dlopen() on Linux / macOS or LoadLibrary() on Windows. If this is not the case (e.g. OCCT is installed to /usr/local on macOS), pload fails.

2. Paths to Tcl scripts and other resources. Now these paths are expected to be defined by a bunch of environment variables. There is some fallback code trying to find paths in the absence of variables, but these fallbacks are made on DRAW is running over sources (search OCCT code for "src/DrawResources"). This is not the case when OCCT is installed with "make install".

The most straightforward approach is to extend fallback code to perform search in default locations, starting from location of the current binary. However, more universal approach should be preferred if it exists.
On Linux or macOS:

1. Build OCCT using CMake and run make install

2. Start DRAWEXE directly
No tags attached.
related to 0030339closed apn Open CASCADE Configuration - add project files for qmake 
Issue History
2018-01-02 21:53abvNew Issue
2018-01-02 21:53abvAssigned To => apn
2018-01-02 21:55abvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18411#r18411
2019-01-21 10:49kgvRelationship addedrelated to 0030339
2019-03-31 15:58oanNote Added: 0083324
2019-03-31 17:34oanNote Edited: 0083324bug_revision_view_page.php?bugnote_id=83324#r20929
2019-07-10 22:24abvTarget Version7.4.0 => 7.5.0
2020-09-11 15:43utverdovTarget Version7.5.0 => 7.6.0*

Notes
(0083324)
oan   
2019-03-31 15:58   
(edited on: 2019-03-31 17:34)
DC,

what do you think about introduction of settings stored in *.ini file?
Good for that, there are a lot of open source ini parsers, such as
https://github.com/benhoyt/inih [^] or
https://github.com/ndevilla/iniparser [^]

Advantage is that it can be configured using cmake and also be human-readable.