CMakeLists.txt 1.1 KB

12345678910111213141516171819202122232425
  1. # To simplify testing, the app is build in two passes,
  2. # First most is build as a library
  3. add_library(rayonnement STATIC)
  4. set(RAY_HEADERS include/tuple.h include/math_helper.h include/colour.h include/canvas.h
  5. include/matrix.h include/transformation.h include/intersect.h include/intersection.h
  6. include/light.h include/material.h
  7. include/object.h include/ray.h include/sphere.h)
  8. set(RAY_SOURCES tuple.cpp math_helper.cpp colour.cpp canvas.cpp matrix.cpp transformation.cpp intersect.cpp
  9. objects/light.cpp objects/material.cpp
  10. objects/object.cpp objects/ray.cpp objects/sphere.cpp)
  11. target_include_directories(rayonnement PUBLIC include)
  12. target_sources(rayonnement PRIVATE ${RAY_HEADERS} ${RAY_SOURCES})
  13. target_link_libraries(rayonnement LodePNG)
  14. # Second we build the main executable
  15. add_executable(dorayme main.cpp)
  16. target_include_directories(rayonnement PUBLIC include ${LODEPNG_INCLUDE_FOLDER})
  17. target_link_libraries(dorayme rayonnement)
  18. if (COVERALLS)
  19. set(COVERAGE_SRCS ${RAY_HEADERS} ${RAY_SOURCES} ${COVERAGE_SRCS} PARENT_SCOPE)
  20. endif()