Use prusa-slicer executable dir to search for occt shared lib
This commit is contained in:
parent
1fd4659f0e
commit
3f8979c95f
3 changed files with 6 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -18,4 +18,3 @@ local-lib
|
||||||
build-linux/*
|
build-linux/*
|
||||||
deps/build-linux/*
|
deps/build-linux/*
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
resources/plugins
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "libslic3r/Utils.hpp"
|
#include "libslic3r/Utils.hpp"
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <boost/dll/runtime_symbol_info.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
@ -27,7 +28,7 @@ LoadStepFn get_load_step_fn()
|
||||||
constexpr const char* fn_name = "load_step_internal";
|
constexpr const char* fn_name = "load_step_internal";
|
||||||
|
|
||||||
if (!load_step_fn) {
|
if (!load_step_fn) {
|
||||||
auto libpath = boost::filesystem::path(resources_dir()) / "plugins";
|
auto libpath = boost::dll::program_location().parent_path();
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
libpath /= "OCCTWrapper.dll";
|
libpath /= "OCCTWrapper.dll";
|
||||||
HMODULE module = LoadLibraryW(libpath.wstring().c_str());
|
HMODULE module = LoadLibraryW(libpath.wstring().c_str());
|
||||||
|
|
|
@ -5,8 +5,8 @@ add_library(OCCTWrapper MODULE OCCTWrapper.cpp)
|
||||||
|
|
||||||
set_target_properties(OCCTWrapper
|
set_target_properties(OCCTWrapper
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${SLIC3R_RESOURCES_DIR}/plugins"
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${SLIC3R_RESOURCES_DIR}/plugins"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src"
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -49,3 +49,5 @@ target_include_directories(OCCTWrapper PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_include_directories(OCCTWrapper PUBLIC ${OpenCASCADE_INCLUDE_DIR})
|
target_include_directories(OCCTWrapper PUBLIC ${OpenCASCADE_INCLUDE_DIR})
|
||||||
target_link_libraries(OCCTWrapper ${OCCT_LIBS})
|
target_link_libraries(OCCTWrapper ${OCCT_LIBS})
|
||||||
|
|
||||||
|
install(TARGETS OCCTWrapper DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue