From ee5afe029d26055bb4b1c98c275aae7bcc7fd5c1 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Tue, 13 Jun 2023 11:40:42 +0200
Subject: [PATCH] patch for cddlib-0.94 compatibility

---
 CMakeLists.txt               | 1 -
 sympol/CMakeLists.txt        | 6 ++++--
 sympol/raycomputationcdd.cpp | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git CMakeLists.txt CMakeLists.txt
index a5370b0..ec3db33 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -23,7 +23,6 @@ add_test(NAME perltest WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/contrib COMMAND p
 
 add_subdirectory(sympol)
 add_subdirectory(external/lrslib-042c)
-add_subdirectory(external/cddlib-094f)
 add_subdirectory(test)
 
 exec_program( ${CMAKE_COMMAND} ARGS -E copy_directory ${PROJECT_SOURCE_DIR}/data ${PROJECT_BINARY_DIR}/data )
diff --git sympol/CMakeLists.txt sympol/CMakeLists.txt
index 9434c45..df6fd6f 100644
--- sympol/CMakeLists.txt
+++ sympol/CMakeLists.txt
@@ -40,7 +40,7 @@ SET (Boost_USE_MULTITHREADED TRUE)
 find_package(Boost 1.34.1 COMPONENTS program_options REQUIRED)
 include_directories(${Boost_INCLUDE_DIRS})
 
-include_directories(../external/boost ../external/permlib ../external/lrslib-042c ../external/cddlib-094f ${CMAKE_CURRENT_BINARY_DIR})
+include_directories(../external/boost ../external/permlib ../external/cddlib-094f ${CMAKE_CURRENT_BINARY_DIR})
 add_definitions(-Woverloaded-virtual)
 # lrs flags
 add_definitions(-DGMP -DLRS_QUIET)
@@ -75,7 +75,9 @@ set_target_properties(sympol PROPERTIES VERSION ${SYMPOL_MAJOR}.${SYMPOL_MINOR}.
 add_executable(sympolbin sympol.cpp)
 set_target_properties(sympolbin PROPERTIES OUTPUT_NAME sympol)
 
-set(TARGET_LIBS ${TARGET_LIBS} lrsgmp cddgmp ${GMP_LIBRARIES} ${Boost_LIBRARIES})
+find_library(CDDGMP cddgmp REQUIRED)
+
+set(TARGET_LIBS ${TARGET_LIBS} lrsgmp ${CDDGMP} ${GMP_LIBRARIES} ${Boost_LIBRARIES})
 target_link_libraries(sympol ${TARGET_LIBS})
 target_link_libraries(sympolbin sympol)
 
diff --git sympol/raycomputationcdd.cpp sympol/raycomputationcdd.cpp
index 17091f3..46ef4ff 100644
--- sympol/raycomputationcdd.cpp
+++ sympol/raycomputationcdd.cpp
@@ -25,8 +25,8 @@
 #include "polyhedron.h"
 
 extern "C" {
-	#include <setoper.h>
-	#include <cdd.h>
+	#include <cddlib/setoper.h>
+	#include <cddlib/cdd.h>
 }
 
 #include <ctime>
-- 
2.41.0

