Browse Source

Merge branch 'master' of https://github.com/danielepanozzo/libigl

Conflicts:
	include/igl/slice.cpp

Former-commit-id: ba8e392b3d5356a5567a1aa8beb351c1fdab8caf
schuellc 10 years ago
parent
commit
ffd466ed83

+ 2 - 2
include/igl/embree/unproject_in_mesh.cpp

@@ -115,8 +115,8 @@ IGL_INLINE int igl::embree::unproject_in_mesh(
 
 #ifdef IGL_STATIC_LIBRARY
 #  ifndef IGL_OPENLGL_4
-template int igl::embree::unproject_in_mesh<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(double, double, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&, std::vector<igl::embree::Hit, std::allocator<igl::embree::Hit> >&);
-template int igl::embree::unproject_in_mesh<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(double, double, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&);
+//template int igl::embree::unproject_in_mesh<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(double, double, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&, std::vector<igl::embree::Hit, std::allocator<igl::embree::Hit> >&);
+//template int igl::embree::unproject_in_mesh<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(double, double, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&);
 #  endif
 template int igl::embree::unproject_in_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::Matrix<float, 2, 1, 0, 2, 1> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::vector<igl::embree::Hit, std::allocator<igl::embree::Hit> >&);
 template int igl::embree::unproject_in_mesh<Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::Matrix<float, 2, 1, 0, 2, 1> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, igl::embree::EmbreeIntersector const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, std::vector<igl::embree::Hit, std::allocator<igl::embree::Hit> >&);

+ 3 - 2
include/igl/nchoosek.cpp

@@ -46,7 +46,7 @@ IGL_INLINE void igl::nchoosek(
   int running_j = 0;
   Matrix<typename DerivedU::Scalar,1,Dynamic> running(1,k);
   int N = V.size();
-  const std::function<void(int,int)> doCombs = 
+  const std::function<void(int,int)> doCombs =
     [&running,&N,&doCombs,&running_i,&running_j,&U,&V](int offset, int k)
   {
     if(k==0)
@@ -55,7 +55,7 @@ IGL_INLINE void igl::nchoosek(
       running_i++;
       return;
     }
-    for (int i = offset; i <= N - k; ++i) 
+    for (int i = offset; i <= N - k; ++i)
     {
       running(running_j) = V(i);
       running_j++;
@@ -68,4 +68,5 @@ IGL_INLINE void igl::nchoosek(
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
+template void igl::nchoosek<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 #endif

+ 10 - 15
include/igl/unproject.cpp

@@ -6,12 +6,9 @@
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "unproject.h"
-#ifndef IGL_NO_OPENGL
-#ifndef IGL_OPENGL_4
 
 #include <Eigen/Dense>
 #include <Eigen/LU>
-#include "OpenGL_convenience.h"
 
 IGL_INLINE void igl::unproject(
   const double winX,
@@ -36,6 +33,10 @@ IGL_INLINE void igl::unproject(
   obj = igl::unproject(win).template cast<typename Derivedobj::Scalar>();
 }
 
+// #ifndef IGL_NO_OPENGL
+// #ifndef IGL_OPENGL_4
+#include "OpenGL_convenience.h"
+
 template <typename Derivedwin>
 IGL_INLINE Eigen::PlainObjectBase<Derivedwin> igl::unproject(
   const Eigen::PlainObjectBase<Derivedwin> & win)
@@ -54,9 +55,8 @@ IGL_INLINE Eigen::PlainObjectBase<Derivedwin> igl::unproject(
   return objd.template cast<Scalar>();
 }
 
-#endif
-#endif
-
+// #endif
+// #endif
 
 template <typename Scalar>
 IGL_INLINE Eigen::Matrix<Scalar,3,1> igl::unproject(
@@ -84,16 +84,11 @@ IGL_INLINE Eigen::Matrix<Scalar,3,1> igl::unproject(
 #ifndef IGL_NO_OPENGL
 #ifndef IGL_OPENGL_4
 // Explicit template instanciation
-template void igl::unproject<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&);
-template void igl::unproject<Eigen::Matrix<float, 3, 1, 0, 3, 1>, Eigen::Matrix<float, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> >&);
-template Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > igl::unproject<Eigen::Matrix<float, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&);
-template void igl::unproject<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<float, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> >&);
-template Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > igl::unproject<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&);
-template void igl::unproject<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
-template Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > igl::unproject<Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&);
-template Eigen::Matrix<float, 3, 1, 0, 3, 1> igl::unproject<float>(Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&);
 #endif
-template Eigen::Matrix<double, 3, 1, 0, 3, 1> igl::unproject<double>(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&, Eigen::Matrix<double, 4, 1, 0, 4, 1> const&);
 #endif
 
+template Eigen::Matrix<float, 3, 1, 0, 3, 1> igl::unproject<float>(Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&);
+template Eigen::Matrix<double, 3, 1, 0, 3, 1> igl::unproject<double>(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&, Eigen::Matrix<double, 4, 1, 0, 4, 1> const&);
+template Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > igl::unproject<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&);
+
 #endif

