mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0026916: Configuration, CMake - configure variables to customize installation path separately for executables, libraries and resources
change the structure of binaries for unix OCCT_RESOURCE_PATH env variable is used
This commit is contained in:
@@ -59,17 +59,34 @@ if { [file isdirectory $dir] } {
|
||||
}
|
||||
|
||||
# set default testing environment
|
||||
if {[array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != ""} {
|
||||
if {[file isdirectory $env(OCCT_SHARE_PATH)/tests]} {
|
||||
if { ! [info exists env(CSF_TestScriptsPath)] } {
|
||||
set env(CSF_TestScriptsPath) $env(OCCT_SHARE_PATH)/tests
|
||||
} else {
|
||||
set env(CSF_TestScriptsPath) $env(CSF_TestScriptsPath)[_path_separator]$env(OCCT_SHARE_PATH)/tests
|
||||
}
|
||||
}
|
||||
|
||||
if {[file isdirectory $env(OCCT_SHARE_PATH)/data]} {
|
||||
if { ! [info exists env(CSF_TestDataPath)] } {
|
||||
set env(CSF_TestDataPath) $env(OCCT_SHARE_PATH)/data
|
||||
} else {
|
||||
set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(OCCT_SHARE_PATH)/data
|
||||
}
|
||||
}
|
||||
}
|
||||
if { [info exists env(CASROOT)] && [file isdirectory $env(CASROOT)/tests] } {
|
||||
if { ! [info exists env(CSF_TestScriptsPath)] } {
|
||||
set env(CSF_TestScriptsPath) $env(CASROOT)/tests
|
||||
} else {
|
||||
set env(CSF_TestScriptsPath) $env(CSF_TestScriptsPath)[_path_separator]$env(CASROOT)/tests
|
||||
}
|
||||
if { ! [info exists env(CSF_TestDataPath)] } {
|
||||
set env(CSF_TestDataPath) $env(CASROOT)/data
|
||||
} else {
|
||||
set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CASROOT)/data
|
||||
}
|
||||
if { ! [info exists env(CSF_TestScriptsPath)] } {
|
||||
set env(CSF_TestScriptsPath) $env(CASROOT)/tests
|
||||
} else {
|
||||
set env(CSF_TestScriptsPath) $env(CSF_TestScriptsPath)[_path_separator]$env(CASROOT)/tests
|
||||
}
|
||||
if { ! [info exists env(CSF_TestDataPath)] } {
|
||||
set env(CSF_TestDataPath) $env(CASROOT)/data
|
||||
} else {
|
||||
set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CASROOT)/data
|
||||
}
|
||||
}
|
||||
|
||||
# load application-defined initialization script, which is expected to
|
||||
|
@@ -29,7 +29,12 @@ if { [info exists tk_library] } {
|
||||
|
||||
#fills menu "Load" with submenus
|
||||
proc fillloadmenu {} {
|
||||
set chan [open [file nativename $::env(CASROOT)/src/DrawResources/DrawPlugin]]
|
||||
set drawplugpath "$::env(CASROOT)/src/DrawResources/DrawPlugin"
|
||||
if {[array names ::env OCCT_RESOURCE_PATH] != "" && "$::env(OCCT_RESOURCE_PATH)" != "" && [file exists $::env(OCCT_RESOURCE_PATH)/DrawResources/DrawPlugin]} {
|
||||
set drawplugpath "$::env(OCCT_RESOURCE_PATH)/DrawResources/DrawPlugin"
|
||||
}
|
||||
|
||||
set chan [open [file nativename $drawplugpath]]
|
||||
while {[gets $chan line] >= 0} {
|
||||
if {[lindex [split $line ""] 0] != "!"} {
|
||||
if {[lindex [split $line ""] 0] == ""} {continue}
|
||||
@@ -230,8 +235,14 @@ proc vsource {} {
|
||||
proc vsamples {} {
|
||||
#create list {{category} {title} {filename}}
|
||||
set alistofthree ""
|
||||
foreach fname [file nativename [glob -path $::env(CASROOT)/samples/tcl/ *]] {
|
||||
if {[lindex [split $fname "."] end] != "tcl"} {continue}
|
||||
|
||||
set samplespath "$::env(CASROOT)/samples/tcl/"
|
||||
if { [array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != "" && [file exists $::env(OCCT_SHARE_PATH)/samples/tcl/]} {
|
||||
set samplespath "$::env(OCCT_SHARE_PATH)/samples/tcl/"
|
||||
}
|
||||
|
||||
foreach fname [glob -path "${samplespath}" *.tcl] {
|
||||
|
||||
set chan [open $fname]
|
||||
set istitlefound 0
|
||||
while {[gets $chan line] >= 0} {
|
||||
@@ -394,7 +405,13 @@ proc about {} {
|
||||
set screenheight [expr {int([winfo screenheight .]*0.5-200)}]
|
||||
set screenwidth [expr {int([winfo screenwidth .]*0.5-200)}]
|
||||
wm geometry .about 400x200+$screenwidth+$screenheight
|
||||
image create photo occlogo -file $::env(CASROOT)/src/DrawResources/OCC_logo.png -format png
|
||||
|
||||
set logopath "$::env(CASROOT)/src/DrawResources/OCC_logo.png"
|
||||
if {[array names ::env OCCT_RESOURCE_PATH] != "" && "$::env(OCCT_RESOURCE_PATH)" != "" && [file exists $::env(OCCT_RESOURCE_PATH)/DrawResources/OCC_logo.png]} {
|
||||
set logopath "$::env(OCCT_RESOURCE_PATH)/DrawResources/OCC_logo.png"
|
||||
}
|
||||
|
||||
image create photo occlogo -file $logopath -format png
|
||||
frame .about.logo -bg red
|
||||
frame .about.links -bg blue
|
||||
frame .about.copyright
|
||||
@@ -445,13 +462,17 @@ proc _launchBrowser {url} {
|
||||
# Else opens a site with this guide
|
||||
################################################################
|
||||
proc openuserguide {} {
|
||||
if [file exists $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf] {
|
||||
_launchBrowser $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf
|
||||
if { [array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != "" && [file exists $::env(OCCT_SHARE_PATH)/doc/pdf/user_guides/occt_test_harness.pdf]} {
|
||||
_launchBrowser $::env(OCCT_SHARE_PATH)/doc/pdf/user_guides/occt_test_harness.pdf
|
||||
} elseif { [array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != "" && [file exists $::env(OCCT_SHARE_PATH)/doc/overview/html/occt_user_guides__test_harness.html]} {
|
||||
_launchBrowser $::env(OCCT_SHARE_PATH)/doc/overview/html/occt_user_guides__test_harness.html
|
||||
} elseif [file exists $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf] {
|
||||
_launchBrowser $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf
|
||||
} elseif [file exists $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html] {
|
||||
_launchBrowser $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html
|
||||
_launchBrowser $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html
|
||||
} else {
|
||||
_launchBrowser {http://dev.opencascade.org/doc/overview/html/occt_user_guides__test_harness.html}
|
||||
}
|
||||
launchBrowser {http://dev.opencascade.org/doc/overview/html/occt_user_guides__test_harness.html}
|
||||
}
|
||||
}
|
||||
|
||||
#Search through commands and display the result
|
||||
|
@@ -12,5 +12,16 @@
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
set Draw_GEOMETRY 1
|
||||
source $env(CASROOT)/src/DrawResources/CURVES.tcl
|
||||
source $env(CASROOT)/src/DrawResources/SURFACES.tcl
|
||||
|
||||
if {[array names ::env OCCT_RESOURCE_PATH] != "" && "$::env(OCCT_RESOURCE_PATH)" != "" && [file exists $::env(OCCT_RESOURCE_PATH)/DrawResources/CURVES.tcl]} {
|
||||
source $env(OCCT_RESOURCE_PATH)/DrawResources/CURVES.tcl
|
||||
} else {
|
||||
source $env(CASROOT)/src/DrawResources/CURVES.tcl
|
||||
}
|
||||
|
||||
if {[array names ::env OCCT_RESOURCE_PATH] != "" && "$::env(OCCT_RESOURCE_PATH)" != "" && [file exists $::env(OCCT_RESOURCE_PATH)/DrawResources/SURFACES.tcl]} {
|
||||
source $env(OCCT_RESOURCE_PATH)/DrawResources/SURFACES.tcl
|
||||
} else {
|
||||
source $env(CASROOT)/src/DrawResources/SURFACES.tcl
|
||||
}
|
||||
|
||||
|
@@ -251,6 +251,11 @@ proc testgrid {args} {
|
||||
set prefix "${branch}_"
|
||||
}
|
||||
set logdir "results/${prefix}[clock format [clock seconds] -format {%Y-%m-%dT%H%M}]"
|
||||
|
||||
if { [array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != ""} {
|
||||
set logdir "$::env(OCCT_SHARE_PATH)/${logdir}"
|
||||
}
|
||||
|
||||
set logdir [file normalize $logdir]
|
||||
}
|
||||
if { [file isdirectory $logdir] && ! $overwrite && ! [catch {glob -directory $logdir *}] } {
|
||||
|
Reference in New Issue
Block a user