Blob Blame History Raw
diff -up meshlab-Meshlab-2020.07/src/cmake/FindLevmar.cmake.system-levmar meshlab-Meshlab-2020.07/src/cmake/FindLevmar.cmake
--- meshlab-Meshlab-2020.07/src/cmake/FindLevmar.cmake.system-levmar	2020-07-02 14:43:11.041499628 -0400
+++ meshlab-Meshlab-2020.07/src/cmake/FindLevmar.cmake	2020-07-02 14:40:30.129203739 -0400
@@ -0,0 +1,54 @@
+# - Find levmar
+# Find the levmar library
+#
+#  Levmar::Levmar - Imported target to use
+#  LEVMAR_FOUND - True if levmar was found.
+#
+# Original Author:
+# 2020 Tom Callaway <spot@fedoraproject.org>
+#
+# Based on code by:
+# Collabora, Ltd. 2019
+# 2019 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com>
+#
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+#
+# SPDX-License-Identifier: BSL-1.0
+
+set(LEVMAR_ROOT_DIR
+    "${LEVMAR_ROOT_DIR}"
+	CACHE
+	PATH
+    "Directory to search for liblevmar")
+find_path(LEVMAR_INCLUDE_DIR
+    NAMES
+    levmar.h
+    PATHS
+    "${LEVMAR_ROOT_DIR}")
+find_library(LEVMAR_LIBRARY
+    NAMES levmar
+    PATHS
+    "${LEVMAR_ROOT_DIR}")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Levmar
+    DEFAULT_MSG
+    LEVMAR_INCLUDE_DIR
+    LEVMAR_LIBRARY)
+
+if(LEVMAR_FOUND)
+    if(NOT TARGET Levmar::Levmar)
+        add_library(Levmar::Levmar UNKNOWN IMPORTED)
+        set_target_properties(Levmar::Levmar
+            PROPERTIES
+            IMPORTED_LOCATION "${LEVMAR_LIBRARY}"
+            INTERFACE_INCLUDE_DIRECTORIES "${LEVMAR_INCLUDE_DIR}")
+    endif()
+    set(LEVMAR_INCLUDE_DIRS ${LEVMAR_INCLUDE_DIR})
+    set(LEVMAR_LIBRARIES ${LEVMAR_LIBRARY})
+    mark_as_advanced(LEVMAR_ROOT_DIR)
+endif()
+
+mark_as_advanced(LEVMAR_INCLUDE_DIR LEVMAR_LIBRARY)
diff -up meshlab-Meshlab-2020.07/src/CMakeLists.txt.system-levmar meshlab-Meshlab-2020.07/src/CMakeLists.txt
--- meshlab-Meshlab-2020.07/src/CMakeLists.txt.system-levmar	2020-07-02 14:44:50.341830920 -0400
+++ meshlab-Meshlab-2020.07/src/CMakeLists.txt	2020-07-02 14:45:44.443921741 -0400
@@ -53,6 +53,7 @@ option(ALLOW_BUNDLED_OPENGR "Allow use o
 
 option(ALLOW_SYSTEM_EIGEN "Allow use of system-provided Eigen" ON)
 option(ALLOW_SYSTEM_GLEW "Allow use of system-provided GLEW" ON)
+option(ALLOW_SYSTEM_LEVMAR "Allow use of system-profived levmar" ON)
 option(ALLOW_SYSTEM_LIB3DS "Allow use of system-provided lib3ds" ON)
 option(ALLOW_SYSTEM_GMP "Allow use of system-provided GMP" ON)
 option(ALLOW_SYSTEM_MUPARSER "Allow use of system-provided muparser" ON)
@@ -77,6 +78,7 @@ find_package(GLEW)
 find_package(Eigen3)
 
 message(STATUS "Searching for optional components")
+find_package(Levmar)
 find_package(Lib3ds)
 find_package(GMP)
 find_package(muparser)
diff -up meshlab-Meshlab-2020.07/src/external.cmake.system-levmar meshlab-Meshlab-2020.07/src/external.cmake
--- meshlab-Meshlab-2020.07/src/external.cmake.system-levmar	2020-07-02 14:30:57.836465119 -0400
+++ meshlab-Meshlab-2020.07/src/external.cmake	2020-07-02 14:42:37.799058264 -0400
@@ -80,7 +80,11 @@ endif()
 
 # levmar - optional, for several plugins
 set(LEVMAR_DIR ${EXTERNAL_DIR}/levmar-2.3)
-if(ALLOW_BUNDLED_LEVMAR AND EXISTS "${LEVMAR_DIR}/lm.h")
+if(ALLOW_SYSTEM_LEVMAR AND TARGET Levmar::Levmar)
+    message(STATUS "- levmar - using system-provided library")
+    add_library(external-levmar INTERFACE)
+    target_link_libraries(external-levmar INTERFACE Levmar::Levmar)
+elseif(ALLOW_BUNDLED_LEVMAR AND EXISTS "${LEVMAR_DIR}/lm.h")
     message(STATUS "- levmar - using bundled source")
     add_library(
         external-levmar STATIC
diff -up meshlab-Meshlab-2020.07/src/meshlabplugins/edit_mutualcorrs/levmarmethods.h.system-levmar meshlab-Meshlab-2020.07/src/meshlabplugins/edit_mutualcorrs/levmarmethods.h
--- meshlab-Meshlab-2020.07/src/meshlabplugins/edit_mutualcorrs/levmarmethods.h.system-levmar	2020-07-02 14:27:44.714553015 -0400
+++ meshlab-Meshlab-2020.07/src/meshlabplugins/edit_mutualcorrs/levmarmethods.h	2020-07-02 14:27:52.527428089 -0400
@@ -12,7 +12,7 @@ sufficient to get a calibrated shot.<br>
 
 #include <list>
 
-#include "lm.h"
+#include "levmar.h"
 
 
 struct LevmarCorrelation {
diff -up meshlab-Meshlab-2020.07/src/meshlabplugins/edit_mutualcorrs/solver.h.system-levmar meshlab-Meshlab-2020.07/src/meshlabplugins/edit_mutualcorrs/solver.h
--- meshlab-Meshlab-2020.07/src/meshlabplugins/edit_mutualcorrs/solver.h.system-levmar	2020-07-02 14:27:24.591874781 -0400
+++ meshlab-Meshlab-2020.07/src/meshlabplugins/edit_mutualcorrs/solver.h	2020-07-02 14:27:33.999724348 -0400
@@ -5,7 +5,7 @@
 #include "alignset.h"
 
 #include "parameters.h"
-#include "lm.h"
+#include "levmar.h"
 
 #include <iostream>
 #include <fstream>
diff -up meshlab-Meshlab-2020.07/src/meshlabplugins/filter_isoparametrization/param_collapse.h.system-levmar meshlab-Meshlab-2020.07/src/meshlabplugins/filter_isoparametrization/param_collapse.h
--- meshlab-Meshlab-2020.07/src/meshlabplugins/filter_isoparametrization/param_collapse.h.system-levmar	2020-07-02 14:26:29.617753786 -0400
+++ meshlab-Meshlab-2020.07/src/meshlabplugins/filter_isoparametrization/param_collapse.h	2020-07-02 14:26:39.993587876 -0400
@@ -14,7 +14,7 @@
 
 #include <local_parametrization.h>
 #include <mesh_operators.h>
-#include <lm.h>
+#include <levmar.h>
 #include <uv_grid.h>
 
 #include "opt_patch.h"
diff -up meshlab-Meshlab-2020.07/src/meshlabplugins/filter_isoparametrization/parametrizator.h.system-levmar meshlab-Meshlab-2020.07/src/meshlabplugins/filter_isoparametrization/parametrizator.h
--- meshlab-Meshlab-2020.07/src/meshlabplugins/filter_isoparametrization/parametrizator.h.system-levmar	2020-07-02 14:26:50.282423360 -0400
+++ meshlab-Meshlab-2020.07/src/meshlabplugins/filter_isoparametrization/parametrizator.h	2020-07-02 14:27:09.361118323 -0400
@@ -32,7 +32,7 @@
 #include <vcg/space/color4.h>
 #include <dual_coord_optimization.h>
 #include <float.h>
-#include <lm.h>
+#include <levmar.h>
 #ifndef _MESHLAB
 #include <wrap/io_trimesh/export_ply.h>
 #endif
diff -up meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualglobal/levmarmethods.h.system-levmar meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualglobal/levmarmethods.h
--- meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualglobal/levmarmethods.h.system-levmar	2020-07-02 14:28:38.662690417 -0400
+++ meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualglobal/levmarmethods.h	2020-07-02 14:28:50.126507109 -0400
@@ -12,7 +12,7 @@ sufficient to get a calibrated shot.<br>
 
 #include <list>
 
-#include "lm.h"
+#include "levmar.h"
 
 
 struct LevmarCorrelation {
diff -up meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualglobal/solver.h.system-levmar meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualglobal/solver.h
--- meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualglobal/solver.h.system-levmar	2020-07-02 14:28:05.231224989 -0400
+++ meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualglobal/solver.h	2020-07-02 14:28:14.210081420 -0400
@@ -5,7 +5,7 @@
 #include "alignset.h"
 
 #include "parameters.h"
-#include "lm.h"
+#include "levmar.h"
 
 #include <iostream>
 #include <fstream>
diff -up meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualinfo/levmarmethods.h.system-levmar meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualinfo/levmarmethods.h
--- meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualinfo/levmarmethods.h.system-levmar	2020-07-02 14:26:01.101209766 -0400
+++ meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualinfo/levmarmethods.h	2020-07-02 14:26:13.065018466 -0400
@@ -12,7 +12,7 @@ sufficient to get a calibrated shot.<br>
 
 #include <list>
 
-#include "lm.h"
+#include "levmar.h"
 
 
 struct LevmarCorrelation {
diff -up meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualinfo/solver.h.system-levmar meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualinfo/solver.h
--- meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualinfo/solver.h.system-levmar	2020-07-02 14:25:37.258590970 -0400
+++ meshlab-Meshlab-2020.07/src/meshlabplugins/filter_mutualinfo/solver.h	2020-07-02 14:25:52.441348214 -0400
@@ -5,7 +5,7 @@
 #include "alignset.h"
 
 #include "parameters.h"
-#include "lm.h"
+#include "levmar.h"
 
 #include <iostream>
 #include <fstream>
diff -up meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_curvature_from_sliding/curvature_from_sliding.h.system-levmar meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_curvature_from_sliding/curvature_from_sliding.h
--- meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_curvature_from_sliding/curvature_from_sliding.h.system-levmar	2020-07-02 14:29:11.934158462 -0400
+++ meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_curvature_from_sliding/curvature_from_sliding.h	2020-07-02 14:29:22.982981790 -0400
@@ -30,7 +30,7 @@
 #include <vcg/complex/allocate.h>
 #include <vcg/complex/algorithms/subset.h>
 #include <vcg/space/index/grid_static_ptr.h>
-#include <lib/levmar/lm.h>
+#include <levmar.h>
 
 #include "frame.h"
 
diff -up meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_mutualinfo_xml/levmarmethods.h.system-levmar meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_mutualinfo_xml/levmarmethods.h
--- meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_mutualinfo_xml/levmarmethods.h.system-levmar	2020-07-02 14:29:55.148467459 -0400
+++ meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_mutualinfo_xml/levmarmethods.h	2020-07-02 14:30:04.820312834 -0400
@@ -12,7 +12,7 @@ sufficient to get a calibrated shot.<br>
 
 #include <list>
 
-#include "lm.h"
+#include "levmar.h"
 
 
 struct LevmarCorrelation {
diff -up meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_mutualinfo_xml/solver.h.system-levmar meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_mutualinfo_xml/solver.h
--- meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_mutualinfo_xml/solver.h.system-levmar	2020-07-02 14:29:35.957774321 -0400
+++ meshlab-Meshlab-2020.07/src/plugins_unsupported/filter_mutualinfo_xml/solver.h	2020-07-02 14:29:44.926630907 -0400
@@ -5,7 +5,7 @@
 #include "alignset.h"
 
 #include "parameters.h"
-#include "lm.h"
+#include "levmar.h"
 
 #include <iostream>
 #include <fstream>