cloudy-raytracer/CMakeLists.txt

100 lines
3 KiB
CMake
Raw Normal View History

2022-10-28 09:31:13 +02:00
cmake_minimum_required(VERSION 3.5)
project(CG1_Tracer LANGUAGES CXX)
2022-11-11 14:27:43 +01:00
set(CMAKE_CXX_STANDARD 17)
2022-10-28 09:31:13 +02:00
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-O3 -pthread")
2022-10-28 09:31:13 +02:00
if(NOT WIN32)
find_package(Threads REQUIRED)
find_package(X11 REQUIRED)
endif()
# This directory
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
if(APPLE)
include_directories(AFTER "/opt/X11/include")
endif()
# which source files to use
file(GLOB common_src "common/*.cpp")
file(GLOB noise_src "common/noise/*.cpp")
2022-10-28 09:31:13 +02:00
file(GLOB camera_src "camera/*.cpp")
file(GLOB light_src "light/*.cpp")
file(GLOB primitive_src "primitive/*.cpp")
file(GLOB renderer_src "renderer/*.cpp")
file(GLOB scene_src "scene/*.cpp")
file(GLOB shader_src "shader/*.cpp")
file(GLOB post_processing_src "post_processing/*.cpp")
file(GLOB homework_src "homeworkMains/*.cpp")
2022-10-28 09:31:13 +02:00
# The tracey library
add_library(tracey STATIC ${common_src} ${noise_src} ${camera_src} ${light_src}
${primitive_src} ${renderer_src} ${scene_src} ${shader_src}
${post_processing_src} ${homework_src})
2022-10-28 09:31:13 +02:00
if(NOT WIN32)
target_link_libraries(tracey ${CMAKE_THREAD_LIBS_INIT} ${X11_LIBRARIES})
endif()
# Executables
2023-01-27 13:49:07 +01:00
add_executable(beautifulScene beautifulScene.cpp)
target_link_libraries(beautifulScene tracey)
2023-01-29 21:50:01 +01:00
add_executable(beautifulSceneEpic beautifulSceneEpic.cpp)
target_link_libraries(beautifulSceneEpic tracey)
add_executable(beautifulSceneDark beautifulSceneDark.cpp)
target_link_libraries(beautifulSceneDark tracey)
add_executable(tracey_ex1 homeworkMains/ex1.cpp)
2022-10-28 09:31:13 +02:00
target_link_libraries(tracey_ex1 tracey)
add_executable(tracey_ex2 homeworkMains/ex2.cpp)
2022-11-11 14:39:48 +01:00
target_link_libraries(tracey_ex2 tracey)
add_executable(tracey_ex3_1 homeworkMains/ex3.cpp)
2022-11-18 11:48:08 +01:00
target_link_libraries(tracey_ex3_1 tracey)
target_compile_definitions(tracey_ex3_1 PUBLIC SITUATION=1)
add_executable(tracey_ex3_2 homeworkMains/ex3.cpp)
2022-11-18 11:48:08 +01:00
target_link_libraries(tracey_ex3_2 tracey)
target_compile_definitions(tracey_ex3_2 PUBLIC SITUATION=2)
if("${CMAKE_CURRENT_LIST_DIR}/light/ambientlight.cpp" IN_LIST light_src)
add_definitions(-DAMBIENTLIGHT_FOUND)
endif()
if("${CMAKE_CURRENT_LIST_DIR}/light/spotlight.cpp" IN_LIST light_src)
add_definitions(-DSPOTLIGHT_FOUND)
endif()
if("${CMAKE_CURRENT_LIST_DIR}/primitive/objmodel.cpp" IN_LIST primitive_src)
add_definitions(-DOBJMODEL_FOUND)
endif()
add_executable(tracey_ex4 homeworkMains/ex4.cpp)
2022-11-25 14:58:29 +01:00
target_link_libraries(tracey_ex4 tracey)
2022-10-28 09:31:13 +02:00
add_executable(tracey_ex5 homeworkMains/ex5.cpp)
2022-12-06 13:49:37 +01:00
target_link_libraries(tracey_ex5 tracey)
add_executable(tracey_ex6 homeworkMains/ex6.cpp)
2022-12-10 18:26:31 +01:00
target_link_libraries(tracey_ex6 tracey)
if("${CMAKE_CURRENT_LIST_DIR}/renderer/superrenderer.cpp" IN_LIST renderer_src)
add_definitions(-DSUPERRENDERER_FOUND)
endif()
add_executable(fancy1 fancy1.cpp)
target_link_libraries(fancy1 tracey)
add_executable(bloom bloom.cpp)
target_link_libraries(bloom tracey)
add_executable(DOFScene DOFScene.cpp)
target_link_libraries(DOFScene tracey)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
2022-10-28 09:31:13 +02:00
2022-11-11 14:27:43 +01:00