mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-11 16:09:01 +08:00
Followup fully converted deps to new system
Support legacy DEP_DEBUG parameter but respecting parent CMake generator
This commit is contained in:
parent
3fba2bc140
commit
03451c39e2
@ -1,7 +1,3 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2021 Tomáš Mészáros @tamasmeszaros
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
set(_build_shared ON)
|
set(_build_shared ON)
|
||||||
set(_build_static OFF)
|
set(_build_static OFF)
|
||||||
@ -15,7 +11,6 @@ add_cmake_project(Blosc
|
|||||||
#URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
|
#URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
|
||||||
URL https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip
|
URL https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip
|
||||||
URL_HASH SHA256=dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3
|
URL_HASH SHA256=dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3
|
||||||
DEPENDS ${ZLIB_PKG}
|
|
||||||
# Patching upstream does not work this way with git version 2.28 installed on mac worker
|
# Patching upstream does not work this way with git version 2.28 installed on mac worker
|
||||||
# PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch
|
# PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
@ -26,3 +21,5 @@ add_cmake_project(Blosc
|
|||||||
-DBUILD_BENCHMARKS=OFF
|
-DBUILD_BENCHMARKS=OFF
|
||||||
-DPREFER_EXTERNAL_ZLIB=ON
|
-DPREFER_EXTERNAL_ZLIB=ON
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(DEP_Blosc_DEPENDS ZLIB)
|
2
deps/+Boost/Boost.cmake
vendored
2
deps/+Boost/Boost.cmake
vendored
@ -3,6 +3,6 @@ add_cmake_project(Boost
|
|||||||
URL_HASH SHA256=200f9292b5ef957ab551a648834239f502df165cb7bff18432702fb7ae98accb
|
URL_HASH SHA256=200f9292b5ef957ab551a648834239f502df165cb7bff18432702fb7ae98accb
|
||||||
LIST_SEPARATOR |
|
LIST_SEPARATOR |
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
-DBOOST_INCLUDE_LIBRARIES:STRING=system|iostreams|filesystem|thread|log|locale|regex|date_time|beast|nowide|polygon
|
-DBOOST_INCLUDE_LIBRARIES:STRING=system|iostreams|filesystem|thread|log|locale|regex|date_time|beast|nowide|polygon|uuid
|
||||||
-DBUILD_TESTING:BOOL=OFF
|
-DBUILD_TESTING:BOOL=OFF
|
||||||
)
|
)
|
9
deps/CGAL/CGAL.cmake → deps/+CGAL/CGAL.cmake
vendored
9
deps/CGAL/CGAL.cmake → deps/+CGAL/CGAL.cmake
vendored
@ -1,15 +1,12 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2019 - 2022 Tomáš Mészáros @tamasmeszaros, Filip Sykala @Jony01, Vojtěch Bubník @bubnikv, David Kocík @kocikdav
|
add_cmake_project(
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
prusaslicer_add_cmake_project(
|
|
||||||
CGAL
|
CGAL
|
||||||
# GIT_REPOSITORY https://github.com/CGAL/cgal.git
|
# GIT_REPOSITORY https://github.com/CGAL/cgal.git
|
||||||
# GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0
|
# GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0
|
||||||
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
|
# 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 dep_Boost dep_GMP dep_MPFR
|
|
||||||
)
|
)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
set(DEP_CGAL_DEPENDS Boost GMP MPFR)
|
8
deps/+GLEW/GLEW.cmake
vendored
Normal file
8
deps/+GLEW/GLEW.cmake
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
add_cmake_project(
|
||||||
|
GLEW
|
||||||
|
URL https://sourceforge.net/projects/glew/files/glew/2.2.0/glew-2.2.0.zip
|
||||||
|
URL_HASH SHA256=a9046a913774395a095edcc0b0ac2d81c3aacca61787b39839b941e9be14e0d4
|
||||||
|
SOURCE_SUBDIR build/cmake
|
||||||
|
CMAKE_ARGS
|
||||||
|
-DBUILD_UTILS=OFF
|
||||||
|
)
|
7
deps/GMP/GMP.cmake → deps/+GMP/GMP.cmake
vendored
7
deps/GMP/GMP.cmake → deps/+GMP/GMP.cmake
vendored
@ -1,7 +1,3 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2019 - 2021 Tomáš Mészáros @tamasmeszaros, David Kocík @kocikdav
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
|
|
||||||
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp)
|
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp)
|
||||||
set(_dstdir ${DESTDIR}/usr/local)
|
set(_dstdir ${DESTDIR}/usr/local)
|
||||||
@ -21,7 +17,8 @@ if (MSVC)
|
|||||||
add_custom_target(dep_GMP SOURCES ${_output})
|
add_custom_target(dep_GMP SOURCES ${_output})
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
set(_gmp_ccflags "-O2 -DNDEBUG -fPIC -DPIC -Wall -Wmissing-prototypes -Wpointer-arith -pedantic -fomit-frame-pointer -fno-common")
|
string(TOUPPER ${CMAKE_BUILD_TYPE} _buildtype_upper)
|
||||||
|
set(_gmp_ccflags "${CMAKE_CXX_FLAGS}_${_buildtype_upper} -fPIC -DPIC -Wall -Wmissing-prototypes -Wpointer-arith -pedantic -fomit-frame-pointer -fno-common")
|
||||||
set(_gmp_build_tgt "${CMAKE_SYSTEM_PROCESSOR}")
|
set(_gmp_build_tgt "${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
7
deps/MPFR/MPFR.cmake → deps/+MPFR/MPFR.cmake
vendored
7
deps/MPFR/MPFR.cmake → deps/+MPFR/MPFR.cmake
vendored
@ -1,7 +1,3 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2019 - 2021 Tomáš Mészáros @tamasmeszaros
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
|
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
|
||||||
set(_dstdir ${DESTDIR}/usr/local)
|
set(_dstdir ${DESTDIR}/usr/local)
|
||||||
|
|
||||||
@ -37,6 +33,7 @@ else ()
|
|||||||
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
|
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
|
||||||
BUILD_COMMAND make -j
|
BUILD_COMMAND make -j
|
||||||
INSTALL_COMMAND make install
|
INSTALL_COMMAND make install
|
||||||
DEPENDS dep_GMP
|
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
set(DEP_MPFR_DEPENDS GMP)
|
10
deps/NLopt/NLopt.cmake → deps/+NLopt/NLopt.cmake
vendored
10
deps/NLopt/NLopt.cmake → deps/+NLopt/NLopt.cmake
vendored
@ -1,8 +1,4 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2021 Tomáš Mészáros @tamasmeszaros
|
add_cmake_project(NLopt
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
prusaslicer_add_cmake_project(NLopt
|
|
||||||
URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
|
URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
|
||||||
URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
|
URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
@ -13,7 +9,3 @@ prusaslicer_add_cmake_project(NLopt
|
|||||||
-DNLOPT_SWIG:BOOL=OFF
|
-DNLOPT_SWIG:BOOL=OFF
|
||||||
-DNLOPT_TESTS:BOOL=OFF
|
-DNLOPT_TESTS:BOOL=OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_debug_dep(dep_NLopt)
|
|
||||||
endif ()
|
|
10
deps/OCCT/OCCT.cmake → deps/+OCCT/OCCT.cmake
vendored
10
deps/OCCT/OCCT.cmake → deps/+OCCT/OCCT.cmake
vendored
@ -1,8 +1,4 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2022 Tomáš Mészáros @tamasmeszaros
|
add_cmake_project(OCCT
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
prusaslicer_add_cmake_project(OCCT
|
|
||||||
#LMBBS: changed version to 7.6.2
|
#LMBBS: changed version to 7.6.2
|
||||||
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_2.zip
|
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_2.zip
|
||||||
URL_HASH SHA256=c696b923593e8c18d059709717dbf155b3e72fdd283c8522047a790ec3a432c5
|
URL_HASH SHA256=c696b923593e8c18d059709717dbf155b3e72fdd283c8522047a790ec3a432c5
|
||||||
@ -25,7 +21,3 @@ prusaslicer_add_cmake_project(OCCT
|
|||||||
-DBUILD_MODULE_ModelingData=OFF
|
-DBUILD_MODULE_ModelingData=OFF
|
||||||
-DBUILD_MODULE_Visualization=OFF
|
-DBUILD_MODULE_Visualization=OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_debug_dep(dep_OCCT)
|
|
||||||
endif ()
|
|
9
deps/+OpenCSG/OpenCSG.cmake
vendored
Normal file
9
deps/+OpenCSG/OpenCSG.cmake
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
add_cmake_project(OpenCSG
|
||||||
|
URL https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip
|
||||||
|
URL_HASH SHA256=51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5
|
||||||
|
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt
|
||||||
|
DEPENDS dep_GLEW
|
||||||
|
)
|
||||||
|
|
||||||
|
set(DEP_OpenCSG_DEPENDS ZLIB)
|
@ -1,13 +1,7 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2021 - 2023 Lukáš Matěna @lukasmatena, Tomáš Mészáros @tamasmeszaros
|
add_cmake_project(OpenEXR
|
||||||
#/|/ Copyright (c) 2023 Robert Schiele @schiele
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
prusaslicer_add_cmake_project(OpenEXR
|
|
||||||
# GIT_REPOSITORY https://github.com/openexr/openexr.git
|
# GIT_REPOSITORY https://github.com/openexr/openexr.git
|
||||||
URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
|
URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
|
||||||
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
|
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
|
||||||
DEPENDS ${ZLIB_PKG}
|
|
||||||
GIT_TAG v2.5.5
|
GIT_TAG v2.5.5
|
||||||
PATCH_COMMAND COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/OpenEXR.patch
|
PATCH_COMMAND COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/OpenEXR.patch
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
@ -18,6 +12,4 @@ prusaslicer_add_cmake_project(OpenEXR
|
|||||||
-DOPENEXR_BUILD_UTILS:BOOL=OFF
|
-DOPENEXR_BUILD_UTILS:BOOL=OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
if (MSVC)
|
set(DEP_OpenEXR_DEPENDS ZLIB)
|
||||||
add_debug_dep(dep_OpenEXR)
|
|
||||||
endif ()
|
|
@ -1,7 +1,3 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2021 - 2022 Tomáš Mészáros @tamasmeszaros, Filip Sykala @Jony01
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
set(_build_shared ON)
|
set(_build_shared ON)
|
||||||
set(_build_static OFF)
|
set(_build_static OFF)
|
||||||
@ -11,17 +7,16 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (_openvdb_vdbprint ON)
|
set (_openvdb_vdbprint ON)
|
||||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_BUILD_TYPE} STREQUAL Debug)
|
||||||
# Build fails on raspberry pi due to missing link directive to latomic
|
# Build fails on raspberry pi due to missing link directive to latomic
|
||||||
# Let's hope it will be fixed soon.
|
# Let's hope it will be fixed soon.
|
||||||
set (_openvdb_vdbprint OFF)
|
set (_openvdb_vdbprint OFF)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
prusaslicer_add_cmake_project(OpenVDB
|
add_cmake_project(OpenVDB
|
||||||
# 8.2 patched
|
# 8.2 patched
|
||||||
URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
|
URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
|
||||||
URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
|
URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
|
||||||
DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost
|
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||||
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
|
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
|
||||||
@ -34,15 +29,4 @@ prusaslicer_add_cmake_project(OpenVDB
|
|||||||
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON # Centos6 has old zlib
|
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON # Centos6 has old zlib
|
||||||
)
|
)
|
||||||
|
|
||||||
if (MSVC)
|
set(DEP_OpenVDB_DEPENDS TBB Blosc OpenEXR Boost)
|
||||||
if (${DEP_DEBUG})
|
|
||||||
ExternalProject_Get_Property(dep_OpenVDB BINARY_DIR)
|
|
||||||
ExternalProject_Add_Step(dep_OpenVDB build_debug
|
|
||||||
DEPENDEES build
|
|
||||||
DEPENDERS install
|
|
||||||
COMMAND ${CMAKE_COMMAND} ../dep_OpenVDB -DOPENVDB_BUILD_VDB_PRINT=OFF
|
|
||||||
COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj
|
|
||||||
WORKING_DIRECTORY "${BINARY_DIR}"
|
|
||||||
)
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
10
deps/Qhull/Qhull.cmake → deps/+Qhull/Qhull.cmake
vendored
10
deps/Qhull/Qhull.cmake → deps/+Qhull/Qhull.cmake
vendored
@ -1,15 +1,7 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2021 Tomáš Mészáros @tamasmeszaros
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
prusaslicer_add_cmake_project(Qhull
|
add_cmake_project(Qhull
|
||||||
URL "https://github.com/qhull/qhull/archive/v8.0.1.zip"
|
URL "https://github.com/qhull/qhull/archive/v8.0.1.zip"
|
||||||
URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b
|
URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
-DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR}
|
-DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_debug_dep(dep_Qhull)
|
|
||||||
endif ()
|
|
10
deps/TBB/TBB.cmake → deps/+TBB/TBB.cmake
vendored
10
deps/TBB/TBB.cmake → deps/+TBB/TBB.cmake
vendored
@ -1,8 +1,4 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2021 - 2022 Tomáš Mészáros @tamasmeszaros, Filip Sykala @Jony01
|
add_cmake_project(
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
prusaslicer_add_cmake_project(
|
|
||||||
TBB
|
TBB
|
||||||
URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip"
|
URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip"
|
||||||
URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
|
URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
|
||||||
@ -13,8 +9,4 @@ prusaslicer_add_cmake_project(
|
|||||||
-DCMAKE_DEBUG_POSTFIX=_debug
|
-DCMAKE_DEBUG_POSTFIX=_debug
|
||||||
)
|
)
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_debug_dep(dep_TBB)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
|
|
75
deps/CMakeLists.txt
vendored
75
deps/CMakeLists.txt
vendored
@ -26,9 +26,8 @@
|
|||||||
cmake_minimum_required(VERSION 3.12)
|
cmake_minimum_required(VERSION 3.12)
|
||||||
project(PrusaSlicer_deps)
|
project(PrusaSlicer_deps)
|
||||||
|
|
||||||
# Always ON options:
|
if (MSVC)
|
||||||
if (NOT MSVC)
|
option(DEP_DEBUG "Build in debug version of packages automatically" OFF)
|
||||||
set(DEP_CMAKE_OPTS "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
||||||
@ -51,6 +50,27 @@ macro(list_projects result curdir)
|
|||||||
set(${result} ${dirlist})
|
set(${result} ${dirlist})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
function(dep_message mode msg)
|
||||||
|
if (NOT DEP_MESSAGES_WRITTEN)
|
||||||
|
message(${mode} "${msg}")
|
||||||
|
endif()
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
# Always ON options:
|
||||||
|
if (MSVC)
|
||||||
|
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||||
|
dep_message(STATUS "Detected 64-bit compiler => building 64-bit deps bundle")
|
||||||
|
set(DEPS_BITS 64)
|
||||||
|
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||||
|
dep_message(STATUS "Detected 32-bit compiler => building 32-bit deps bundle")
|
||||||
|
set(DEPS_BITS 32)
|
||||||
|
else ()
|
||||||
|
dep_message(FATAL_ERROR "Unable to detect architecture!")
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
set(DEP_CMAKE_OPTS "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# This ensures dependencies don't use SDK features which are not available in the version specified by Deployment target
|
# This ensures dependencies don't use SDK features which are not available in the version specified by Deployment target
|
||||||
# That can happen when one uses a recent SDK but specifies an older Deployment target
|
# That can happen when one uses a recent SDK but specifies an older Deployment target
|
||||||
@ -68,7 +88,8 @@ if (APPLE)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
list_projects(SUPPORTED_PACKAGES ${CMAKE_CURRENT_LIST_DIR})
|
list_projects(SUPPORTED_PACKAGES ${CMAKE_CURRENT_LIST_DIR})
|
||||||
message(STATUS "Found external package definitions: ${SUPPORTED_PACKAGES}")
|
|
||||||
|
dep_message(STATUS "Found external package definitions: ${SUPPORTED_PACKAGES}")
|
||||||
|
|
||||||
set(REQUIRED_PACKAGES
|
set(REQUIRED_PACKAGES
|
||||||
Boost
|
Boost
|
||||||
@ -76,7 +97,14 @@ set(REQUIRED_PACKAGES
|
|||||||
Cereal
|
Cereal
|
||||||
CURL
|
CURL
|
||||||
EXPAT
|
EXPAT
|
||||||
|
NLopt
|
||||||
|
GLEW
|
||||||
|
TBB
|
||||||
|
Qhull
|
||||||
wxWidgets
|
wxWidgets
|
||||||
|
OpenVDB
|
||||||
|
CGAL
|
||||||
|
OCCT
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SYSTEM_PROVIDED_PACKAGES OpenGL)
|
set(SYSTEM_PROVIDED_PACKAGES OpenGL)
|
||||||
@ -112,24 +140,55 @@ foreach (pkg ${SUPPORTED_PACKAGES})
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Establish dependency graph
|
# Establish dependency graph
|
||||||
foreach (pkg ${REQUIRED_PACKAGES})
|
foreach (pkg ${SUPPORTED_PACKAGES})
|
||||||
foreach(deppkg ${DEP_${pkg}_DEPENDS})
|
foreach(deppkg ${DEP_${pkg}_DEPENDS})
|
||||||
if (${deppkg} IN_LIST SYSTEM_PROVIDED_PACKAGES)
|
if (${deppkg} IN_LIST SYSTEM_PROVIDED_PACKAGES)
|
||||||
find_package(${deppkg} QUIET)
|
find_package(${deppkg} QUIET)
|
||||||
if (NOT ${deppkg}_FOUND)
|
if (NOT ${deppkg}_FOUND)
|
||||||
message(WARNING "No ${deppkg} found in system altough marked as system provided. This might cause trouble building the dependencies on this platform")
|
dep_message(WARNING "No ${deppkg} found in system altough marked as system provided. This might cause trouble building the dependencies on this platform")
|
||||||
endif ()
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
message(STATUS "Mapping dep_${deppkg} => dep_${pkg}")
|
dep_message(STATUS "Mapping dep_${deppkg} => dep_${pkg}")
|
||||||
add_dependencies(dep_${pkg} dep_${deppkg})
|
add_dependencies(dep_${pkg} dep_${deppkg})
|
||||||
|
if (${pkg} IN_LIST REQUIRED_PACKAGES)
|
||||||
list(APPEND _build_list dep_${deppkg})
|
list(APPEND _build_list dep_${deppkg})
|
||||||
endif ()
|
endif ()
|
||||||
|
endif ()
|
||||||
endforeach()
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
list(APPEND _build_list ${_dep_list})
|
list(APPEND _build_list ${_dep_list})
|
||||||
list(REMOVE_DUPLICATES _build_list)
|
list(REMOVE_DUPLICATES _build_list)
|
||||||
message(STATUS "Building dep targets: ${_build_list}")
|
dep_message(STATUS "Building dep targets (${CMAKE_BUILD_TYPE}): ${_build_list}")
|
||||||
add_custom_target(deps ALL DEPENDS ${_dep_list})
|
add_custom_target(deps ALL DEPENDS ${_dep_list})
|
||||||
|
|
||||||
|
# Support legacy option DEP_DEBUG on MSVC to build debug libraries in the same cmake run as for Release:
|
||||||
|
if (DEP_DEBUG AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(_build_list_dbg "")
|
||||||
|
foreach (t ${_build_list})
|
||||||
|
list(APPEND _build_list_dbg ${t}_debug)
|
||||||
|
endforeach()
|
||||||
|
dep_message(STATUS "Building dep targets (Debug): ${_build_list_dbg}")
|
||||||
|
|
||||||
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DebugBuild)
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -G${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=Debug -DDEP_DOWNLOAD_DIR=${DEP_DOWNLOAD_DIR} -DDESTDIR=${DESTDIR} -DDEP_MESSAGES_WRITTEN=ON
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DebugBuild
|
||||||
|
)
|
||||||
|
|
||||||
|
# Can be used to build only the debug libs
|
||||||
|
add_custom_target(deps_debug ALL)
|
||||||
|
|
||||||
|
# Each lib will have a dep_<package>_debug target to build only the debug counterpart
|
||||||
|
foreach(pkgtgt ${_build_list})
|
||||||
|
add_custom_target(${pkgtgt}_debug
|
||||||
|
COMMAND ${CMAKE_COMMAND} --build . --target ${pkgtgt}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DebugBuild
|
||||||
|
)
|
||||||
|
add_dependencies(deps_debug ${pkgtgt}_debug)
|
||||||
|
endforeach()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(DEP_MESSAGES_WRITTEN ON CACHE BOOL "")
|
||||||
|
|
||||||
install(CODE "message(STATUS \"Built packages succesfully.\")")
|
install(CODE "message(STATUS \"Built packages succesfully.\")")
|
20
deps/GLEW/GLEW.cmake
vendored
20
deps/GLEW/GLEW.cmake
vendored
@ -1,20 +0,0 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2019 - 2022 Tomáš Mészáros @tamasmeszaros, Filip Sykala @Jony01
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
# We have to check for OpenGL to compile GLEW
|
|
||||||
set(OpenGL_GL_PREFERENCE "LEGACY") # to prevent a nasty warning by cmake
|
|
||||||
find_package(OpenGL QUIET REQUIRED)
|
|
||||||
|
|
||||||
prusaslicer_add_cmake_project(
|
|
||||||
GLEW
|
|
||||||
URL https://sourceforge.net/projects/glew/files/glew/2.2.0/glew-2.2.0.zip
|
|
||||||
URL_HASH SHA256=a9046a913774395a095edcc0b0ac2d81c3aacca61787b39839b941e9be14e0d4
|
|
||||||
SOURCE_SUBDIR build/cmake
|
|
||||||
CMAKE_ARGS
|
|
||||||
-DBUILD_UTILS=OFF
|
|
||||||
)
|
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_debug_dep(dep_GLEW)
|
|
||||||
endif ()
|
|
21
deps/OpenCSG/OpenCSG.cmake
vendored
21
deps/OpenCSG/OpenCSG.cmake
vendored
@ -1,21 +0,0 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2019 - 2021 Tomáš Mészáros @tamasmeszaros
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
|
|
||||||
prusaslicer_add_cmake_project(OpenCSG
|
|
||||||
# GIT_REPOSITORY https://github.com/floriankirsch/OpenCSG.git
|
|
||||||
# GIT_TAG 83e274457b46c9ad11a4ee599203250b1618f3b9 #v1.4.2
|
|
||||||
URL https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip
|
|
||||||
URL_HASH SHA256=51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5
|
|
||||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt
|
|
||||||
DEPENDS dep_GLEW
|
|
||||||
)
|
|
||||||
|
|
||||||
if (TARGET ${ZLIB_PKG})
|
|
||||||
add_dependencies(dep_OpenCSG ${ZLIB_PKG})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_debug_dep(dep_OpenCSG)
|
|
||||||
endif ()
|
|
39
deps/OpenSSL/OpenSSL.cmake
vendored
39
deps/OpenSSL/OpenSSL.cmake
vendored
@ -1,39 +0,0 @@
|
|||||||
#/|/ Copyright (c) Prusa Research 2021 Tomáš Mészáros @tamasmeszaros
|
|
||||||
#/|/
|
|
||||||
#/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
|
||||||
#/|/
|
|
||||||
|
|
||||||
include(ProcessorCount)
|
|
||||||
ProcessorCount(NPROC)
|
|
||||||
|
|
||||||
set(_conf_cmd "./config")
|
|
||||||
set(_cross_arch "")
|
|
||||||
set(_cross_comp_prefix_line "")
|
|
||||||
if (CMAKE_CROSSCOMPILING)
|
|
||||||
set(_conf_cmd "./Configure")
|
|
||||||
set(_cross_comp_prefix_line "--cross-compile-prefix=${TOOLCHAIN_PREFIX}-")
|
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
|
|
||||||
set(_cross_arch "linux-aarch64")
|
|
||||||
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armhf") # For raspbian
|
|
||||||
# TODO: verify
|
|
||||||
set(_cross_arch "linux-armv4")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
ExternalProject_Add(dep_OpenSSL
|
|
||||||
EXCLUDE_FROM_ALL ON
|
|
||||||
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz"
|
|
||||||
URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d
|
|
||||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
|
|
||||||
BUILD_IN_SOURCE ON
|
|
||||||
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
|
|
||||||
"--prefix=${DESTDIR}/usr/local"
|
|
||||||
${_cross_comp_prefix_line}
|
|
||||||
no-shared
|
|
||||||
no-ssl3-method
|
|
||||||
no-dynamic-engine
|
|
||||||
-Wa,--noexecstack
|
|
||||||
BUILD_COMMAND make depend && make "-j${NPROC}"
|
|
||||||
INSTALL_COMMAND make install_sw
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user