From 5086a5c82f9d4bf1e6708d3738bd747a688930bd Mon Sep 17 00:00:00 2001 From: Godzil Date: Mon, 17 Feb 2020 23:02:38 +0000 Subject: [PATCH] Use file/glob instead of set to add source files --- source/CMakeLists.txt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index dfb0cf0..074927c 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -3,13 +3,9 @@ # First most is build as a library add_library(rayonnement STATIC) -set(RAY_HEADERS include/tuple.h include/math_helper.h include/colour.h include/canvas.h - include/matrix.h include/transformation.h include/intersect.h include/intersection.h - include/light.h include/material.h - include/object.h include/ray.h include/sphere.h) -set(RAY_SOURCES tuple.cpp math_helper.cpp colour.cpp canvas.cpp matrix.cpp transformation.cpp intersect.cpp - objects/light.cpp objects/material.cpp - objects/object.cpp objects/ray.cpp objects/sphere.cpp) +file(GLOB RAY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h) + +file(GLOB RAY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/objects/*.cpp) target_include_directories(rayonnement PUBLIC include) target_sources(rayonnement PRIVATE ${RAY_HEADERS} ${RAY_SOURCES})