Pārlūkot izejas kodu

LIM and Cork modules.

Former-commit-id: 1dd5e9a831673f19090c3efdec55f75014edcc82
Jérémie Dumas 7 gadi atpakaļ
vecāks
revīzija
ad8451ff1e

+ 21 - 32
shared/cmake/libigl.cmake

@@ -5,7 +5,7 @@ option(LIBIGL_USE_STATIC_LIBRARY    "Use libigl as static library" OFF)
 option(LIBIGL_WITH_ANTTWEAKBAR      "Use AntTweakBar"    ON)
 option(LIBIGL_WITH_CGAL             "Use CGAL"           ON)
 option(LIBIGL_WITH_COMISO           "Use CoMiso"         ON)
-option(LIBIGL_WITH_CORK             "Use Cork"           ON)
+option(LIBIGL_WITH_CORK             "Use Cork"           OFF)
 option(LIBIGL_WITH_EMBREE           "Use Embree"         ON)
 option(LIBIGL_WITH_LIM              "Use LIM"            ON)
 option(LIBIGL_WITH_MATLAB           "Use Matlab"         ON)
@@ -192,20 +192,17 @@ endif()
 
 ################################################################################
 ### Compile the cork parts ###
-# if(LIBIGL_WITH_CORK)
-#   set(CORK_DIR "${LIBIGL_EXTERNAL}/cork")
-#   set(CORK_INCLUDE_DIR "${CORK_DIR}/src")
-#   # call this "lib-cork" instead of "cork", otherwise cmake gets confused about
-#   # "cork" executable
-#   add_subdirectory("${CORK_DIR}" "lib-cork")
-#   list(APPEND LIBIGL_INCLUDE_DIRS "${CORK_INCLUDE_DIR}")
-#   list(APPEND LIBIGL_CORK_EXTRA_LIBRARIES "cork")
-#   list(APPEND LIBIGL_EXTRA_LIBRARIES ${LIBIGL_CORK_EXTRA_LIBRARIES})
-#   if(LIBIGL_USE_STATIC_LIBRARY)
-#     compile_igl_module("cork" "copyleft/")
-#     target_include_directories(igl_cork PRIVATE ${CORK_INCLUDE_DIR})
-#   endif()
-# endif()
+if(LIBIGL_WITH_CORK)
+  set(CORK_DIR "${LIBIGL_EXTERNAL}/cork")
+  if(NOT TARGET cork)
+    # call this "lib-cork" instead of "cork", otherwise cmake gets confused about
+    # "cork" executable
+    add_subdirectory("${CORK_DIR}" "lib-cork")
+  endif()
+  compile_igl_module("cork" "copyleft/")
+  target_include_directories(igl_cork ${IGL_SCOPE} cork)
+  target_include_directories(igl_cork ${IGL_SCOPE} "${CORK_DIR}/src")
+endif()
 
 ################################################################################
 ### Compile the embree part ###
@@ -252,23 +249,15 @@ endif()
 
 ################################################################################
 ### Compile the lim part ###
-# if(LIBIGL_WITH_LIM)
-#   set(LIM_DIR "${LIBIGL_EXTERNAL}/lim")
-#   add_subdirectory("${LIM_DIR}" "lim")
-#   list(APPEND LIBIGL_INCLUDE_DIRS ${LIM_DIR})
-#   ## it depends on ligigl, so placing it here solve linking problems
-#   #list(APPEND LIBIGL_LIBRARIES "lim")
-#   # ^--- Alec: I don't understand this comment. Does lim need to come before
-#   # libigl libraries? Why can't lim be placed where it belongs in
-#   # LIBIGL_EXTRA_LIBRARIES?
-#   set(LIBIGL_LIM_EXTRA_LIBRARIES "lim")
-#   list(APPEND LIBIGL_EXTRA_LIBRARIES "${LIBIGL_LIM_EXTRA_LIBRARIES}")
-
-#   if(LIBIGL_USE_STATIC_LIBRARY)
-#     compile_igl_module("lim" "")
-#     target_include_directories(igl_lim PRIVATE ${LIM_DIR})
-#   endif()
-# endif()
+if(LIBIGL_WITH_LIM)
+  set(LIM_DIR "${LIBIGL_EXTERNAL}/lim")
+  if(NOT TARGET lim)
+    add_subdirectory("${LIM_DIR}" "lim")
+  endif()
+  compile_igl_module("lim" "")
+  target_link_libraries(igl_lim ${IGL_SCOPE} lim)
+  target_include_directories(igl_lim ${IGL_SCOPE} ${LIM_DIR})
+endif()
 
 ################################################################################
 ### Compile the matlab part ###

+ 1 - 3
tutorial/608_LIM/CMakeLists.txt

@@ -2,6 +2,4 @@ cmake_minimum_required(VERSION 2.8.12)
 project(608_LIM)
 
 add_executable(${PROJECT_NAME}_bin main.cpp)
-target_include_directories(${PROJECT_NAME}_bin PRIVATE ${LIBIGL_INCLUDE_DIRS})
-target_compile_definitions(${PROJECT_NAME}_bin PRIVATE ${LIBIGL_DEFINITIONS})
-target_link_libraries(${PROJECT_NAME}_bin ${LIBIGL_LIBRARIES} ${LIBIGL_VIEWER_EXTRA_LIBRARIES} ${LIBIGL_OPENGL_EXTRA_LIBRARIES} ${LIBIGL_OPENGL_GLFW_EXTRA_LIBRARIES} ${LIBIGL_LIM_EXTRA_LIBRARIES})
+target_link_libraries(${PROJECT_NAME}_bin igl::core igl::lim igl::viewer tutorials)

+ 0 - 1
tutorial/609_Boolean/main.cpp

@@ -1,5 +1,4 @@
 #include <igl/readOFF.h>
-//#define IGL_NO_CORK
 //#undef IGL_STATIC_LIBRARY
 #include <igl/copyleft/cgal/mesh_boolean.h>
 #include <igl/viewer/Viewer.h>

+ 3 - 3
tutorial/CMakeLists.txt

@@ -124,9 +124,9 @@ if(TUTORIALS_CHAPTER6)
   if(LIBIGL_WITH_PNG)
     add_subdirectory("607_ScreenCapture")
   endif()
-  # if(LIBIGL_WITH_LIM)
-  #   add_subdirectory("608_LIM")
-  # endif()
+  if(LIBIGL_WITH_LIM)
+    add_subdirectory("608_LIM")
+  endif()
   if(LIBIGL_WITH_CGAL)
     add_subdirectory("609_Boolean")
     add_subdirectory("610_CSGTree")