update deps

This commit is contained in:
QIDI TECH
2025-08-01 14:19:36 +08:00
parent fc0a06deaa
commit 8ed41b9f06
21 changed files with 442 additions and 208 deletions

174
deps/Boost/Boost.cmake vendored
View File

@@ -1,160 +1,26 @@
include(ExternalProject)
if (WIN32) set(_context_abi_line "")
set(_bootstrap_cmd bootstrap.bat) set(_context_arch_line "")
set(_build_cmd b2.exe) if (APPLE AND CMAKE_OSX_ARCHITECTURES)
else() if (CMAKE_OSX_ARCHITECTURES MATCHES "x86")
set(_bootstrap_cmd ./bootstrap.sh) set(_context_abi_line "-DBOOST_CONTEXT_ABI:STRING=sysv")
set(_build_cmd ./b2) elseif (CMAKE_OSX_ARCHITECTURES MATCHES "arm")
endif() set (_context_abi_line "-DBOOST_CONTEXT_ABI:STRING=aapcs")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(_boost_toolset gcc)
configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam boost-user-config.jam)
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/boost-user-config.jam ./tools/build/src/tools/user-config.jam)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
if (MSVC_VERSION EQUAL 1800)
# 1800 = VS 12.0 (v120 toolset)
set(_boost_toolset "msvc-12.0")
elseif (MSVC_VERSION EQUAL 1900)
# 1900 = VS 14.0 (v140 toolset)
set(_boost_toolset "msvc-14.0")
elseif (MSVC_VERSION LESS 1920)
# 1910-1919 = VS 15.0 (v141 toolset)
set(_boost_toolset "msvc-14.1")
elseif (MSVC_VERSION LESS 1930)
# 1920-1929 = VS 16.0 (v142 toolset)
set(_boost_toolset "msvc-14.2")
elseif (MSVC_VERSION LESS 1950)
# 1930-1949 = VS 17.0 (v143 toolset)
set(_boost_toolset "msvc-14.3")
else ()
message(FATAL_ERROR "Unsupported MSVC version")
endif () endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(_context_arch_line "-DBOOST_CONTEXT_ARCHITECTURE:STRING=${CMAKE_OSX_ARCHITECTURES}")
if (WIN32) message(STATUS "BOOST param: ${_context_abi_line} ${_context_arch_line}")
set(_boost_toolset "clang-win")
elseif (APPLE)
set(_boost_toolset "clang")
else()
set(_boost_toolset clang)
configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam boost-user-config.jam)
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/boost-user-config.jam ./tools/build/src/tools/user-config.jam)
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(_boost_toolset "intel")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(_boost_toolset "clang")
endif()
message(STATUS "Deduced boost toolset: ${_boost_toolset} based on ${CMAKE_CXX_COMPILER_ID} compiler")
set(_libs "")
foreach(_comp ${DEP_Boost_COMPONENTS})
list(APPEND _libs "--with-${_comp}")
endforeach()
if (BUILD_SHARED_LIBS)
set(_link shared)
else()
set(_link static)
endif()
set(_bits "")
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(_bits 64)
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(_bits 32)
endif () endif ()
include(ProcessorCount) qidistudio_add_cmake_project(Boost
ProcessorCount(NPROC) URL "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz"
file(TO_NATIVE_PATH ${DESTDIR}/usr/local/ _prefix) URL_HASH SHA256=4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95
LIST_SEPARATOR |
set(_boost_flags "") CMAKE_ARGS
if (UNIX) -DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|wave|test
set(_boost_flags "cflags=-fPIC;cxxflags=-fPIC") -DBOOST_LOCALE_ENABLE_ICU:BOOL=OFF # do not link to libicu, breaks compatibility between distros
endif () -DBUILD_TESTING:BOOL=OFF
"${_context_abi_line}"
if(APPLE) "${_context_arch_line}"
set(_boost_flags
"cflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
"cxxflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
"mflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
"mmflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}")
endif()
set(_boost_variants "")
if(CMAKE_BUILD_TYPE)
list(APPEND CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
endif()
list(FIND CMAKE_CONFIGURATION_TYPES "Release" _cfg_rel)
list(FIND CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" _cfg_relwdeb)
list(FIND CMAKE_CONFIGURATION_TYPES "MinSizeRel" _cfg_minsizerel)
list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _cfg_deb)
if (_cfg_rel GREATER -1 OR _cfg_relwdeb GREATER -1 OR _cfg_minsizerel GREATER -1)
list(APPEND _boost_variants release)
endif()
if ( (NOT MSVC AND _cfg_deb GREATER -1) OR (MSVC AND ${DEP_DEBUG}) )
list(APPEND _boost_variants debug)
endif()
if (NOT _boost_variants)
set(_boost_variants release)
endif()
set(_build_cmd ${_build_cmd}
${_boost_flags}
-j${NPROC}
${_libs}
--layout=versioned
--debug-configuration
toolset=${_boost_toolset}
address-model=${_bits}
link=${_link}
threading=multi
boost.locale.icu=off
--disable-icu
${_boost_variants}
stage)
set(_install_cmd ${_build_cmd} --prefix=${_prefix} install)
list(APPEND _patch_command COMMAND git init && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-Boost-fix.patch)
ExternalProject_Add(
dep_Boost
#URL "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip"
URL "https://github.com/bambulab/boost/releases/download/1.78.0/boost_1_78_0.zip"
URL_HASH SHA256=f22143b5528e081123c3c5ed437e92f648fe69748e95fa6e2bd41484e2986cc3
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost
CONFIGURE_COMMAND "${_bootstrap_cmd}"
PATCH_COMMAND ${_patch_command}
BUILD_COMMAND "${_build_cmd}"
BUILD_IN_SOURCE ON
INSTALL_COMMAND "${_install_cmd}"
) )
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") set(DEP_Boost_DEPENDS ZLIB)
# Patch the boost::polygon library with a custom one.
ExternalProject_Add(dep_boost_polygon
EXCLUDE_FROM_ALL ON
# GIT_REPOSITORY "https://github.com/prusa3d/polygon"
# GIT_TAG prusaslicer_gmp
URL https://github.com/prusa3d/polygon/archive/refs/heads/prusaslicer_gmp.zip
URL_HASH SHA256=abeb9710f0a7069fb9b22181ae5c56f6066002f125db210e7ffb27032aed6824
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/boost_polygon
DEPENDS dep_Boost
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon"
"${DESTDIR}/usr/local/include/boost/polygon"
)
# Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms.
list(APPEND _dep_list "dep_boost_polygon")
endif ()

59
deps/CGAL/0001-clang19.patch vendored Normal file
View File

@@ -0,0 +1,59 @@
--- a/BGL/include/CGAL/boost/graph/iterator.h 2022-10-07 19:04:41 UTC
+++ b/BGL/include/CGAL/boost/graph/iterator.h
@@ -213,18 +213,7 @@ class Halfedge_around_source_iterator { (public)
{}
#ifndef DOXYGEN_RUNNING
- // design patter: "safe bool"
- // will be replaced by explicit operator bool with C++11
- typedef void (Halfedge_around_source_iterator::*bool_type)() const;
- void this_type_does_not_support_comparisons() const {}
-
- operator bool_type() const
- {
- return (! (this->base() == nullptr)) ?
- &Halfedge_around_source_iterator::this_type_does_not_support_comparisons : 0;
- }
-
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);
return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding);
@@ -313,18 +302,7 @@ class Halfedge_around_target_iterator { (public)
{}
#ifndef DOXYGEN_RUNNING
- // design patter: "safe bool"
- // will be replaced by explicit operator bool with C++11
- typedef void (Halfedge_around_target_iterator::*bool_type)() const;
- void this_type_does_not_support_comparisons() const {}
-
- operator bool_type() const
- {
- return (! (this->base() == nullptr)) ?
- &Halfedge_around_target_iterator::this_type_does_not_support_comparisons : 0;
- }
-
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);
return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding);
@@ -411,18 +389,6 @@ class Halfedge_around_face_iterator { (public)
const value_type& operator * ( ) const { return pos; }
pointer operator -> ( ) { return &pos; }
const value_type* operator -> ( ) const { return &pos; }
-
- // design patter: "safe bool"
- // will be replaced by explicit operator bool with C++11
- typedef void (Halfedge_around_face_iterator::*bool_type)() const;
-
- void this_type_does_not_support_comparisons() const {}
-
- operator bool_type() const
- {
- return (! (this->base() == nullptr)) ?
- &Halfedge_around_face_iterator::this_type_does_not_support_comparisons : 0;
- }
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);

