Use prusa-slicer executable dir to search for occt shared lib

This commit is contained in:
tamasmeszaros 2022-07-27 14:09:34 +02:00 committed by Lukas Matena
parent 1fd4659f0e
commit 3f8979c95f
3 changed files with 6 additions and 4 deletions

1
.gitignore vendored
View file

@ -18,4 +18,3 @@ local-lib
build-linux/*
deps/build-linux/*
**/.DS_Store
resources/plugins

View file

@ -6,6 +6,7 @@
#include "libslic3r/Utils.hpp"
#include <boost/filesystem.hpp>
#include <boost/dll/runtime_symbol_info.hpp>
#include <string>
#include <functional>
@ -27,7 +28,7 @@ LoadStepFn get_load_step_fn()
constexpr const char* fn_name = "load_step_internal";
if (!load_step_fn) {
auto libpath = boost::filesystem::path(resources_dir()) / "plugins";
auto libpath = boost::dll::program_location().parent_path();
#ifdef _WIN32
libpath /= "OCCTWrapper.dll";
HMODULE module = LoadLibraryW(libpath.wstring().c_str());

View file

@ -5,8 +5,8 @@ add_library(OCCTWrapper MODULE OCCTWrapper.cpp)
set_target_properties(OCCTWrapper
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${SLIC3R_RESOURCES_DIR}/plugins"
RUNTIME_OUTPUT_DIRECTORY "${SLIC3R_RESOURCES_DIR}/plugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src"
PREFIX ""
)
@ -49,3 +49,5 @@ target_include_directories(OCCTWrapper PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(OCCTWrapper PUBLIC ${OpenCASCADE_INCLUDE_DIR})
target_link_libraries(OCCTWrapper ${OCCT_LIBS})
install(TARGETS OCCTWrapper DESTINATION "${CMAKE_INSTALL_BINDIR}")