1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
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()
|