From a0452badb15d2296882ac33de6272faf4a6880de Mon Sep 17 00:00:00 2001
From: Yuwei Xiao <xyw1105@126.com>
Date: Thu, 20 Feb 2020 17:43:46 +0800
Subject: [PATCH] cmake

---
 cmake/FindLIBIGL.cmake | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 cmake/FindLIBIGL.cmake

diff --git a/cmake/FindLIBIGL.cmake b/cmake/FindLIBIGL.cmake
new file mode 100644
index 0000000..454225d
--- /dev/null
+++ b/cmake/FindLIBIGL.cmake
@@ -0,0 +1,40 @@
+# - Try to find the LIBIGL library
+# Once done this will define
+#
+#  LIBIGL_FOUND - system has LIBIGL
+#  LIBIGL_INCLUDE_DIR - **the** LIBIGL include directory
+if(LIBIGL_FOUND)
+    return()
+endif()
+
+find_path(LIBIGL_INCLUDE_DIR igl/readOBJ.h
+    HINTS
+        ENV LIBIGL
+        ENV LIBIGLROOT
+        ENV LIBIGL_ROOT
+        ENV LIBIGL_DIR
+    PATHS
+        ${CMAKE_SOURCE_DIR}/../..
+        ${CMAKE_SOURCE_DIR}/..
+        ${CMAKE_SOURCE_DIR}
+        ${CMAKE_SOURCE_DIR}/libigl
+        ${CMAKE_SOURCE_DIR}/../libigl
+        ${CMAKE_SOURCE_DIR}/../../libigl
+        ${CMAKE_SOURCE_DIR}/../../lib/libigl
+        ${CMAKE_SOURCE_DIR}/lib/libigl
+        ${CMAKE_SOURCE_DIR}/../lib/libigl
+        /usr
+        /usr/local
+        /usr/local/igl/libigl
+    PATH_SUFFIXES include
+)
+message(${LIBIGL_INCLUDE_DIR})
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LIBIGL
+    "\nlibigl not found --- You can download it using:\n\tgit clone --recursive https://github.com/libigl/libigl.git ${CMAKE_SOURCE_DIR}/../libigl"
+    LIBIGL_INCLUDE_DIR)
+mark_as_advanced(LIBIGL_INCLUDE_DIR)
+
+list(APPEND CMAKE_MODULE_PATH "${LIBIGL_INCLUDE_DIR}/../cmake")
+message(${CMAKE_MODULE_PATH})
+include(libigl)
-- 
GitLab