tutorial.cmake 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ## ======================================================================== ##
  2. ## Copyright 2009-2017 Intel Corporation ##
  3. ## ##
  4. ## Licensed under the Apache License, Version 2.0 (the "License"); ##
  5. ## you may not use this file except in compliance with the License. ##
  6. ## You may obtain a copy of the License at ##
  7. ## ##
  8. ## http://www.apache.org/licenses/LICENSE-2.0 ##
  9. ## ##
  10. ## Unless required by applicable law or agreed to in writing, software ##
  11. ## distributed under the License is distributed on an "AS IS" BASIS, ##
  12. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
  13. ## See the License for the specific language governing permissions and ##
  14. ## limitations under the License. ##
  15. ## ======================================================================== ##
  16. # additional parameters (beyond the name) are treated as additional dependencies
  17. # if ADDITIONAL_LIBRARIES is set these will be included during linking
  18. MACRO (ADD_TUTORIAL TUTORIAL_NAME)
  19. ADD_EXECUTABLE(${TUTORIAL_NAME} ${TUTORIAL_NAME}.cpp ${TUTORIAL_NAME}_device.cpp ${ARGN})
  20. TARGET_LINK_LIBRARIES(${TUTORIAL_NAME} embree tutorial image tutorial_device noise ${ADDITIONAL_LIBRARIES})
  21. SET_PROPERTY(TARGET ${TUTORIAL_NAME} PROPERTY FOLDER tutorials/single)
  22. INSTALL(TARGETS ${TUTORIAL_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
  23. SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_BINDIR}/${TUTORIAL_NAME}" "${TUTORIAL_NAME}")
  24. IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
  25. ADD_EMBREE_ISPC_EXECUTABLE(${TUTORIAL_NAME}_ispc ${TUTORIAL_NAME}.cpp ${TUTORIAL_NAME}_device.ispc)
  26. TARGET_LINK_LIBRARIES(${TUTORIAL_NAME}_ispc embree tutorial image tutorial_device_ispc noise noise_ispc)
  27. SET_PROPERTY(TARGET ${TUTORIAL_NAME}_ispc PROPERTY FOLDER tutorials/ispc)
  28. INSTALL(TARGETS ${TUTORIAL_NAME}_ispc DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
  29. SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_BINDIR}/${TUTORIAL_NAME}_ispc" "${TUTORIAL_NAME}_ispc")
  30. ENDIF()
  31. SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} PARENT_SCOPE)
  32. ENDMACRO ()