+ 1 - 18
include/igl/viewer/Viewer.cpp

@@ -194,7 +194,7 @@ namespace viewer
     ngui->addVariable(core.camera_zoom,"Zoom");
     ngui->addVariable(core.orthographic,"Orthographic view");
 
-    ngui->addNewGroup("Draw options");
+    ngui->addNewGroup("Draw options",FormScreen::Layout::Vertical);
 
     ngui->addVariable([&](bool checked)
     {
@@ -420,23 +420,6 @@ namespace viewer
 
     char k = key;
 
-    // if(key == GLFW_KEY_S && modifiers == GLFW_MOD_SHIFT)
-    //   mouse_scroll(1);
-    //
-    // if(key == GLFW_KEY_A && modifiers == GLFW_MOD_SHIFT)
-    //   mouse_scroll(-1);
-
-    // // Why aren't these handled via AntTweakBar?
-    // if(key == GLFW_KEY_Z) // Don't use 'Z' because that clobbers snap_to_canonical_view_quat
-    //   core.trackball_angle << 0.0f, 0.0f, 0.0f, 1.0f;
-    //
-    // if(key == GLFW_KEY_Y)
-    //   core.trackball_angle << -sqrt(2.0f)/2.0f, 0.0f, 0.0f, sqrt(2.0f)/2.0f;
-    //
-    // if(key == GLFW_KEY_X)
-    //   core.trackball_angle << -0.5f, -0.5f, -0.5f, 0.5f;
-
-
     return false;
   }
 

+ 0 - 39
lib/cmake_install.cmake

@@ -1,39 +0,0 @@
-# Install script for directory: /Users/daniele/Dropbox/igl/libigl/optional
-
-# Set the install prefix
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  set(CMAKE_INSTALL_PREFIX "/usr/local")
-endif()
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  if(BUILD_TYPE)
-    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  else()
-    set(CMAKE_INSTALL_CONFIG_NAME "")
-  endif()
-  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-endif()
-
-# Set the component getting installed.
-if(NOT CMAKE_INSTALL_COMPONENT)
-  if(COMPONENT)
-    message(STATUS "Install component: \"${COMPONENT}\"")
-    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  else()
-    set(CMAKE_INSTALL_COMPONENT)
-  endif()
-endif()
-
-if(CMAKE_INSTALL_COMPONENT)
-  set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-else()
-  set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-endif()
-
-string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
-       "${CMAKE_INSTALL_MANIFEST_FILES}")
-file(WRITE "/Users/daniele/Dropbox/igl/libigl/lib/${CMAKE_INSTALL_MANIFEST}"
-     "${CMAKE_INSTALL_MANIFEST_CONTENT}")

+ 34 - 4
optional/CMakeLists.txt

@@ -10,7 +10,7 @@ find_package(EIGEN REQUIRED)
 add_definitions(-DIGL_STATIC_LIBRARY)
 
 ## Check for GLFW
