igl_add_tutorial.cmake 562 B

123456789101112131415161718
  1. function(igl_add_tutorial name)
  2. # Only create tutorial if dependencies have been enabled in the current build
  3. foreach(module IN ITEMS ${ARGN})
  4. if(NOT TARGET ${module})
  5. return()
  6. endif()
  7. endforeach()
  8. message(STATUS "Creating libigl tutorial: ${name}")
  9. add_executable(${name} ${CMAKE_CURRENT_SOURCE_DIR}/${name}/main.cpp)
  10. target_link_libraries(${name} PRIVATE
  11. igl::core
  12. igl::tutorial_data
  13. ${ARGN}
  14. )
  15. set_target_properties(${name} PROPERTIES FOLDER Libigl_Tutorials)
  16. endfunction()