Add Qhull the new way

This commit is contained in:
tamasmeszaros 2021-03-22 13:07:08 +01:00
parent cf9723b7cc
commit f4733e69fc
5 changed files with 42 additions and 77 deletions

3
deps/CMakeLists.txt vendored
View file

@ -147,6 +147,7 @@ if (NOT EXPAT_FOUND)
endif ()
include(Cereal/Cereal.cmake)
include(Qhull/Qhull.cmake)
include(GLEW/GLEW.cmake)
include(OpenCSG/OpenCSG.cmake)
include(GMP/GMP.cmake)
@ -201,7 +202,7 @@ if (MSVC)
# Experimental
#list(APPEND _dep_list "dep_qhull")
else()
list(APPEND _dep_list "dep_qhull")
list(APPEND _dep_list "dep_Qhull")
# Not working, static build has different Eigen
#list(APPEND _dep_list "dep_libigl")
endif()

13
deps/Qhull/Qhull.cmake vendored Normal file
View file

@ -0,0 +1,13 @@
include(GNUInstallDirs)
prusaslicer_add_cmake_project(Qhull
# URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz"
# URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0
GIT_REPOSITORY https://github.com/qhull/qhull.git
GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch
CMAKE_ARGS
-DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR}
)
if (MSVC)
add_debug_dep(dep_Qhull)
endif ()

View file

@ -28,17 +28,17 @@ endif ()
# ${DEP_CMAKE_OPTS}
# )
ExternalProject_Add(dep_qhull
EXCLUDE_FROM_ALL 1
#URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz"
#URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0
GIT_REPOSITORY https://github.com/qhull/qhull.git
GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch
CMAKE_ARGS
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
${DEP_CMAKE_OPTS}
)
# ExternalProject_Add(dep_qhull
# EXCLUDE_FROM_ALL 1
# #URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz"
# #URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0
# GIT_REPOSITORY https://github.com/qhull/qhull.git
# GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch
# CMAKE_ARGS
# -DBUILD_SHARED_LIBS=OFF
# -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
# ${DEP_CMAKE_OPTS}
# )
ExternalProject_Add(dep_blosc
EXCLUDE_FROM_ALL 1

View file

@ -128,23 +128,23 @@ ExternalProject_Add(dep_boost
# )
# endif ()
ExternalProject_Add(dep_qhull
EXCLUDE_FROM_ALL 1
#URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz"
#URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0
GIT_REPOSITORY https://github.com/qhull/qhull.git
GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_DEBUG_POSTFIX=d
BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
INSTALL_COMMAND ""
)
# ExternalProject_Add(dep_qhull
# EXCLUDE_FROM_ALL 1
# #URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz"
# #URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0
# GIT_REPOSITORY https://github.com/qhull/qhull.git
# GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch
# CMAKE_GENERATOR "${DEP_MSVC_GEN}"
# CMAKE_ARGS
# -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
# -DBUILD_SHARED_LIBS=OFF
# -DCMAKE_POSITION_INDEPENDENT_CODE=ON
# -DCMAKE_DEBUG_POSTFIX=d
# BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
# INSTALL_COMMAND ""
# )
add_debug_dep(dep_qhull)
# add_debug_dep(dep_qhull)
if (${DEPS_BITS} EQUAL 32)
set(DEP_WXWIDGETS_TARGET "")

49
deps/qhull-mods.patch vendored
View file

@ -1,49 +0,0 @@
From 7f55a56b3d112f4dffbf21b1722f400c64bf03b1 Mon Sep 17 00:00:00 2001
From: tamasmeszaros <meszaros.q@gmail.com>
Date: Mon, 21 Oct 2019 16:52:04 +0200
Subject: [PATCH] Fix the build on macOS
---
CMakeLists.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07d3da2..14df8e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -626,18 +626,18 @@ install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfigVersion.cmake"
VERSION ${qhull_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT QhullTargets
- FILE "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullTargets.cmake"
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullTargets.cmake"
NAMESPACE Qhull::
)
configure_file(${PROJECT_SOURCE_DIR}/build/config.cmake.in
- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake"
@ONLY
)
@@ -652,8 +652,8 @@ install(EXPORT QhullTargets
)
install(
FILES
- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfigVersion.cmake"
DESTINATION
${ConfigPackageLocation}
COMPONENT
--
2.17.1