View File

@@ -1,8 +1,5 @@
qidistudio_add_cmake_project( qidistudio_add_cmake_project(
CGAL CGAL
# GIT_REPOSITORY https://github.com/CGAL/cgal.git
# GIT_TAG caacd806dc55c61cc68adaad99f2240f00493b29 # releases/CGAL-5.3
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0 URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
DEPENDS ${BOOST_PKG} dep_GMP dep_MPFR DEPENDS ${BOOST_PKG} dep_GMP dep_MPFR

33
deps/CMakeLists.txt vendored
View File

@@ -27,6 +27,9 @@ include(ExternalProject)
include(ProcessorCount) include(ProcessorCount)
ProcessorCount(NPROC) ProcessorCount(NPROC)
if(DEFINED ENV{CMAKE_BUILD_PARALLEL_LEVEL})
set(NPROC $ENV{CMAKE_BUILD_PARALLEL_LEVEL})
endif()
if (NPROC EQUAL 0) if (NPROC EQUAL 0)
set(NPROC 1) set(NPROC 1)
endif () endif ()
@@ -50,6 +53,24 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF) option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
endif() endif()
set(IS_CROSS_COMPILE FALSE)
if (APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FIND_APPBUNDLE LAST)
list(FIND CMAKE_OSX_ARCHITECTURES ${CMAKE_SYSTEM_PROCESSOR} _arch_idx)
message(STATUS "qidistudio_add_cmake_project for Apple")
if (CMAKE_OSX_ARCHITECTURES AND _arch_idx LESS 0)
message(STATUS "qidistudio_add_cmake_project for Apple crosscompiling")
set(IS_CROSS_COMPILE TRUE)
set(CMAKE_CXX_COMPILER_ID "Clang")
string(REPLACE ";" "$<SEMICOLON>" CMAKE_OSX_ARCHS "${CMAKE_OSX_ARCHITECTURES}")
set(_cmake_osx_arch -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHS})
set(_cmake_args_osx_arch CMAKE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHS})
message(STATUS "Detect Cross-compilation. Will build for target ${CMAKE_OSX_ARCHS}" )
endif ()
endif ()
# On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL. # On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL.
# FIXME: # FIXME:
# Enabling this option is not safe. IGL will compile itself with its own version of Eigen while # Enabling this option is not safe. IGL will compile itself with its own version of Eigen while
@@ -72,6 +93,17 @@ 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 ()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
RESULT_VARIABLE REV_PARSE_RESULT
OUTPUT_VARIABLE REV_PARSE_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if((REV_PARSE_RESULT EQUAL 0) AND (REV_PARSE_OUTPUT STREQUAL "true"))
# Find relative path from root to source used for adjusting patch command
file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
endif ()
function(qidistudio_add_cmake_project projectname) function(qidistudio_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})
@@ -102,6 +134,7 @@ function(qidistudio_add_cmake_project projectname)
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
-DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF
${_cmake_osx_arch}
"${_configs_line}" "${_configs_line}"
${DEP_CMAKE_OPTS} ${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS} ${P_ARGS_CMAKE_ARGS}

