File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,17 @@ ELSE ()
1010 set (OMSIMULATORLIB_STRING "libOMSimulator.so" )
1111ENDIF ()
1212
13+ ## If OMSimulator is being built as part of OpenModelica and that is set by "OPENMODELICA_NEW_CMAKE_BUILD"
14+ ## account for the "omc" directory added in the lib dir (lib/omc/OMSimulator versus lib/OMSimulator)
15+ ## currently this sets the path only for windows
16+ ## TODO fix the paths for linux
17+ if (OPENMODELICA_NEW_CMAKE_BUILD)
18+ set (OMSIMULATOR_PYTHON_RELATIVE_DLL_DIR "../../../bin" )
19+ else ()
20+ set (OMSIMULATOR_PYTHON_RELATIVE_DLL_DIR "../../bin" )
21+ endif ()
22+
23+
1324configure_file ("${CMAKE_CURRENT_SOURCE_DIR} /__init__.py" "${CMAKE_CURRENT_BINARY_DIR} /__init__.py" @ONLY )
1425configure_file ("${CMAKE_CURRENT_SOURCE_DIR} /capi.py" "${CMAKE_CURRENT_BINARY_DIR} /capi.py" @ONLY )
1526configure_file ("${CMAKE_CURRENT_SOURCE_DIR} /OMSimulatorPython3.in" "${CMAKE_CURRENT_BINARY_DIR} /OMSimulatorPython3" @ONLY )
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def __init__(self):
1010 omslib = os .path .join (dirname , ".." , "@OMSIMULATORLIB_STRING@" )
1111
1212 if os .name == 'nt' : # Windows
13- omslib = os .path .join (dirname , "../../bin/ " , "@OMSIMULATORLIB_STRING@" )
13+ omslib = os .path .join (dirname , "@OMSIMULATOR_PYTHON_RELATIVE_DLL_DIR@ " , "@OMSIMULATORLIB_STRING@" )
1414 dllDir = os .add_dll_directory (os .path .dirname (omslib ))
1515 self .obj = ctypes .CDLL (omslib )
1616 if os .name == 'nt' : # Windows
You can’t perform that action at this time.
0 commit comments