cmake_minimum_required (VERSION 3.16) include(FetchContent) project(Flaschenray) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() #set(CMAKE_CXX_STANDARD 20) set(CMAKE_EXPORT_COMPILE_COMMANDS True) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -fopenmp") #set(CMAKE_CXX_FLAGS_RELEASE "-D_GLIBCXX_DEBUG -g3 -fopenmp -march=native -funroll-loops -std=c++20") set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fopenmp -march=native -funroll-loops -std=c++20") FetchContent_Declare( objloader GIT_REPOSITORY https://github.com/manuel5975p/OBJ-Loader ) FetchContent_GetProperties(objloader) if(NOT objloader_POPULATED) FetchContent_Populate(objloader) #add_subdirectory(${objloader_SOURCE_DIR} ${objloader_BINARY_DIR}) endif() FetchContent_Declare( lodepng GIT_REPOSITORY https://github.com/lvandeve/lodepng.git ) FetchContent_GetProperties(lodepng) if(NOT lodepng_POPULATED) FetchContent_Populate(lodepng) endif() FetchContent_Declare( xoshiro GIT_REPOSITORY https://github.com/manuel5975p/xoshiro-cpp.git ) FetchContent_GetProperties(xoshiro) if(NOT xoshiro_POPULATED) FetchContent_Populate(xoshiro) endif() add_executable(chnuscht main.cpp camera.cpp scene.cpp "${lodepng_SOURCE_DIR}/lodepng.cpp" ) target_include_directories(chnuscht PUBLIC "${objloader_SOURCE_DIR}/include") target_include_directories(chnuscht PUBLIC "${lodepng_SOURCE_DIR}") target_include_directories(chnuscht PUBLIC "${xoshiro_SOURCE_DIR}") option(EMBREE_TUTORIALS OFF FORCE) option(EMBREE_ISPC_SUPPORT OFF FORCE) set(EMBREE_TASKING_SYSTEM "kak" FORCE) FetchContent_Declare( embree GIT_REPOSITORY https://github.com/embree/embree/ ) FetchContent_GetProperties(embree) if(NOT embree_POPULATED) FetchContent_Populate(embree) add_subdirectory(${embree_SOURCE_DIR} ${embree_BINARY_DIR}) endif() target_link_libraries(chnuscht embree) #target_link_libraries(chnuscht tbb) #target_link_libraries(chnuscht "gomp") #target_link_libraries(chnuscht "sfml-system") #target_link_libraries(chnuscht "sfml-graphics") #target_link_libraries(chnuscht "sfml-window")