Skip to content

Commit

Permalink
freecad-python-interface: use absolute-path to install-bin-dir for wi…
Browse files Browse the repository at this point in the history
…ndows
  • Loading branch information
looooo authored and wwmayer committed Sep 4, 2020
1 parent 1c91c12 commit 1590c20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Ext/freecad/CMakeLists.txt
Expand Up @@ -5,7 +5,9 @@ SET(PYTHON_MAIN_DIR ${python_libs})

set(NAMESPACE_INIT "${CMAKE_BINARY_DIR}/Ext/freecad/__init__.py")
if (WIN32)
set(FREECAD_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
get_filename_component(FREECAD_LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}"
REALPATH BASE_DIR "${CMAKE_INSTALL_PREFIX}")
set( ${CMAKE_INSTALL_BINDIR})
else()
set(FREECAD_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
endif()
Expand Down
4 changes: 2 additions & 2 deletions src/Ext/freecad/__init__.py.template
Expand Up @@ -12,9 +12,9 @@ except ModuleNotFoundError:
except KeyError:

# 2. we use the default freecad defined for this package
_path_to_freecad_libdir = "${CMAKE_INSTALL_LIBDIR}"
_path_to_freecad_libdir = "${FREECAD_LIBRARY_INSTALL_DIR}"
print("PATH_TO_FREECAD_LIBDIR not specified, using default \
FreeCAD version in {}".format( "${FREECAD_LIBRARY_INSTALL_DIR}"))
FreeCAD version in {}".format("${FREECAD_LIBRARY_INSTALL_DIR}"))

_sys.path.append(_path_to_freecad_libdir) # this is the default version
import FreeCAD as app
Expand Down

0 comments on commit 1590c20

Please sign in to comment.