소스 검색

Compile tutorials with CGAL.

Former-commit-id: 68ade962fb6def8fed25d9d627406c93e3a34909
Jérémie Dumas 7 년 전
부모
커밋
77e75ce02a
3개의 변경된 파일32개의 추가작업 그리고 31개의 파일을 삭제
  1. 8 7
      include/igl/copyleft/cgal/insert_into_cdt.h
  2. 1 1
      shared/cmake/libigl.cmake
  3. 23 23
      tutorial/CMakeLists.txt

+ 8 - 7
include/igl/copyleft/cgal/insert_into_cdt.h

@@ -1,14 +1,15 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2016 Alec Jacobson
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// 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/.
 #ifndef IGL_COPYLEFT_CGAL_INSERT_INTO_CDT_H
 #define IGL_COPYLEFT_CGAL_INSERT_INTO_CDT_H
 #include "../../igl_inline.h"
 
+#include <CGAL/double.h> // Workaround https://github.com/CGAL/cgal/issues/2182 with CGAL 4.10-1
 #include <CGAL/Plane_3.h>
 #include <CGAL/Constrained_Delaunay_triangulation_2.h>
 #include <CGAL/Constrained_triangulation_plus_2.h>
@@ -33,7 +34,7 @@ namespace igl
       //   cdt  current CDT, see output
       // Outputs:
       //   cdt  CDT updated to contain constraints for the given object
-      // 
+      //
       template <typename Kernel>
       IGL_INLINE void insert_into_cdt(
         const CGAL::Object & obj,
@@ -46,8 +47,8 @@ namespace igl
               CGAL::Constrained_triangulation_face_base_2< Kernel>
             >,
             CGAL::Exact_intersections_tag
-          > 
-        > 
+          >
+        >
         & cdt);
     }
   }

+ 1 - 1
shared/cmake/libigl.cmake

@@ -175,7 +175,7 @@ if(LIBIGL_WITH_CGAL)
   compile_igl_module("cgal" "copyleft/")
   find_package(CGAL REQUIRED COMPONENTS Core)
   find_package(Boost 1.48 REQUIRED thread system)
-  target_link_libraries(igl_cgal ${IGL_SCOPE} CGAL::CGAL ${Boost_LIBRARIES})
+  target_link_libraries(igl_cgal ${IGL_SCOPE} CGAL::CGAL CGAL::CGAL_Core ${Boost_LIBRARIES})
 endif()
 
 ################################################################################

+ 23 - 23
tutorial/CMakeLists.txt

@@ -10,7 +10,7 @@ find_package(MATLAB QUIET)
 find_package(MOSEK)
 
 ### libIGL options: choose between header only and compiled static library
-option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" OFF)
+option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" ON)
 option(LIBIGL_WITH_VIEWER      "Use OpenGL viewer"  ON)
 option(LIBIGL_WITH_NANOGUI     "Use Nanogui menu"   OFF)
 
@@ -47,7 +47,7 @@ option(TUTORIALS_CHAPTER2 "Compile chapter 2" ON)
 option(TUTORIALS_CHAPTER3 "Compile chapter 3" ON)
 option(TUTORIALS_CHAPTER4 "Compile chapter 4" ON)
 option(TUTORIALS_CHAPTER5 "Compile chapter 5" ON)
-option(TUTORIALS_CHAPTER6 "Compile chapter 6" OFF)
+option(TUTORIALS_CHAPTER6 "Compile chapter 6" ON)
 option(TUTORIALS_CHAPTER7 "Compile chapter 7" OFF)
 
 # Store location of tutorial/shared directory
@@ -115,27 +115,27 @@ endif()
 
 # Chapter 6
 if(TUTORIALS_CHAPTER6)
-  if(LIBIGL_WITH_XML)
-    add_subdirectory("601_Serialization")
-  endif()
-  if(LIBIGL_WITH_MATLAB)
-    add_subdirectory("602_Matlab")
-  endif()
-  if(LIBIGL_WITH_TRIANGLE)
-    add_subdirectory("604_Triangle")
-  endif()
-  if(LIBIGL_WITH_TETGEN)
-    add_subdirectory("605_Tetgen")
-  endif()
-  if(LIBIGL_WITH_EMBREE)
-    add_subdirectory("606_AmbientOcclusion")
-  endif()
-  if(LIBIGL_WITH_PNG)
-    add_subdirectory("607_ScreenCapture")
-  endif()
-  if(LIBIGL_WITH_LIM)
-    add_subdirectory("608_LIM")
-  endif()
+  # if(LIBIGL_WITH_XML)
+  #   add_subdirectory("601_Serialization")
+  # endif()
+  # if(LIBIGL_WITH_MATLAB)
+  #   add_subdirectory("602_Matlab")
+  # endif()
+  # if(LIBIGL_WITH_TRIANGLE)
+  #   add_subdirectory("604_Triangle")
+  # endif()
+  # if(LIBIGL_WITH_TETGEN)
+  #   add_subdirectory("605_Tetgen")
+  # endif()
+  # if(LIBIGL_WITH_EMBREE)
+  #   add_subdirectory("606_AmbientOcclusion")
+  # endif()
+  # if(LIBIGL_WITH_PNG)
+  #   add_subdirectory("607_ScreenCapture")
+  # endif()
+  # if(LIBIGL_WITH_LIM)
+  #   add_subdirectory("608_LIM")
+  # endif()
   if(LIBIGL_WITH_CGAL)
     add_subdirectory("609_Boolean")
     add_subdirectory("610_CSGTree")