mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 14:06:13 +08:00
Integrating LibBGCode into deps with an optional var for source dir
One can then co-develop the two projects with relative convenience
This commit is contained in:
parent
10b6d355ca
commit
866fc767bb
9
deps/CMakeLists.txt
vendored
9
deps/CMakeLists.txt
vendored
@ -20,8 +20,8 @@
|
|||||||
# therefore, unfortunatelly, the installation cannot be copied/moved elsewhere without re-installing wxWidgets.
|
# therefore, unfortunatelly, the installation cannot be copied/moved elsewhere without re-installing wxWidgets.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(PrusaSlicer-deps)
|
project(PrusaSlicer-deps)
|
||||||
cmake_minimum_required(VERSION 3.2)
|
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
include(ProcessorCount)
|
include(ProcessorCount)
|
||||||
@ -62,6 +62,8 @@ if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
|
|||||||
message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.")
|
message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
cmake_policy(SET CMP0135 NEW)
|
||||||
|
|
||||||
function(prusaslicer_add_cmake_project projectname)
|
function(prusaslicer_add_cmake_project projectname)
|
||||||
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
|
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
|
||||||
|
|
||||||
@ -195,6 +197,8 @@ include(NanoSVG/NanoSVG.cmake)
|
|||||||
include(wxWidgets/wxWidgets.cmake)
|
include(wxWidgets/wxWidgets.cmake)
|
||||||
include(OCCT/OCCT.cmake)
|
include(OCCT/OCCT.cmake)
|
||||||
|
|
||||||
|
include(LibBGCode/LibBGCode.cmake)
|
||||||
|
|
||||||
set(_dep_list
|
set(_dep_list
|
||||||
dep_Boost
|
dep_Boost
|
||||||
dep_TBB
|
dep_TBB
|
||||||
@ -206,10 +210,11 @@ set(_dep_list
|
|||||||
dep_OpenCSG
|
dep_OpenCSG
|
||||||
dep_CGAL
|
dep_CGAL
|
||||||
dep_Qhull
|
dep_Qhull
|
||||||
dep_OCCT
|
# dep_OCCT
|
||||||
${PNG_PKG}
|
${PNG_PKG}
|
||||||
${ZLIB_PKG}
|
${ZLIB_PKG}
|
||||||
${EXPAT_PKG}
|
${EXPAT_PKG}
|
||||||
|
dep_LibBGCode
|
||||||
)
|
)
|
||||||
|
|
||||||
# if (NOT MSVC)
|
# if (NOT MSVC)
|
||||||
|
24
deps/LibBGCode/LibBGCode.cmake
vendored
Normal file
24
deps/LibBGCode/LibBGCode.cmake
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
set(LibBGCode_SOURCE_DIR "" CACHE PATH "Optionally specify local LibBGCode source directory")
|
||||||
|
|
||||||
|
set(_source_dir_line "URL;https://github.com/prusa3d/libbgcode/archive/refs/heads/main.zip")
|
||||||
|
|
||||||
|
if (LibBGCode_SOURCE_DIR)
|
||||||
|
set(_source_dir_line "SOURCE_DIR;${LibBGCode_SOURCE_DIR};BUILD_ALWAYS;ON")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
prusaslicer_add_cmake_project(LibBGCode_deps
|
||||||
|
${_source_dir_line}
|
||||||
|
SOURCE_SUBDIR deps
|
||||||
|
CMAKE_ARGS
|
||||||
|
-DDEP_DOWNLOAD_DIR:PATH=${DEP_DOWNLOAD_DIR}
|
||||||
|
-DLibBGCode_Deps_SELECT_ALL:BOOL=OFF
|
||||||
|
-DLibBGCode_Deps_SELECT_heatshrink:BOOL=ON
|
||||||
|
-DDESTDIR=${DESTDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
prusaslicer_add_cmake_project(LibBGCode
|
||||||
|
${_source_dir_line}
|
||||||
|
DEPENDS dep_LibBGCode_deps
|
||||||
|
CMAKE_ARGS
|
||||||
|
-DLibBGCode_BUILD_TESTS:BOOL=OFF
|
||||||
|
)
|
@ -14,6 +14,8 @@ if (TARGET OpenVDB::openvdb)
|
|||||||
set(OpenVDBUtils_SOURCES OpenVDBUtils.cpp OpenVDBUtils.hpp OpenVDBUtilsLegacy.hpp)
|
set(OpenVDBUtils_SOURCES OpenVDBUtils.cpp OpenVDBUtils.hpp OpenVDBUtilsLegacy.hpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(LibBGCode REQUIRED COMPONENTS Convert)
|
||||||
|
|
||||||
set(SLIC3R_SOURCES
|
set(SLIC3R_SOURCES
|
||||||
pchheader.cpp
|
pchheader.cpp
|
||||||
pchheader.hpp
|
pchheader.hpp
|
||||||
@ -508,6 +510,7 @@ target_link_libraries(libslic3r
|
|||||||
ZLIB::ZLIB
|
ZLIB::ZLIB
|
||||||
JPEG::JPEG
|
JPEG::JPEG
|
||||||
qoi
|
qoi
|
||||||
|
LibBGCode::bgcode_convert
|
||||||
)
|
)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user