Browse Source

Matlab module.

Former-commit-id: cb11036dcf4ef471662265c1e7421d9a54e53f58
Jérémie Dumas 7 years ago
parent
commit
1ae6671b9c
4 changed files with 31 additions and 32 deletions
  1. 1 1
      .appveyor.yml
  2. 16 16
      .travis.yml
  3. 1 1
      shared/cmake/CMakeLists.txt
  4. 13 14
      shared/cmake/libigl.cmake

+ 1 - 1
.appveyor.yml

@@ -15,7 +15,7 @@ build_script:
   - cd c:\projects\libigl\tutorial
   - mkdir build
   - cd build
-  - cmake -D "LIBIGL_USE_STATIC_LIBRARY=ON" -G "Visual Studio 14 2015 Win64" ../
+  - cmake -D "LIBIGL_USE_STATIC_LIBRARY=ON" -D "LIBIGL_WITH_ANTTWEAKBAR=OFF" -G "Visual Studio 14 2015 Win64" ../
 #  - cmake -G "Visual Studio 14 2015 Win64" ../
   - set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
 #  - set MSBuildOptions=/v:m /p:Configuration=Release /logger:%MSBuildLogger%

+ 16 - 16
.travis.yml

@@ -9,14 +9,14 @@ matrix:
         - git submodule update --init --recursive
         - mkdir external/nanogui/ext/glfw/include/GL
         - wget --no-check-certificate -P external/nanogui/ext/glfw/include/GL http://www.opengl.org/registry/api/GL/glcorearb.h
-        # - cd python
-        # - mkdir build
-        # - cd build
-        # - cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 -DLIBIGL_WITH_EMBREE=OFF -DLIBIGL_USE_STATIC_LIBRARY=ON ../
-        # - make -j 2
-        # - cd ../tutorial
-        # - python 101_FileIO.py
-        # - cd ../../
+        - cd python
+        - mkdir build
+        - cd build
+        - cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 -DLIBIGL_WITH_EMBREE=OFF -DLIBIGL_USE_STATIC_LIBRARY=ON ../
+        - make -j 2
+        - cd ../tutorial
+        - python 101_FileIO.py
+        - cd ../../
         - cd tutorial
         - mkdir build
         - cd build
@@ -52,14 +52,14 @@ matrix:
         # - brew upgrade cmake
         # - brew upgrade cgal
         - git submodule update --init --recursive
-        # - cd python
-        # - mkdir build
-        # - cd build
-        # - cmake ../
-        # - make -j 2
-        # - cd ../tutorial
-        # - python 101_FileIO.py
-        # - cd ../../
+        - cd python
+        - mkdir build
+        - cd build
+        - cmake ../
+        - make -j 2
+        - cd ../tutorial
+        - python 101_FileIO.py
+        - cd ../../
         - cd tutorial
         - mkdir build
         - cd build

+ 1 - 1
shared/cmake/CMakeLists.txt

@@ -427,7 +427,7 @@ if(LIBIGL_WITH_PNG)
   set(STB_IMAGE_DIR "${LIBIGL_EXTERNAL}/stb_image")
   add_subdirectory("${STB_IMAGE_DIR}" "stb_image")
   list(APPEND LIBIGL_INCLUDE_DIRS ${STB_IMAGE_DIR})
-  list(APPEND LIBIGL_PNG_EXTRA_LIBRARIES "stb_image")
+  list(APPEND LIBIGL_PNG_EXTRA_LIBRARIES "igl_stb_image")
   list(APPEND LIBIGL_EXTRA_LIBRARIES ${LIBIGL_PNG_EXTRA_LIBRARIES})
   if(LIBIGL_USE_STATIC_LIBRARY)
     CompileIGL_Module("png" "")

+ 13 - 14
shared/cmake/libigl.cmake

@@ -184,10 +184,10 @@ if(LIBIGL_WITH_EMBREE)
   endif()
 
   if(MSVC)
-    add_custom_target(Copy-Embree-DLL ALL        # Adds a post-build event to MyTest
+    add_custom_target(Copy-Embree-DLL ALL # Adds a post-build event to MyTest
         COMMAND ${CMAKE_COMMAND} -E copy_if_different  # which executes "cmake - E copy_if_different..."
-          "${CMAKE_BINARY_DIR}/libigl/embree/$<CONFIGURATION>/embree.dll"      # <--this is in-file
-          "${CMAKE_BINARY_DIR}/embree.dll")                 # <--this is out-file path  endif()
+          "${CMAKE_BINARY_DIR}/libigl/embree/$<CONFIGURATION>/embree.dll" # <--this is in-file
+          "${CMAKE_BINARY_DIR}/embree.dll") # <--this is out-file path
   endif()
 
   compile_igl_module("embree" "")
@@ -212,17 +212,16 @@ endif()
 
 ################################################################################
 ### Compile the matlab part ###
-# if(LIBIGL_WITH_MATLAB)
-#   find_package(MATLAB REQUIRED)
-#   list(APPEND LIBIGL_INCLUDE_DIRS ${MATLAB_INCLUDE_DIR})
-#   list(APPEND LIBIGL_MATLAB_EXTRA_LIBRARIES ${MATLAB_LIBRARIES})
-#   list(APPEND LIBIGL_EXTRA_LIBRARIES ${LIBIGL_MATLAB_EXTRA_LIBRARIES})
-
-#   if(LIBIGL_USE_STATIC_LIBRARY)
-#     compile_igl_module("matlab" "")
-#     target_include_directories(igl_matlab PRIVATE ${MATLAB_INCLUDE_DIR})
-#   endif()
-# endif()
+if(LIBIGL_WITH_MATLAB)
+  find_package(MATLAB)
+  if(MATLAB_FOUND)
+    compile_igl_module("matlab" "")
+    target_link_libraries(igl_matlab ${IGL_SCOPE} ${MATLAB_LIBRARIES})
+    target_include_directories(igl_matlab ${IGL_SCOPE} ${MATLAB_INCLUDE_DIR})
+  else()
+    set(LIBIGL_WITH_MATLAB OFF CACHE BOOL "" FORCE)
+  endif()
+endif()
 
 ################################################################################
 ### Compile the mosek part ###