Browse Source

nanogui bindings are now working on macosx

Former-commit-id: 0e18cb9becd0a5633aa67b17368bc9782503af3d
Daniele Panozzo 9 years ago
parent
commit
cd5d617ff3
3 changed files with 16 additions and 7 deletions
  1. 0 3
      .gitmodules
  2. 15 3
      python/CMakeLists.txt
  3. 1 1
      python/tutorial/106_ViewerMenu.py

+ 0 - 3
.gitmodules

@@ -6,9 +6,6 @@ url=https://github.com/libigl/nanogui.git
 [submodule "external/embree"]
 	path = external/embree
 	url = https://github.com/embree/embree.git
-[submodule "external/pybind11"]
-	path = external/pybind11
-	url = https://github.com/wjakob/pybind11.git
 [submodule "external/cgal"]
 	path = external/cgal
 	url = https://github.com/CGAL/cgal.git

+ 15 - 3
python/CMakeLists.txt

@@ -48,7 +48,7 @@ endif()
 include_directories(${PYTHON_INCLUDE_DIR} include)
 
 ## include pybind
-include_directories(${PROJECT_SOURCE_DIR}/../external/pybind11/include)
+include_directories(${PROJECT_SOURCE_DIR}/../external/nanogui/ext/pybind11/include)
 
 ## include libigl
 option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" OFF)
@@ -66,7 +66,7 @@ option(LIBIGL_WITH_PNG              "Use PNG"            ON)
 option(LIBIGL_WITH_TETGEN           "Use Tetgen"         ON)
 option(LIBIGL_WITH_TRIANGLE         "Use Triangle"       ON)
 option(LIBIGL_WITH_XML              "Use XML"            ON)
-option(LIBIGL_WITH_PYTHON           "Use Python"         OFF)
+option(LIBIGL_WITH_PYTHON           "Use Python"         ON)
 
 if(LIBIGL_WITH_CGAL) # Do not remove or move this block, cgal strange build system fails without it
   find_package(CGAL REQUIRED)
@@ -118,7 +118,7 @@ if (LIBIGL_WITH_PNG)
   list(APPEND SHARED_SOURCES "modules/py_igl_png.cpp")
 endif ()
 
-
+#----
 ## Prepare the python library
 add_library(pyigl SHARED
   python_shared.cpp
@@ -194,3 +194,15 @@ elseif (UNIX)
     endif()
   endif()
 endif()
+
+if (LIBIGL_WITH_PYTHON)
+  # Copy the nanogui python lib after compilation
+  get_target_property(NANOGUI_LIB nanogui_python LOCATION)
+  add_custom_target(copy ALL)
+  add_custom_command(
+        TARGET copy
+        COMMAND ${CMAKE_COMMAND} -E copy ${NANOGUI_LIB} ${CMAKE_CURRENT_BINARY_DIR}/../
+        )
+  add_dependencies(copy pyigl)
+
+endif()

+ 1 - 1
python/tutorial/106_ViewerMenu.py

@@ -80,4 +80,4 @@ def main():
 
 
 if __name__ == "__main__":
-    main()
+    main()