View File

@@ -28,32 +28,58 @@ else ()
string(APPEND _extra_cmd "--enable-gpl") string(APPEND _extra_cmd "--enable-gpl")
string(APPEND _extra_cmd "--enable-nonfree") string(APPEND _extra_cmd "--enable-nonfree")
if (APPLE)
set(_minos_cmd
"CFLAGS=-mmacosx-version-min=${DEP_OSX_TARGET}"
"LDFLAGS=-mmacosx-version-min=${DEP_OSX_TARGET}"
)
if (IS_CROSS_COMPILE)
set(_cross_cmd --enable-cross-compile)
set(_pic_cmd --enable-pic)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
set(_arch_cmd --arch=arm64)
set(_cc_cmd "--cc=clang -arch arm64")
else()
set(_arch_cmd --arch=x86_64)
set(_cc_cmd "--cc=clang -arch x86_64")
endif()
endif()
endif()
set(_build_j -j)
if(DEFINED ENV{CMAKE_BUILD_PARALLEL_LEVEL})
set(_build_j "-j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}")
endif()
ExternalProject_Add(dep_FFMPEG ExternalProject_Add(dep_FFMPEG
URL https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n7.0.2.tar.gz URL https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n7.0.2.tar.gz
URL_HASH SHA256=5EB46D18D664A0CCADF7B0ADEE03BD3B7FA72893D667F36C69E202A807E6D533 URL_HASH SHA256=5EB46D18D664A0CCADF7B0ADEE03BD3B7FA72893D667F36C69E202A807E6D533
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/FFMPEG DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/FFMPEG
CONFIGURE_COMMAND ${_conf_cmd} CONFIGURE_COMMAND ${_conf_cmd}
"--prefix=${DESTDIR}/usr/local" ${_cross_cmd}
"--enable-shared" ${_pic_cmd}
"--disable-doc" ${_arch_cmd}
"--enable-small" ${_cc_cmd}
"--disable-outdevs" --prefix="${DESTDIR}/usr/local"
"--disable-filters" --enable-shared
"--enable-filter=*null*,afade,*fifo,*format,*resample,aeval,allrgb,allyuv,atempo,pan,*bars,color,*key,crop,draw*,eq*,framerate,*_qsv,*_vaapi,*v4l2*,hw*,scale,volume,test*" --disable-doc
"--disable-protocols" --enable-small
"--enable-protocol=file,fd,pipe,rtp,udp" --disable-outdevs
"--disable-muxers" --disable-filters
"--enable-muxer=rtp" --enable-filter=*null*,afade,*fifo,*format,*resample,aeval,allrgb,allyuv,atempo,pan,*bars,color,*key,crop,draw*,eq*,framerate,*_qsv,*_vaapi,*v4l2*,hw*,scale,volume,test*
"--disable-encoders" --disable-protocols
"--disable-decoders" --enable-protocol=file,fd,pipe,rtp,udp
"--enable-decoder=*aac*,h264*,mp3*,mjpeg,rv*" --disable-muxers
"--disable-demuxers" --enable-muxer=rtp
"--enable-demuxer=h264,mp3,mov" --disable-encoders
"--disable-zlib" --disable-decoders
"--disable-avdevice" --enable-decoder=*aac*,h264*,mp3*,mjpeg,rv*
--disable-demuxers
--enable-demuxer=h264,mp3,mov
--disable-zlib
--disable-avdevice
BUILD_IN_SOURCE ON BUILD_IN_SOURCE ON
BUILD_COMMAND make -j BUILD_COMMAND make ${_build_j}
INSTALL_COMMAND make install INSTALL_COMMAND make install
) )