-find_package(GLFW QUIET)
+find_package(GLFWH QUIET)
 if (GLFW_FOUND)
   include_directories( ${GLFW_INCLUDE_DIR})
 else (GLFW_FOUND)
@@ -28,7 +28,8 @@ else (ANTTWEAKBAR_FOUND)
 endif(ANTTWEAKBAR_FOUND)
 
 ## Check for NANOGUI
-find_package(NANOGUI QUIET)
+find_package(NANOGUIH QUIET)
+#message(FATAL_ERROR "nanogui not found. ${NANOGUI_INCLUDE_DIRS}")
 if (NANOGUI_FOUND)
   include_directories( ${NANOGUI_INCLUDE_DIRS})
 else (NANOGUI_FOUND)
@@ -150,6 +151,7 @@ file(GLOB SOURCES
 )
 
 add_library(igl STATIC ${SOURCES})
+set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "igl")
 
 #### Compile the AntTweakBar part
 if (ANTTWEAKBAR_FOUND)
@@ -157,6 +159,7 @@ if (ANTTWEAKBAR_FOUND)
     "${PROJECT_SOURCE_DIR}/../include/igl/anttweakbar/*.cpp"
   )
 add_library(iglanttweakbar STATIC ${SOURCES_ANTTWEAKBAR})
+set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglanttweakbar")
 endif (ANTTWEAKBAR_FOUND)
 
 #### Compile the BBW part
@@ -165,6 +168,7 @@ file(GLOB SOURCES_BBW
   "${PROJECT_SOURCE_DIR}/../include/igl/bbw/*.cpp"
 )
 add_library(iglbbw STATIC ${SOURCES_BBW})
+set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglbbw")
 
 #### Compile the mosek part
 if (MOSEK_FOUND)
@@ -172,6 +176,8 @@ if (MOSEK_FOUND)
     "${PROJECT_SOURCE_DIR}/../include/igl/mosek/*.cpp"
   )
 add_library(iglmosek STATIC ${SOURCES_MOSEK})
+set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglmosek")
+
 endif (MOSEK_FOUND)
 
 #### Compile the cgal part
@@ -181,6 +187,7 @@ if (CGAL_FOUND)
   )
 
 add_library(iglcgal STATIC ${SOURCES_CGAL})
+set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglcgal")
 
 #### Compile the boolean part
 if (NOT CORK_FOUND)
@@ -192,6 +199,8 @@ file(GLOB SOURCES_BOOLEAN
 )
 
 add_library(iglboolean STATIC ${SOURCES_BOOLEAN})
+set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglboolean")
+
 endif (CGAL_FOUND)
 
 #### Compile the embree part
@@ -201,6 +210,8 @@ if (EMBREE_FOUND)
   )
 
   add_library(iglembree STATIC ${SOURCES_EMBREE})
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglembree")
+
 endif (EMBREE_FOUND)
 
 #### Compile the lim part
@@ -210,6 +221,8 @@ if (LIM_FOUND)
   )
 
   add_library(igllim STATIC ${SOURCES_LIM})
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "igllim")
+
 endif (LIM_FOUND)
 
 #### Compile the matlab part
@@ -219,6 +232,8 @@ if (MATLAB_FOUND)
   )
 
   add_library(iglmatlab STATIC ${SOURCES_MATLAB})
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglmatlab")
+
 endif (MATLAB_FOUND)
 
 #### Compile the png part
@@ -227,6 +242,8 @@ if (PNG_FOUND AND YIMG_FOUND)
     "${PROJECT_SOURCE_DIR}/../include/igl/png/*.cpp"
   )
   add_library(iglpng STATIC ${SOURCES_PNG})
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglpng")
+
 endif (PNG_FOUND AND YIMG_FOUND)
 
 #### Compile the tetgen part
@@ -236,6 +253,8 @@ if (TETGEN_FOUND)
   )
 
   add_library(igltetgen STATIC ${SOURCES_TETGEN})
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "igltetgen")
+
 endif (TETGEN_FOUND)
 
 #### Compile the triangle part
