commit fff51a35e718aaf2174a6498a802223ab1ed538d
Author: Jelle Spijker <j.spijker@ultimaker.com>
Date:   Wed Mar 30 04:18:33 2022 +0200

    Removed find_package clipper and nlopt
    
    These shouldn't be the responsibility of the consumer
    
    Contributes to CURA-8640

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -160,6 +160,8 @@
   FILES
     "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
     "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
+    "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/Findclipper.cmake"
+    "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindNLopt.cmake"
     "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindTBB.cmake"
   DESTINATION
     ${ConfigPackageLocation}
--- /dev/null
+++ b/cmake_modules/FindNLopt.cmake
@@ -0,0 +1,83 @@
+# Find NLopt library.
+# The following variables are set
+#
+# NLopt_FOUND
+# NLopt_INCLUDE_DIRS
+# NLopt_LIBRARIES
+#
+# It searches the environment variable $NLopt_PATH automatically.
+
+unset(NLopt_FOUND CACHE)
+unset(NLopt_INCLUDE_DIRS CACHE)
+unset(NLopt_LIBRARIES CACHE)
+unset(NLopt_LIBRARIES_RELEASE CACHE)
+unset(NLopt_LIBRARIES_DEBUG CACHE)
+
+if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug)")
+    set(NLopt_BUILD_TYPE DEBUG)
+else()
+    set(NLopt_BUILD_TYPE RELEASE)
+endif()
+
+FIND_PATH(NLopt_INCLUDE_DIRS nlopt.hpp
+    $ENV{NLopt_PATH}
+    $ENV{NLopt_PATH}/cpp/
+    $ENV{NLopt_PATH}/include/
+    ${CMAKE_PREFIX_PATH}/include/nlopt
+    ${CMAKE_PREFIX_PATH}/include/
+    /opt/local/include/
+    /opt/local/include/nlopt/
+    /usr/local/include/
+    /usr/local/include/nlopt/
+    /usr/include
+    /usr/include/nlopt/)
+
+set(LIB_SEARCHDIRS 
+    $ENV{NLopt_PATH}
+    $ENV{NLopt_PATH}/cpp/
+    $ENV{NLopt_PATH}/cpp/build/
+    $ENV{NLopt_PATH}/lib/
+    $ENV{NLopt_PATH}/lib/nlopt/
+    ${CMAKE_PREFIX_PATH}/lib/
+    ${CMAKE_PREFIX_PATH}/lib/nlopt/
+    /opt/local/lib/
+    /opt/local/lib/nlopt/
+    /usr/local/lib/
+    /usr/local/lib/nlopt/
+    /usr/lib/nlopt
+)
+
+set(_deb_postfix "d")
+
+FIND_LIBRARY(NLopt_LIBRARIES_RELEASE nlopt ${LIB_SEARCHDIRS})
+FIND_LIBRARY(NLopt_LIBRARIES_DEBUG nlopt${_deb_postfix} ${LIB_SEARCHDIRS})
+
+if(NLopt_LIBRARIES_${NLopt_BUILD_TYPE})
+    set(NLopt_LIBRARIES "${NLopt_LIBRARIES_${NLopt_BUILD_TYPE}}")
+else()
+    set(NLopt_LIBRARIES "${NLopt_LIBRARIES_RELEASE}")
+endif()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NLopt
+    "NLopt library cannot be found. Consider set NLopt_PATH environment variable"
+    NLopt_INCLUDE_DIRS
+    NLopt_LIBRARIES)
+
+MARK_AS_ADVANCED(
+    NLopt_INCLUDE_DIRS
+    NLopt_LIBRARIES)
+
+if(NLopt_FOUND)
+    add_library(NLopt::nlopt UNKNOWN IMPORTED)
+    set_target_properties(NLopt::nlopt PROPERTIES IMPORTED_LOCATION ${NLopt_LIBRARIES})
+    set_target_properties(NLopt::nlopt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${NLopt_INCLUDE_DIRS})
+    if(NLopt_LIBRARIES_RELEASE AND NLopt_LIBRARIES_DEBUG)
+        set_target_properties(NLopt::nlopt PROPERTIES
+            IMPORTED_LOCATION_DEBUG          ${NLopt_LIBRARIES_DEBUG}
+            IMPORTED_LOCATION_RELWITHDEBINFO ${NLopt_LIBRARIES_RELEASE}
+            IMPORTED_LOCATION_RELEASE        ${NLopt_LIBRARIES_RELEASE}
+            IMPORTED_LOCATION_MINSIZEREL     ${NLopt_LIBRARIES_RELEASE}
+        )
+    endif()
+endif()
--- /dev/null
+++ b/cmake_modules/Findclipper.cmake
@@ -0,0 +1,88 @@
+# Find Clipper library (http://www.angusj.com/delphi/clipper.php).
+# The following variables are set
+#
+# CLIPPER_FOUND
+# CLIPPER_INCLUDE_DIRS
+# CLIPPER_LIBRARIES
+#
+# It searches the environment variable $CLIPPER_PATH automatically.
+
+unset(CLIPPER_FOUND CACHE)
+unset(CLIPPER_INCLUDE_DIRS CACHE)
+unset(CLIPPER_LIBRARIES CACHE)
+unset(CLIPPER_LIBRARIES_RELEASE CACHE)
+unset(CLIPPER_LIBRARIES_DEBUG CACHE)
+
+if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug)")
+    set(CLIPPER_BUILD_TYPE DEBUG)
+else()
+    set(CLIPPER_BUILD_TYPE RELEASE)
+endif()
+
+FIND_PATH(CLIPPER_INCLUDE_DIRS clipper.hpp
+    $ENV{CLIPPER_PATH}
+    $ENV{CLIPPER_PATH}/cpp/
+    $ENV{CLIPPER_PATH}/include/
+    $ENV{CLIPPER_PATH}/include/polyclipping/
+    ${PROJECT_SOURCE_DIR}/python/pymesh/third_party/include/
+    ${PROJECT_SOURCE_DIR}/python/pymesh/third_party/include/polyclipping/
+    ${CMAKE_PREFIX_PATH}/include/polyclipping
+    ${CMAKE_PREFIX_PATH}/include/
+    /opt/local/include/
+    /opt/local/include/polyclipping/
+    /usr/local/include/
+    /usr/local/include/polyclipping/
+    /usr/include
+    /usr/include/polyclipping/)
+
+set(LIB_SEARCHDIRS 
+    $ENV{CLIPPER_PATH}
+    $ENV{CLIPPER_PATH}/cpp/
+    $ENV{CLIPPER_PATH}/cpp/build/
+    $ENV{CLIPPER_PATH}/lib/
+    $ENV{CLIPPER_PATH}/lib/polyclipping/
+    ${PROJECT_SOURCE_DIR}/python/pymesh/third_party/lib/
+    ${PROJECT_SOURCE_DIR}/python/pymesh/third_party/lib/polyclipping/
+    ${CMAKE_PREFIX_PATH}/lib/
+    ${CMAKE_PREFIX_PATH}/lib/polyclipping/
+    /opt/local/lib/
+    /opt/local/lib/polyclipping/
+    /usr/local/lib/
+    /usr/local/lib/polyclipping/
+    /usr/lib/polyclipping
+)
+
+set(_deb_postfix "d")
+
+FIND_LIBRARY(CLIPPER_LIBRARIES_RELEASE polyclipping ${LIB_SEARCHDIRS})
+FIND_LIBRARY(CLIPPER_LIBRARIES_DEBUG polyclipping${_deb_postfix} ${LIB_SEARCHDIRS})
+
+if(CLIPPER_LIBRARIES_${CLIPPER_BUILD_TYPE})
+    set(CLIPPER_LIBRARIES "${CLIPPER_LIBRARIES_${CLIPPER_BUILD_TYPE}}")
+else()
+    set(CLIPPER_LIBRARIES "${CLIPPER_LIBRARIES_RELEASE}")
+endif()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(clipper
+    "Clipper library cannot be found.  Consider set CLIPPER_PATH environment variable"
+    CLIPPER_INCLUDE_DIRS
+    CLIPPER_LIBRARIES)
+
+MARK_AS_ADVANCED(
+    CLIPPER_INCLUDE_DIRS
+    CLIPPER_LIBRARIES)
+
+if(CLIPPER_FOUND)
+    add_library(clipper::clipper UNKNOWN IMPORTED)
+    set_target_properties(clipper::clipper PROPERTIES IMPORTED_LOCATION ${CLIPPER_LIBRARIES})
+    set_target_properties(clipper::clipper PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CLIPPER_INCLUDE_DIRS})
+    if(CLIPPER_LIBRARIES_RELEASE AND CLIPPER_LIBRARIES_DEBUG)
+        set_target_properties(clipper::clipper PROPERTIES
+            IMPORTED_LOCATION_DEBUG          ${CLIPPER_LIBRARIES_DEBUG}
+            IMPORTED_LOCATION_RELWITHDEBINFO ${CLIPPER_LIBRARIES_RELEASE}
+            IMPORTED_LOCATION_RELEASE        ${CLIPPER_LIBRARIES_RELEASE}
+            IMPORTED_LOCATION_MINSIZEREL     ${CLIPPER_LIBRARIES_RELEASE}
+        )
+    endif()
+endif()