View File

@@ -3,9 +3,12 @@ project(GLEW)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
if(OpenGL_EGL_FOUND) # we do not support wayland for now
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(OpenGL_EGL_FOUND)
message(STATUS "building GLEW for EGL (hope that wxWidgets agrees, otherwise you won't have any output!)") message(STATUS "building GLEW for EGL (hope that wxWidgets agrees, otherwise you won't have any output!)")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGLEW_EGL") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGLEW_EGL")
endif()
endif() endif()
add_library(GLEW src/glew.c) add_library(GLEW src/glew.c)

18
deps/GMP/GMP.cmake vendored
View File

@@ -22,10 +22,24 @@ else ()
if (APPLE) if (APPLE)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
set(_gmp_build_tgt aarch64) set(_gmp_build_arch aarch64)
else ()
set(_gmp_build_arch ${CMAKE_SYSTEM_PROCESSOR})
endif() endif()
if (IS_CROSS_COMPILE)
if (${CMAKE_OSX_ARCHITECTURES} MATCHES "arm")
set(_gmp_host_arch aarch64)
set(_gmp_host_arch_flags "-arch arm64")
elseif (${CMAKE_OSX_ARCHITECTURES} MATCHES "x86_64")
set(_gmp_host_arch x86_64)
set(_gmp_host_arch_flags "-arch x86_64")
endif()
set(_gmp_ccflags "${_gmp_ccflags} ${_gmp_host_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET}")
set(_gmp_build_tgt --build=${_gmp_build_arch}-apple-darwin --host=${_gmp_host_arch}-apple-darwin)
else ()
set(_gmp_ccflags "${_gmp_ccflags} -mmacosx-version-min=${DEP_OSX_TARGET}") set(_gmp_ccflags "${_gmp_ccflags} -mmacosx-version-min=${DEP_OSX_TARGET}")
set(_gmp_build_tgt "--build=${_gmp_build_tgt}-apple-darwin") set(_gmp_build_tgt "--build=${_gmp_build_arch}-apple-darwin")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
set(_gmp_ccflags "${_gmp_ccflags} -march=armv7-a") # Works on RPi-4 set(_gmp_ccflags "${_gmp_ccflags} -march=armv7-a") # Works on RPi-4