@@ -245,6 +264,8 @@ if (TRIANGLE_FOUND)
   )
 
   add_library(igltriangle STATIC ${SOURCES_TRIANGLE})
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "igltriangle")
+
 endif (TRIANGLE_FOUND)
 
 #### Compile the xml part
@@ -254,6 +275,8 @@ if (TINYXML2_FOUND)
   )
 
   add_library(iglxml STATIC ${SOURCES_XML})
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglxml")
+
 endif (TINYXML2_FOUND)
 
 #### Compile the xml part
@@ -263,13 +286,20 @@ if (LIBCOMISO_FOUND)
   )
 
   add_library(iglcomiso STATIC ${SOURCES_COMISO})
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglcomiso")
+
 endif (LIBCOMISO_FOUND)
 
 #### Compile the viewer
-if (GLFW_FOUND AND NANOGUI_FOUND)
+if (NANOGUI_FOUND)
   file(GLOB SOURCES_VIEWER
     "${PROJECT_SOURCE_DIR}/../include/igl/viewer/*.cpp"
   )
 
   add_library(iglviewer STATIC ${SOURCES_VIEWER})
-endif (GLFW_FOUND AND NANOGUI_FOUND)
+  set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} "iglviewer")
+
+endif (NANOGUI_FOUND)
+
+# Pass the list of compiled libraries to the parent
+set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES} PARENT_SCOPE)

+ 1 - 1
tutorial/609_Boolean/CMakeLists.txt

@@ -11,7 +11,7 @@ remove_cxx_flag("-stdlib=libc++")
 
 # for some reason must come after cgal include. I think that it's overwriting
 # come flags like CXX_FLAGS
