@@ -27,11 +27,13 @@ def setupEnvironment():
2727
2828 - Meshroom/
2929 - aliceVision/
30- - bin/ # runtime bundled binaries (exe + libs)
30+ - bin/ # runtime bundled binaries (windows: exe + libs, unix: executables)
31+ - lib/ # runtime bundled libraries (unix: libs)
3132 - share/ # resource files
32- - COPYING.md # AliceVision COPYING file
33- - cameraSensors.db # sensor database
34- - vlfeat_K80L3.tree # voctree file
33+ - aliceVision/
34+ - COPYING.md # AliceVision COPYING file
35+ - cameraSensors.db # sensor database
36+ - vlfeat_K80L3.tree # voctree file
3537 - lib/ # Python lib folder
3638 - qtPlugins/
3739 Meshroom # main executable
@@ -58,28 +60,24 @@ def addToEnvPath(var, val, index=-1):
5860 paths [index :index ] = val
5961 os .environ [var ] = os .pathsep .join (paths )
6062
61- # detect if this is a frozen environment based on executable name
62- isStandalone = "python" not in os . path . basename ( sys . executable ). lower ( )
63+ # sys.frozen is initialized by cx_Freeze
64+ isFrozen = getattr ( sys , "frozen" , False )
6365 # setup root directory (override possible by setting "MESHROOM_INSTALL_DIR" environment variable)
64- rootDir = os .path .dirname (sys .executable ) if isStandalone else os .environ .get ("MESHROOM_INSTALL_DIR" , None )
66+ rootDir = os .path .dirname (sys .executable ) if isFrozen else os .environ .get ("MESHROOM_INSTALL_DIR" , None )
6567
6668 if rootDir :
6769 os .environ ["MESHROOM_INSTALL_DIR" ] = rootDir
6870
6971 aliceVisionDir = os .path .join (rootDir , "aliceVision" )
7072 # default directories
7173 aliceVisionBinDir = os .path .join (aliceVisionDir , "bin" )
72- aliceVisionLibDirs = [os .path .join (aliceVisionDir , "lib64" ), os .path .join (aliceVisionDir , "lib" )] # Unix
7374 aliceVisionShareDir = os .path .join (aliceVisionDir , "share" , "aliceVision" )
7475 qtPluginsDir = os .path .join (rootDir , "qtPlugins" )
7576 sensorDBPath = os .path .join (aliceVisionShareDir , "cameraSensors.db" )
7677 voctreePath = os .path .join (aliceVisionShareDir , "vlfeat_K80L3.tree" )
77- # Unix: "lib" contains shared libraries that needs to be in LD_LIBRARY_PATH
78- libDir = os .path .join (rootDir , "lib" )
7978
8079 env = {
8180 'PATH' : aliceVisionBinDir ,
82- 'LD_LIBRARY_PATH' : [libDir ] + aliceVisionLibDirs , # Unix
8381 'QT_PLUGIN_PATH' : [qtPluginsDir ],
8482 'QML2_IMPORT_PATH' : [os .path .join (qtPluginsDir , "qml" )]
8583 }
0 commit comments