diff --git a/CMakeLists.txt b/CMakeLists.txt index f3228b29b..ea4b7838b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,11 @@ cmake_minimum_required (VERSION 3.22) project (yocto_gl VERSION 4.0) -option(YOCTO_OPENGL "Build OpenGL apps" ON) -option(YOCTO_DENOISE "Build denoise app based on Intel OIDN" OFF) -option(YOCTO_EMBREE "Use Intel's Embree raytracer" OFF) -option(YOCTO_TESTING "Enable testing" ON) +option(YOCTO_APPS "Build apps" ON) +option(YOCTO_OPENGL "Enable OpenGL" ON) +option(YOCTO_DENOISE "Enable denoising with Intel's OIDN" OFF) +option(YOCTO_EMBREE "Enable ray casting with Intel's Embree" OFF) +option(YOCTO_TESTING "Enable testing" OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -28,4 +29,6 @@ endif(GENERATOR_IS_MULTI_CONFIG) add_subdirectory(exts) add_subdirectory(libs) -add_subdirectory(apps) +if(YOCTO_APPS) + add_subdirectory(apps) +endif(YOCTO_APPS) diff --git a/CMakePresets.json b/CMakePresets.json index 0b32dcae7..e386f5c91 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,6 +13,7 @@ "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "YOCTO_APPS": "ON", "YOCTO_EMBREE": "ON", "YOCTO_DENOISE": "ON", "YOCTO_OPENGL": "ON" @@ -29,6 +30,7 @@ "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", + "YOCTO_APPS": "ON", "YOCTO_EMBREE": "ON", "YOCTO_DENOISE": "ON", "YOCTO_OPENGL": "ON" @@ -45,6 +47,7 @@ "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "YOCTO_APPS": "ON", "YOCTO_EMBREE": "OFF", "YOCTO_DENOISE": "OFF", "YOCTO_OPENGL": "ON" @@ -61,6 +64,7 @@ "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", + "YOCTO_APPS": "ON", "YOCTO_EMBREE": "OFF", "YOCTO_DENOISE": "OFF", "YOCTO_OPENGL": "ON" diff --git a/libs/yocto/CMakeLists.txt b/libs/yocto/CMakeLists.txt index c38707f6f..f0d6225a2 100644 --- a/libs/yocto/CMakeLists.txt +++ b/libs/yocto/CMakeLists.txt @@ -17,6 +17,7 @@ add_library(yocto STATIC set_target_properties(yocto PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES) target_include_directories(yocto PRIVATE ext/) +target_include_directories(yocto PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") if(UNIX AND NOT APPLE) find_package(Threads REQUIRED) diff --git a/libs/yocto/yocto_mesh.cpp b/libs/yocto/yocto_mesh.cpp index 08bc11a1b..610901fbf 100644 --- a/libs/yocto/yocto_mesh.cpp +++ b/libs/yocto/yocto_mesh.cpp @@ -175,11 +175,11 @@ pair point_in_triangle(const vector& triangles, if (d == 0) return {false, zero2f}; b[2] = (d00 * d21 - d01 * d20) / d; - assert(!isnan(b[2])); + assert(!std::isnan(b[2])); b[1] = (d11 * d20 - d01 * d21) / d; - assert(!isnan(b[1])); + assert(!std::isnan(b[1])); b[0] = 1 - b[1] - b[2]; - assert(!isnan(b[0])); + assert(!std::isnan(b[0])); for (auto i = 0; i < 3; ++i) { if (b[i] < -tol || b[i] > 1.0 + tol) return {false, zero2f};