-set(CMAKELISTS_SHARED_INCLUDED FALSE)
+#set(CMAKELISTS_SHARED_INCLUDED FALSE)
 include("../CMakeLists.shared")
 
 set(SOURCES

+ 9 - 9
tutorial/CMakeLists.shared

@@ -25,9 +25,9 @@ set(CMAKE_COLOR_MAKEFILE ON)
 
 find_package(OpenGL REQUIRED)
 find_package(EIGEN REQUIRED)
-find_package(LIBIGL REQUIRED)
-find_package(NANOGUI REQUIRED)
-find_package(GLFW REQUIRED)
+find_package(GLFWH REQUIRED)
+#find_package(LIBIGL REQUIRED)
+#find_package(NANOGUI REQUIRED)
 
 if(NOT APPLE)
 	find_package(GLEW REQUIRED)
@@ -43,7 +43,7 @@ if(UNIX AND NOT APPLE)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx")
 endif(UNIX AND NOT APPLE)
 
-include_directories( ${NANOGUI_INCLUDE_DIRS} )
+#include_directories( ${NANOGUI_INCLUDE_DIRS} )
 
 
 if(NOT APPLE)
@@ -51,7 +51,7 @@ if(NOT APPLE)
 endif(NOT APPLE)
 
 include_directories( ${EIGEN_INCLUDE_DIR})
-include_directories( ${LIBIGL_INCLUDE_DIRS})
+#include_directories( ${LIBIGL_INCLUDE_DIRS})
 include_directories( ${GLFW_INCLUDE_DIR})
 include_directories(
 	/usr/local/include
@@ -84,7 +84,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" ST
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register")
 endif()
 
-set(SHARED_SOURCES ${LIBIGL_SOURCES})
+# set(SHARED_SOURCES ${LIBIGL_SOURCES})
 
 if(NOT APPLE)
 	set(SHARED_SOURCES ${SHARED_SOURCES} ${GLEW_SOURCES})
@@ -94,12 +94,12 @@ endif(NOT APPLE)
 
 
 set(SHARED_LIBRARIES
-		${LIBIGL_LIBRARIES}
+#		${LIBIGL_LIBRARIES}
 		${OPENGL_LIBRARIES}
-		${NANOGUI_LIBRARY}
+#		${NANOGUI_LIBRARY}
 		${EIGEN_LIBRARIES}
 		${GLEW_LIBRARIES}
-		${GLFW_LIBRARIES}
+#		${GLFW_LIBRARIES}
 )
 
 #message(FATAL_ERROR ${SHARED_LIBRARIES})

+ 17 - 0
tutorial/CMakeLists.txt

@@ -3,6 +3,8 @@ project(libigl_tutorials)
 
 message("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")
 
+SET(LIBIGL_USE_STATIC_LIBRARY 1)
+
 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../)
 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
 
@@ -19,6 +21,21 @@ find_package(TRIANGLE QUIET)
 message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
 include("CMakeLists.shared")
 
+#Compile libigl
+add_definitions(-DIGL_STATIC_LIBRARY)
+add_subdirectory("../optional" "libigl")
+include_directories("../include")
+
+#Compile nanogui
+add_subdirectory("../external/nanogui/" "nanogui")
+include_directories("../external/nanogui/include")
+include_directories("../external/nanogui/ext/nanovg/src")
+list(APPEND SHARED_LIBRARIES "nanogui" "glfw3")
+
+message(STATUS "Linking with: ${LIBIGL_LIBRARIES}")
+list(APPEND SHARED_LIBRARIES ${LIBIGL_LIBRARIES})
+
+
 # Chapter 1
 add_subdirectory("101_FileIO")
 add_subdirectory("102_DrawMesh")

+ 3 - 0
tutorial/cmake/FindGLFW.cmake

@@ -17,6 +17,9 @@ FIND_PATH(GLFW_INCLUDE_DIR GLFW/glfw3.h
     ${PROJECT_SOURCE_DIR}/../../libigl/external/glfw/include
     ${PROJECT_SOURCE_DIR}/../libigl/external/glfw/include
     ${PROJECT_SOURCE_DIR}/libigl/external/glfw/include
+    ${PROJECT_SOURCE_DIR}/../../libigl/external/nanogui/ext/glfw/include
+    ${PROJECT_SOURCE_DIR}/../libigl/external/nanogui/ext/glfw/include
+    ${PROJECT_SOURCE_DIR}/libigl/external/nanogui/ext/glfw/include
     /usr/local/include
     /usr/X11/include
     /usr/include

+ 44 - 0
tutorial/cmake/FindGLFWH.cmake

@@ -0,0 +1,44 @@
+#
+# Try to find GLFW library and include path.
+# Once done this will define
+#
+# GLFW_FOUND
+# GLFW_INCLUDE_DIR
+# GLFW_LIBRARIES
+#
+
+if(NOT GLFW_FOUND)
+
+FIND_PATH(GLFW_INCLUDE_DIR GLFW/glfw3.h
+  PATHS
+    ${PROJECT_SOURCE_DIR}/../../external/glfw/include
+    ${PROJECT_SOURCE_DIR}/../external/glfw/include
+    ${PROJECT_SOURCE_DIR}/external/glfw/include
+    ${PROJECT_SOURCE_DIR}/../../libigl/external/glfw/include
+    ${PROJECT_SOURCE_DIR}/../libigl/external/glfw/include
+    ${PROJECT_SOURCE_DIR}/libigl/external/glfw/include
+    ${PROJECT_SOURCE_DIR}/../../../libigl/external/nanogui/ext/glfw/include
+    ${PROJECT_SOURCE_DIR}/../../libigl/external/nanogui/ext/glfw/include
+    ${PROJECT_SOURCE_DIR}/../libigl/external/nanogui/ext/glfw/include
+    ${PROJECT_SOURCE_DIR}/libigl/external/nanogui/ext/glfw/include
+    /usr/local/include
+    /usr/X11/include
+    /usr/include
+    /opt/local/include
+    NO_DEFAULT_PATH
+    )
+
+SET(GLFW_FOUND "NO")
+IF (GLFW_INCLUDE_DIR)
+	SET(GLFW_FOUND "YES")
+ENDIF (GLFW_INCLUDE_DIR)
+
+if(GLFW_FOUND)
+  message(STATUS "Found GLFW: ${GLFW_INCLUDE_DIR} -- HEADERS ONLY")
+else(GLFW_FOUND)
+  if (NOT GLFW_FIND_QUIETLY)
+    message(FATAL_ERROR "could NOT find GLFW")
+  endif (NOT GLFW_FIND_QUIETLY)
+endif(GLFW_FOUND)
+
+endif(NOT GLFW_FOUND)

+ 1 - 0
tutorial/cmake/FindLIBIGL.cmake

@@ -35,6 +35,7 @@ endif(LIBIGL_INCLUDE_DIR)
 if(LIBIGL_USE_STATIC_LIBRARY)
   add_definitions(-DIGL_STATIC_LIBRARY)
   set(LIBIGL_LIB_DIRS
+   ${CMAKE_BINARY_DIR}/
    ${PROJECT_SOURCE_DIR}/../../lib
    ${PROJECT_SOURCE_DIR}/../lib
    ${PROJECT_SOURCE_DIR}/lib

+ 1 - 0
tutorial/cmake/FindNANOGUI.cmake

@@ -54,6 +54,7 @@ IF (NANOGUI_INCLUDE_DIR AND NANOGUI_LIBRARY)
   SET(NANOGUI_INCLUDE_DIRS
          ${NANOGUI_INCLUDE_DIR}
          ${NANOGUI_INCLUDE_DIR}/../ext/nanovg/src
+         ${NANOGUI_INCLUDE_DIR}/../ext/glfw/include
          )
 
 ENDIF (NANOGUI_INCLUDE_DIR AND NANOGUI_LIBRARY)

+ 46 - 0
tutorial/cmake/FindNANOGUIH.cmake

@@ -0,0 +1,46 @@
+#
+# Try to find NANOGUI library and include path.
+# Once done this will define
+#
+# NANOGUI_FOUND
+# NANOGUI_INCLUDE_DIR
+# NANOGUI_LIBRARY
+#
+
+if(NOT NANOGUI_FOUND)
+
+FIND_PATH(NANOGUI_INCLUDE_DIR nanogui/nanogui.h
+  PATHS
+    ${PROJECT_SOURCE_DIR}/../../external/nanogui/include
+    ${PROJECT_SOURCE_DIR}/../external/nanogui/include
+    ${PROJECT_SOURCE_DIR}/external/nanogui/include
+    ${PROJECT_SOURCE_DIR}/../../libigl/external/nanogui/include
+    ${PROJECT_SOURCE_DIR}/../libigl/external/nanogui/include
+    ${PROJECT_SOURCE_DIR}/libigl/external/nanogui/include
+    /usr/local/include
+    /usr/X11/include
+    /usr/include
+    /opt/local/include
+    NO_DEFAULT_PATH
+    )
+
+SET(NANOGUI_FOUND "NO")
+IF (NANOGUI_INCLUDE_DIR)
+	SET(NANOGUI_FOUND "YES")
+  SET(NANOGUI_INCLUDE_DIRS
+         ${NANOGUI_INCLUDE_DIR}
+         ${NANOGUI_INCLUDE_DIR}/../ext/nanovg/src
+         ${NANOGUI_INCLUDE_DIR}/../ext/glfw/include
+         )
+
+ENDIF (NANOGUI_INCLUDE_DIR)
+
+if(NANOGUI_FOUND)
+  message(STATUS "Found NANOGUI: ${NANOGUI_INCLUDE_DIR} -- HEADERS ONLY")
+else(NANOGUI_FOUND)
+  if (NOT NANOGUI_FIND_QUIETLY)
+    message(FATAL_ERROR "could NOT find NANOGUI")
+  endif (NOT NANOGUI_FIND_QUIETLY)
+endif(NANOGUI_FOUND)
+
+endif(NOT NANOGUI_FOUND)