View File

@@ -12,8 +12,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif() endif()
qidistudio_add_cmake_project(JPEG qidistudio_add_cmake_project(JPEG
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/2.0.6.zip URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.0.1.zip
URL_HASH SHA256=017bdc33ff3a72e11301c0feb4657cb27719d7f97fa67a78ed506c594218bbf1 URL_HASH SHA256=d6d99e693366bc03897677650e8b2dfa76b5d6c54e2c9e70c03f0af821b0a52f
DEPENDS ${ZLIB_PKG} DEPENDS ${ZLIB_PKG}
CMAKE_ARGS CMAKE_ARGS
-DENABLE_SHARED=OFF -DENABLE_SHARED=OFF

View File

@@ -4,11 +4,14 @@ else()
set(library_build_type "Static") set(library_build_type "Static")
endif() endif()
if (BINARY_DIR_REL)
set(OCCT_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT)
endif ()
qidistudio_add_cmake_project(OCCT qidistudio_add_cmake_project(OCCT
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip
URL_HASH SHA256=28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc URL_HASH SHA256=28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
PATCH_COMMAND ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
#DEPENDS dep_Boost #DEPENDS dep_Boost
#DEPENDS dep_FREETYPE #DEPENDS dep_FREETYPE
CMAKE_ARGS CMAKE_ARGS

24
deps/OpenCV/0002-clang19-macos.patch vendored Normal file
View File

@@ -0,0 +1,24 @@
diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h
index 583c26f..83e0ab8 100644
--- a/3rdparty/libpng/pngpriv.h
+++ b/3rdparty/libpng/pngpriv.h
@@ -517,18 +517,7 @@
*/
# include <float.h>
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
- * as it seems it doesn't agree with <fp.h>, yet we should really use
- * <fp.h> if possible.
- */
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
-# include <fp.h>
-# endif
-# else
-# include <math.h>
-# endif
+# include <math.h>
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881

View File

@@ -4,10 +4,14 @@ else ()
set(_use_IPP "-DWITH_IPP=OFF") set(_use_IPP "-DWITH_IPP=OFF")
endif () endif ()
if (BINARY_DIR_REL)
set(OpenCV_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV)
endif ()
qidistudio_add_cmake_project(OpenCV qidistudio_add_cmake_project(OpenCV
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277 URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
PATCH_COMMAND ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OpenCV-fix.patch PATCH_COMMAND git apply ${OpenCV_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OpenCV-fix.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
CMAKE_ARGS CMAKE_ARGS
-DBUILD_SHARED_LIBS=0 -DBUILD_SHARED_LIBS=0
-DBUILD_PERE_TESTS=OFF -DBUILD_PERE_TESTS=OFF

View File

@@ -1,3 +1,32 @@
if (APPLE AND IS_CROSS_COMPILE)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" AND ${CMAKE_OSX_ARCHITECTURES} MATCHES "arm")
set(_openexr_arch arm64^^x86_64)
set(_openxr_list_sep LIST_SEPARATOR ^^)
set(_cmake_openexr_arch -DCMAKE_OSX_ARCHITECTURES:STRING=${_openexr_arch})
else()
set(_openexr_arch ${CMAKE_OSX_ARCHITECTURES})
set(_cmake_openexr_arch -DCMAKE_OSX_ARCHITECTURES:STRING=${_openexr_arch})
endif()
ExternalProject_Add(dep_OpenEXR
EXCLUDE_FROM_ALL ON
URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
INSTALL_DIR ${DESTDIR}/usr/local
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenEXR
${_openxr_list_sep}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DBUILD_TESTING=OFF
-DPYILMBASE_ENABLE:BOOL=OFF
-DOPENEXR_VIEWERS_ENABLE:BOOL=OFF
-DOPENEXR_BUILD_UTILS:BOOL=OFF
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEP_OSX_TARGET}
${_cmake_openexr_arch}
)
else()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_patch_cmd ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OpenEXR-GCC13.patch) set(_patch_cmd ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OpenEXR-GCC13.patch)
else() else()
@@ -18,7 +47,7 @@ qidistudio_add_cmake_project(OpenEXR
-DOPENEXR_VIEWERS_ENABLE:BOOL=OFF -DOPENEXR_VIEWERS_ENABLE:BOOL=OFF
-DOPENEXR_BUILD_UTILS:BOOL=OFF -DOPENEXR_BUILD_UTILS:BOOL=OFF
) )
endif()
if (MSVC) if (MSVC)
add_debug_dep(dep_OpenEXR) add_debug_dep(dep_OpenEXR)
endif () endif ()

View File

@@ -19,7 +19,7 @@ if(WIN32)
set(_install_cmd nmake install_sw ) set(_install_cmd nmake install_sw )
else() else()
if(APPLE) if(APPLE)
set(_conf_cmd ./Configure ) set(_conf_cmd export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} && ./Configure -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} )
else() else()
set(_conf_cmd "./config") set(_conf_cmd "./config")
endif() endif()

31
deps/OpenVDB/0001-clang19.patch vendored Normal file
View File

@@ -0,0 +1,31 @@
diff --git a/openvdb/openvdb/tree/NodeManager.h b/openvdb/openvdb/tree/NodeManager.h
index 4d0d9b4..12dabaa 100644
--- a/openvdb/openvdb/tree/NodeManager.h
+++ b/openvdb/openvdb/tree/NodeManager.h
@@ -327,7 +327,7 @@ private:
void operator()(const NodeRange& range) const
{
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
- OpT::template eval(mNodeOp, it);
+ OpT::eval(mNodeOp, it);
}
}
const NodeOp mNodeOp;
@@ -347,7 +347,7 @@ private:
void operator()(const NodeRange& range) const
{
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
- OpT::template eval(mNodeOp, it);
+ OpT::eval(mNodeOp, it);
}
}
const NodeOp& mNodeOp;
@@ -372,7 +372,7 @@ private:
void operator()(const NodeRange& range)
{
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
- OpT::template eval(*mNodeOp, it);
+ OpT::eval(*mNodeOp, it);
}
}
void join(const NodeReducer& other)

