cctag: Fix Darwin build

Fix the Darwin build by removing the dependency on the math_c99
libraries which aren't required on Darwin.
Also re-enable tests on Darwin by fixing the linking issue.

Co-authored-by: Reno Dakota <paparodeo@proton.me>
This commit is contained in:
Tobias M
2025-05-28 18:22:17 +02:00
co-authored by Reno Dakota
parent 1566c47d29
commit 4eea7ff427
2 changed files with 35 additions and 4 deletions
@@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0e35b6..fc19477 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,20 +96,6 @@ endif()
# set the path where we can find the findXXX.cmake
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
-if(APPLE)
-
- # avoid the cmake policy warning about @rpath in MacOSX
- cmake_policy(SET CMP0042 NEW)
-
- SET(CMAKE_MACOSX_RPATH TRUE) # initialize the MACOSX_RPATH property on all targets
- SET(CMAKE_SKIP_BUILD_RPATH FALSE) # don't skip the full RPATH for the build tree
- # SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # when building, don't use the install RPATH already
- SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) # when building, use the install RPATH already
- # probably not needed
- # SET(CMAKE_INSTALL_RPATH "") # the RPATH to be used when installing
- SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # LC_RPATH for CUDA and OpenCV etc written into executable
-endif(APPLE)
-
# FIND BOOST
set(BOOST_REQUIRED_COMPONENTS "atomic;chrono;date_time;filesystem;program_options;serialization;system;thread;timer;math_c99")
if(WIN32)
+9 -4
View File
@@ -17,9 +17,8 @@ stdenv.mkDerivation rec {
version = "1.0.4";
outputs = [
"lib"
"dev"
"out"
"dev"
];
src = fetchFromGitHub {
@@ -41,8 +40,15 @@ stdenv.mkDerivation rec {
patches = [
./cmake-install-include-dir.patch
./cmake-no-apple-rpath.patch
];
# darwin boost doesn't have math_c99 libraries
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace CMakeLists.txt --replace-warn ";math_c99" ""
substituteInPlace src/CMakeLists.txt --replace-warn "Boost::math_c99" ""
'';
nativeBuildInputs = [
cmake
];
@@ -57,8 +63,7 @@ stdenv.mkDerivation rec {
opencv.cxxdev
];
# Tests are broken on Darwin (linking issue)
doCheck = !stdenv.hostPlatform.isDarwin;
doCheck = true;
meta = with lib; {
description = "Detection of CCTag markers made up of concentric circles";