CMakeLists.txt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. cmake_minimum_required(VERSION 3.1)
  2. project(libigl)
  3. option(LIBIGL_BUILD_TESTS "Build libigl unit test" OFF)
  4. option(LIBIGL_BUILD_TUTORIALS "Build libigl tutorial" OFF)
  5. option(LIBIGL_BUILD_PYTHON "Build libigl python bindings" OFF)
  6. # USE_STATIC_LIBRARY speeds up the generation of multiple binaries,
  7. # at the cost of a longer initial compilation time
  8. # (by default, static build is off since libigl is a header-only library)
  9. option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" ON)
  10. # All dependencies that are downloaded as cmake projects and tested on the auto-builds are ON
  11. # (by default, all build options are off)
  12. option(LIBIGL_WITH_CGAL "Use CGAL" ON)
  13. option(LIBIGL_WITH_COMISO "Use CoMiso" ON)
  14. option(LIBIGL_WITH_EMBREE "Use Embree" ON)
  15. option(LIBIGL_WITH_OPENGL "Use OpenGL" ON)
  16. option(LIBIGL_WITH_OPENGL_GLFW "Use GLFW" ON)
  17. option(LIBIGL_WITH_OPENGL_GLFW_IMGUI "Use ImGui" ON)
  18. option(LIBIGL_WITH_PNG "Use PNG" ON)
  19. option(LIBIGL_WITH_TETGEN "Use Tetgen" ON)
  20. option(LIBIGL_WITH_TRIANGLE "Use Triangle" ON)
  21. option(LIBIGL_WITH_VIEWER "Use OpenGL viewer" ON)
  22. option(LIBIGL_WITH_XML "Use XML" ON)
  23. option(LIBIGL_WITH_PYTHON "Use Python" ${LIBIGL_BUILD_PYTHON})
  24. ### End
  25. # These ensure that lib*.a are placed in the directory where `cmake
  26. # ../optional/` was issued.
  27. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
  28. set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
  29. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
  30. ### conditionally compile certain modules depending on libraries found on the system
  31. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
  32. ### Adding libIGL: choose the path to your local copy libIGL
  33. include(libigl)
  34. if(LIBIGL_BUILD_TUTORIALS)
  35. add_subdirectory(tutorial)
  36. endif()
  37. if(LIBIGL_BUILD_TESTS)
  38. add_subdirectory(tests)
  39. endif()
  40. if(LIBIGL_WITH_PYTHON)
  41. add_subdirectory(python)
  42. endif()