View File

@@ -6,6 +6,10 @@ else()
set(_build_static ON) set(_build_static ON)
endif() endif()
if (BINARY_DIR_REL)
set(OPENVDB_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenVDB-prefix/src/dep_OpenVDB)
endif ()
set (_openvdb_vdbprint ON) set (_openvdb_vdbprint ON)
#if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") #if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
# Build fails on raspberry pi due to missing link directive to latomic # Build fails on raspberry pi due to missing link directive to latomic
@@ -15,6 +19,7 @@ set (_openvdb_vdbprint ON)
qidistudio_add_cmake_project(OpenVDB qidistudio_add_cmake_project(OpenVDB
URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip # 8.2 patched URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip # 8.2 patched
URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81 URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
PATCH_COMMAND git apply ${OPENVDB_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-clang19.patch
# URL https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v10.0.1.zip # URL https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v10.0.1.zip
# URL_HASH SHA256=48C2CFA9853B58FA86282DF1F83F0E99D07858CC03EB2BA8227DC447A830100A # URL_HASH SHA256=48C2CFA9853B58FA86282DF1F83F0E99D07858CC03EB2BA8227DC447A830100A
DEPENDS dep_TBB dep_Blosc dep_OpenEXR ${BOOST_PKG} DEPENDS dep_TBB dep_Blosc dep_OpenEXR ${BOOST_PKG}

29
deps/PNG/0002-clang19-macos.patch vendored Normal file
View File

@@ -0,0 +1,29 @@
--- a/pngpriv.h 2025-04-20 19:36:04.000000000
+++ b/pngpriv.h 2025-04-20 19:35:55.000000000
@@ -511,24 +511,14 @@
* DBL_DIG Maximum number of decimal digits (can be set to any constant)
* DBL_MIN Smallest normalized fp number (can be set to an arbitrary value)
* DBL_MAX Maximum floating point number (can be set to an arbitrary value)
*/
# include <float.h>
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
- * as it seems it doesn't agree with <fp.h>, yet we should really use
- * <fp.h> if possible.
- */
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
-# include <fp.h>
-# endif
-# else
-# include <math.h>
-# endif
+# include <math.h>
+
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881
*/
# include <m68881.h>
# endif

27
deps/PNG/PNG.cmake vendored
View File

@@ -5,12 +5,28 @@ else ()
set(_disable_neon_extension "") set(_disable_neon_extension "")
endif () endif ()
if(APPLE AND IS_CROSS_COMPILE)
# TODO: check if it doesn't create problem when compiling from arm to x86_64
qidistudio_add_cmake_project(PNG
GIT_REPOSITORY https://github.com/glennrp/libpng.git
GIT_TAG v1.6.35
DEPENDS ${ZLIB_PKG}
PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/macos-arm64.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
CMAKE_ARGS
-DPNG_SHARED=OFF
-DPNG_STATIC=ON
-DPNG_PREFIX=prusaslicer_
-DPNG_TESTS=OFF
-DDISABLE_DEPENDENCY_TRACKING=OFF
${_disable_neon_extension}
)
else ()
set(_patch_step "") set(_patch_step "")
if (APPLE) if (APPLE)
set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch) set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch)
endif () endif ()
qidistudio_add_cmake_project(PNG
qidistudio_add_cmake_project(PNG
# GIT_REPOSITORY https://github.com/glennrp/libpng.git # GIT_REPOSITORY https://github.com/glennrp/libpng.git
# GIT_TAG v1.6.35 # GIT_TAG v1.6.35
URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip
@@ -25,6 +41,7 @@ qidistudio_add_cmake_project(PNG
-DDISABLE_DEPENDENCY_TRACKING=OFF -DDISABLE_DEPENDENCY_TRACKING=OFF
${_disable_neon_extension} ${_disable_neon_extension}
) )
endif()
if (MSVC) if (MSVC)
add_debug_dep(dep_PNG) add_debug_dep(dep_PNG)

90
deps/PNG/macos-arm64.patch vendored Normal file
View File

@@ -0,0 +1,90 @@
Based on https://github.com/vespakoen/libpng to work around until
https://github.com/glennrp/libpng/pull/354 is resolved.
also added patch from PS2.4 (PNG.pach) in pngrutil.c
---
CMakeLists.txt | 28 ++++++++++++++++++++--------
pngrutil.c | 7 -------
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4db9bb87d..9099d1edf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,10 +82,22 @@ option(PNG_HARDWARE_OPTIMIZATIONS "Enable Hardware Optimizations" ON)
set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names")
set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
+# CMake currently sets CMAKE_SYSTEM_PROCESSOR to one of x86_64 or arm64 on macOS,
+# based upon the OS architecture, not the target architecture. As such, we need
+# to check CMAKE_OSX_ARCHITECTURES to identify which hardware-specific flags to
+# enable. Note that this will fail if you attempt to build a universal binary in
+# a single cmake invokation.
+if (APPLE AND CMAKE_OSX_ARCHITECTURES)
+ set(TARGET_ARCH ${CMAKE_OSX_ARCHITECTURES})
+else()
+ set(TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
+endif()
+
+
if(PNG_HARDWARE_OPTIMIZATIONS)
# set definitions and sources for arm
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
+if(TARGET_ARCH MATCHES "^arm" OR
+ TARGET_ARCH MATCHES "^aarch64")
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations:
check: (default) use internal checking code;
@@ -114,8 +126,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
endif()
# set definitions and sources for powerpc
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*" )
+if(TARGET_ARCH MATCHES "^powerpc*" OR
+ TARGET_ARCH MATCHES "^ppc64*" )
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
set(PNG_POWERPC_VSX "on" CACHE STRING "Enable POWERPC VSX optimizations:
off: disable the optimizations.")
@@ -138,8 +150,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
endif()
# set definitions and sources for intel
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*" )
+if(TARGET_ARCH MATCHES "^i?86" OR
+ TARGET_ARCH MATCHES "^x86_64*" )
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations:
off: disable the optimizations")
@@ -162,8 +174,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
endif()
# set definitions and sources for MIPS
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
- CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*" )
+if(TARGET_ARCH MATCHES "mipsel*" OR
+ TARGET_ARCH MATCHES "mips64el*" )
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
set(PNG_MIPS_MSA "on" CACHE STRING "Enable MIPS_MSA optimizations:
off: disable the optimizations")
diff --git a/pngrutil.c b/pngrutil.c
index 7001f1976..91930f1f2 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -422,13 +422,6 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
}
-#if ZLIB_VERNUM >= 0x1290 && \
- defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
- if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
- /* Turn off validation of the ADLER32 checksum in IDAT chunks */
- ret = inflateValidate(&png_ptr->zstream, 0);
-#endif
-
if (ret == Z_OK)
png_ptr->zowner = owner;
--
2.33.0.windows.1

View File

@@ -6,8 +6,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif () endif ()
set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}") set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}")
set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=1") set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=1")
set(_wx_egl "-DwxUSE_GLCANVAS_EGL=OFF")
else () else ()
set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=0") set(_wx_egl "")
endif() endif()
if (MSVC) if (MSVC)
@@ -52,6 +53,7 @@ qidistudio_add_cmake_project(wxWidgets
-DwxUSE_LIBJPEG=sys -DwxUSE_LIBJPEG=sys
-DwxUSE_LIBTIFF=sys -DwxUSE_LIBTIFF=sys
-DwxUSE_EXPAT=sys -DwxUSE_EXPAT=sys
${_wx_egl}
) )
if (MSVC) if (MSVC)

View File

@@ -30,6 +30,7 @@ REQUIRED_DEV_PACKAGES=(
nasm nasm
yasm yasm
libx264-dev libx264-dev
libbz2-dev
) )
if [[ -n "$UPDATE_LIB" ]] if [[ -n "$UPDATE_LIB" ]]

View File

@@ -38,6 +38,7 @@ REQUIRED_DEV_PACKAGES=(
nasm nasm
yasm yasm
x264-devel x264-devel
bzip2-devel
) )
if [[ -n "$UPDATE_LIB" ]] if [[ -n "$UPDATE_LIB" ]]