@@ -384,6 +384,7 @@ def prepare_and_start_backend(
384
384
root_service_folder = Path (root_service_folder )
385
385
native_folder = root_service_folder / "Native"
386
386
cad_integration_folder = root_service_folder / "CADIntegration"
387
+ cad_integration_folder_bin = cad_integration_folder / "bin"
387
388
schema_folder = root_service_folder / "Schema"
388
389
389
390
# Adapt the native folder to the OS
@@ -421,15 +422,20 @@ def prepare_and_start_backend(
421
422
else :
422
423
env_copy ["LICENSE_SERVER" ] = os .getenv ("ANSYSLMD_LICENSE_FILE" , "1055@localhost" )
423
424
424
- if os .name == "nt" :
425
- # Modify the PATH variable to include the path to the Ansys Geometry Core Service
426
- env_copy ["PATH" ] = (
427
- f"{ env_copy ['PATH' ]} "
428
- + f";{ root_service_folder .as_posix ()} "
429
- + f";{ native_folder .as_posix ()} "
430
- + f";{ cad_integration_folder .as_posix ()} "
431
- )
425
+ # Adapt the path environment variable to the OS and
426
+ # modify the PATH/LD_LIBRARY_PATH variable to include the path
427
+ # to the Ansys Geometry Core Service
428
+ path_env_var = "PATH" if os .name == "nt" else "LD_LIBRARY_PATH"
429
+ env_copy [path_env_var ] = os .pathsep .join (
430
+ [
431
+ root_service_folder .as_posix (),
432
+ native_folder .as_posix (),
433
+ cad_integration_folder_bin .as_posix (),
434
+ env_copy .get (path_env_var , "" ),
435
+ ]
436
+ )
432
437
438
+ if os .name == "nt" :
433
439
# For Windows, we need to use the exe file to launch the Core Geometry Service
434
440
args .append (
435
441
Path (
@@ -456,14 +462,6 @@ def prepare_and_start_backend(
456
462
"Please install a compatible version."
457
463
)
458
464
459
- # Modify the LD_LIBRARY_PATH variable to include the Ansys Geometry Core Service
460
- env_copy ["LD_LIBRARY_PATH" ] = (
461
- env_copy .get ("LD_LIBRARY_PATH" , "" )
462
- + f":{ root_service_folder .as_posix ()} "
463
- + f":{ native_folder .as_posix ()} "
464
- + f":{ cad_integration_folder .as_posix ()} "
465
- )
466
-
467
465
# For Linux, we need to use the dotnet command to launch the Core Geometry Service
468
466
args .append ("dotnet" )
469
467
args .append (
0 commit comments