4 Commits

Author SHA256 Message Date
5544e79408 Accepting request 1240670 from science
OBS-URL: https://build.opensuse.org/request/show/1240670
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/qhull?expand=0&rev=25
2025-01-28 13:58:47 +00:00
8db44966eb - Fix broken CMake configuration, move static qhullcpp library
to separate export set. Otherwise, the regular reentrant library
  will reference a non-existing library file, and dependent
  packages will fail. 
  * 0001-Use-separate-CMake-EXPORT-sets-for-independent-targe.patch

OBS-URL: https://build.opensuse.org/package/show/science/qhull?expand=0&rev=22
2025-01-27 22:53:20 +00:00
5efe1d7664 Accepting request 1235774 from science
OBS-URL: https://build.opensuse.org/request/show/1235774
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/qhull?expand=0&rev=24
2025-01-09 14:05:20 +00:00
172c1e3d7d - Let cmake install qhullcpp
This will create the Qhull:qhullcpp cmake target for other projects. It allows to remove ugly workarounds in other projects consuming qhull.

OBS-URL: https://build.opensuse.org/package/show/science/qhull?expand=0&rev=20
2025-01-08 05:38:18 +00:00
3 changed files with 186 additions and 16 deletions

View File

@@ -0,0 +1,151 @@
From 548df3c071ae1de850c260c9cf10da401d347730 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 25 Jan 2025 12:56:06 +0100
Subject: [PATCH] Use separate CMake EXPORT sets for independent targets
---
CMakeLists.txt | 49 ++++++++++++++++++++++++++-----------------
build/config.cmake.in | 22 ++++++++++++++++++-
2 files changed, 51 insertions(+), 20 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 553166e..9478a52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -107,6 +107,7 @@ check_lfs(WITH_LFS)
include(CMakeDependentOption)
option(BUILD_STATIC_LIBS "Build static libraries" ON)
option(BUILD_SHARED_LIBS "Build shared library" ON)
+option(BUILD_QHULLCPP "Build QHULL C++ library" ON)
set(_NO_STATIC_LIBS NOCACHE INTERNAL (NOT ${BUILD_STATIC_LIBS}))
cmake_dependent_option(LINK_APPS_SHARED "Use shared library for linking applications"
_NO_STATIC_LIBS
@@ -343,7 +344,7 @@ set(qhull_SHARED libqhull) # Temporarily avoid name conflict with qhull executa
set(qhull_SHAREDP qhull_p) # libqhull and qhull_p are deprecated, use qhull_r instead
set(qhull_TARGETS_APPLICATIONS qhull rbox qconvex qdelaunay qvoronoi qhalf)
-set(qhull_TARGETS_STATIC ${qhull_CPP} ${qhull_STATIC} ${qhull_STATICR})
+set(qhull_TARGETS_STATIC ${qhull_STATIC} ${qhull_STATICR})
set(qhull_TARGETS_SHARED ${qhull_SHAREDR})
set(
@@ -466,14 +467,21 @@ set_target_properties(${qhull_CPP} PROPERTIES
VERSION ${qhull_VERSION}
OUTPUT_NAME "${qhull_CPP}$<$<CONFIG:Debug>:_d>"
POSITION_INDEPENDENT_CODE "TRUE")
+if (BUILD_SHARED_LIBS)
+ target_link_libraries(${qhull_CPP} PRIVATE ${qhull_SHAREDR})
+else()
+ target_link_libraries(${qhull_CPP} PRIVATE ${qhull_STATICR})
+endif()
# ---------------------------------------
-# if BUILD_STATIC_LIBS=OFF or BUILD_SHARED_LIBS=OFF
-# Exclude library builds from "make all"
+# if BUILD_STATIC_LIBS=OFF, BUILD_SHARED_LIBS=OFF, BUILD_QHULLCPP=OFF
+# Exclude corresponding library builds from "make all"
# ---------------------------------------
if(NOT ${BUILD_STATIC_LIBS})
set_target_properties(${qhull_STATIC} PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(${qhull_STATICR} PROPERTIES EXCLUDE_FROM_ALL TRUE)
+endif()
+if(NOT ${BUILD_QHULLCPP})
set_target_properties(${qhull_CPP} PROPERTIES EXCLUDE_FROM_ALL TRUE)
endif()
if(NOT ${BUILD_SHARED_LIBS})
@@ -677,20 +685,37 @@ endif()
# Define install
# ---------------------------------------
+set(ConfigPackageLocation lib/cmake/Qhull)
+
install(TARGETS ${qhull_TARGETS_APPLICATIONS} EXPORT
RUNTIME DESTINATION ${BIN_INSTALL_DIR})
if (BUILD_SHARED_LIBS)
- install(TARGETS ${qhull_TARGETS_SHARED} EXPORT QhullTargets
+ install(TARGETS ${qhull_TARGETS_SHARED} EXPORT QhullTargetsShared
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
INCLUDES DESTINATION include)
+ install(EXPORT QhullTargetsShared
+ NAMESPACE Qhull::
+ DESTINATION ${ConfigPackageLocation})
endif()
if (BUILD_STATIC_LIBS)
- install(TARGETS ${qhull_TARGETS_STATIC} EXPORT QhullTargets
+ install(TARGETS ${qhull_TARGETS_STATIC} EXPORT QhullTargetsStatic
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+ INCLUDES DESTINATION include)
+ install(EXPORT QhullTargetsStatic
+ NAMESPACE Qhull::
+ DESTINATION ${ConfigPackageLocation})
+endif()
+if (BUILD_QHULLCPP)
+ install(TARGETS ${qhull_CPP} EXPORT QhullTargetsCpp
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
INCLUDES DESTINATION include)
+ install(EXPORT QhullTargetsCpp
+ NAMESPACE Qhull::
+ DESTINATION ${ConfigPackageLocation})
endif()
include(CMakePackageConfigHelpers)
@@ -701,25 +726,11 @@ write_basic_package_version_file(
COMPATIBILITY AnyNewerVersion
)
-export(EXPORT QhullTargets
- FILE "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullTargets.cmake"
- NAMESPACE Qhull::
-)
-
configure_file(${PROJECT_SOURCE_DIR}/build/config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake"
@ONLY
)
-set(ConfigPackageLocation lib/cmake/Qhull)
-install(EXPORT QhullTargets
- FILE
- QhullTargets.cmake
- NAMESPACE
- Qhull::
- DESTINATION
- ${ConfigPackageLocation}
-)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake"
diff --git a/build/config.cmake.in b/build/config.cmake.in
index 63183ce..3741228 100644
--- a/build/config.cmake.in
+++ b/build/config.cmake.in
@@ -1 +1,21 @@
-include("${CMAKE_CURRENT_LIST_DIR}/QhullTargets.cmake")
+set(_targets)
+
+if (@BUILD_SHARED_LIBS@)
+ include("${CMAKE_CURRENT_LIST_DIR}/QhullTargetsShared.cmake" OPTIONAL)
+ list(APPEND _targets Qhull::@qhull_SHAREDR@)
+endif()
+if (@BUILD_STATIC_LIBS@)
+ include("${CMAKE_CURRENT_LIST_DIR}/QhullTargetsStatic.cmake" OPTIONAL)
+ list(APPEND _targets Qhull::@qhull_STATICR@)
+endif()
+if (@BUILD_QHULLCPP@)
+ include("${CMAKE_CURRENT_LIST_DIR}/QhullTargetsCpp.cmake" OPTIONAL)
+ list(APPEND _targets Qhull::@qhull_CPP@)
+endif()
+
+set(Qhull_FOUND FALSE)
+foreach(_target IN ITEMS ${_targets})
+ if (TARGET ${_target})
+ set(Qhull_FOUND TRUE)
+ endif()
+endforeach()
--
2.48.1

View File

@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Sat Jan 25 12:33:01 UTC 2025 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Fix broken CMake configuration, move static qhullcpp library
to separate export set. Otherwise, the regular reentrant library
will reference a non-existing library file, and dependent
packages will fail.
* 0001-Use-separate-CMake-EXPORT-sets-for-independent-targe.patch
-------------------------------------------------------------------
Sat Jan 4 15:17:55 UTC 2025 - Andreas Schneider <asn@cryptomilk.org>
- Let cmake install qhullcpp
-------------------------------------------------------------------
Tue Feb 20 13:47:27 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package qhull
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -29,6 +29,8 @@ URL: http://www.qhull.org
Source0: http://www.qhull.org/download/qhull-%{srcyear}-src-%{srcver}.tgz
# PATCH-FIX-OPENSUSE
Patch1: 0002-Remove-tools-from-CMake-exported-targets.patch
# PATCH-FIX-OPENSUSE
Patch2: 0001-Use-separate-CMake-EXPORT-sets-for-independent-targe.patch
BuildRequires: cmake
BuildRequires: gcc-c++
@@ -95,36 +97,36 @@ export CXXFLAGS+=" -ffat-lto-objects"
# Don't assume LIB_INSTALL_DIR is relative
sed -i 's#@LIB_INSTALL_DIR@#%{_lib}#' build/qhull.pc.in
# Neither is INCLUDE_INSTALL_DIR
sed -i 's#@INCLUDE_INSTALL_DIR@#include#' build/qhull.pc.in
# Neither is INCLUDE_INSTALL_DIR
sed -i 's#@INCLUDE_INSTALL_DIR@#include#' build/qhull.pc.in
# Fix CMake/Pkgconfig directories
sed -i '/Location/ s@lib/@${LIB_INSTALL_DIR}/@' CMakeLists.txt
%cmake \
-DDOC_INSTALL_DIR="%{_docdir}/%{name}" \
-DINCLUDE_INSTALL_DIR="%{_includedir}" \
-DLIB_INSTALL_DIR="%{_libdir}" \
-DBIN_INSTALL_DIR="%{_bindir}" \
-DMAN_INSTALL_DIR="%{_mandir}/man1/"
%cmake_build qhullcpp
-DMAN_INSTALL_DIR="%{_mandir}/man1/" \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_QHULLCPP=ON \
-DLINK_APPS_SHARED=ON
%cmake_build
%install
%cmake_install
# Fixup wrong location
%if "%{_lib}" != "lib"
mv %{buildroot}%{_prefix}/lib/cmake %{buildroot}%{_libdir}/
mv %{buildroot}%{_prefix}/lib/pkgconfig %{buildroot}%{_libdir}/
%endif
rm %{buildroot}%{_docdir}/%{name}/COPYING.txt
# Fix rpmlint warning: E: double-slash-in-pkgconfig-path
sed -i 's#//#/#' %{buildroot}%{_libdir}/pkgconfig/*.pc
# Manually install cpp lib since it isn't installed by make install
find ./ -name "libqhullcpp.a" -print -exec install -m0644 {} %{buildroot}%{_libdir}/ \;
# We don't install static libs for qhull, so don't install the corresponding pkgconfig files either
rm %{buildroot}%{_libdir}/pkgconfig/qhullstatic*.pc
# Fix rpmlint warning: E: double-slash-in-pkgconfig-path
sed -i 's#//#/#' %{buildroot}%{_libdir}/pkgconfig/*.pc
# Remove deprecated qhull headers
rm -r %{buildroot}%{_includedir}/libqhull
@@ -149,12 +151,15 @@ rm -r %{buildroot}%{_includedir}/libqhull
%files -n qhull_r-devel
%{_includedir}/libqhull_r/
%{_libdir}/libqhull_r.so
%{_libdir}/cmake/Qhull
%dir %{_libdir}/cmake/Qhull
%{_libdir}/cmake/Qhull/QhullConfig*.cmake
%{_libdir}/cmake/Qhull/QhullTargetsShared*.cmake
%{_libdir}/pkgconfig/qhull_r.pc
%files -n qhullcpp-devel-static
%{_includedir}/libqhullcpp/
%{_libdir}/libqhullcpp.a
%{_libdir}/pkgconfig/qhullcpp.pc
%{_libdir}/cmake/Qhull/QhullTargetsCpp*.cmake
%changelog