diff --git a/RenderingToolkit/Tutorial/PathTracingWithEmbree/cpu/CMakeLists.txt b/RenderingToolkit/Tutorial/PathTracingWithEmbree/cpu/CMakeLists.txt
index aca6784c66..9eeb2e5f39 100644
--- a/RenderingToolkit/Tutorial/PathTracingWithEmbree/cpu/CMakeLists.txt
+++ b/RenderingToolkit/Tutorial/PathTracingWithEmbree/cpu/CMakeLists.txt
@@ -6,21 +6,44 @@ if(DEFINED ENV{ONEAPI_ROOT})
set(ONEAPI_ROOT "$ENV{ONEAPI_ROOT}")
message(STATUS "ONEAPI_ROOT FROM ENVIRONMENT: ${ONEAPI_ROOT}")
else()
- if(WIN32)
- set(ONEAPI_ROOT "C:/Program Files (x86)/Intel/oneAPI")
- else()
- set(ONEAPI_ROOT /opt/intel/oneapi)
- endif()
- message(STATUS "ONEAPI_ROOT DEFAULT: ${ONEAPI_ROOT}")
+ message(FATAL_ERROR "ONEAPI_ROOT not set. Please use a vars script (.bat/.sh) from the oneAPI deployment directory")
endif(DEFINED ENV{ONEAPI_ROOT})
+set(EMBREE_BASE_DIR "")
+set(RKCOMMON_BASE_DIR "")
+set(TBB_BASE_DIR "")
+set(DEVUTILITIES_BASE_DIR "")
+set(COMPILERRUNTIMES_BASE_DIR "")
+set(PATHADDITIONS_DIRS "")
+if(EXISTS ${ONEAPI_ROOT}/oneapi-vars.sh OR EXISTS ${ONEAPI_ROOT}/oneapi-vars.bat)
+ set(EMBREE_BASE_DIR ${ONEAPI_ROOT})
+ set(RKCOMMON_BASE_DIR ${ONEAPI_ROOT})
+ set(TBB_BASE_DIR ${ONEAPI_ROOT})
+ set(DEVUTILITIES_BASE_DIR ${ONEAPI_ROOT})
+ #Compiler runtimes help for windows MSVS debugger DLL help only
+ set(COMPILERRUNTIMES_BASE_DIR ${ONEAPI_ROOT})
+ set(PATHADDITIONS_DIRS "PATH=%PATH%;${ONEAPI_ROOT}/bin")
+else()
+ set(EMBREE_BASE_DIR ${ONEAPI_ROOT}/embree/latest)
+ set(RKCOMMON_BASE_DIR ${ONEAPI_ROOT}/rkcommon/latest)
+ set(TBB_BASE_DIR ${ONEAPI_ROOT}/tbb/latest)
+ set(DEVUTILITIES_BASE_DIR ${ONEAPI_ROOT}/dev-utilities/latest)
+ #Compiler runtimes help for windows MSVS debugger DLL help only
+ set(COMPILERRUNTIMES_BASE_DIR ${ONEAPI_ROOT}/compiler/latest)
+endif(EXISTS ${ONEAPI_ROOT}/oneapi-vars.sh OR EXISTS ${ONEAPI_ROOT}/oneapi-vars.bat)
+
#tbb is used for tasking in this example
-find_package(TBB REQUIRED PATHS ${ONEAPI_ROOT})
+find_package(TBB REQUIRED PATHS ${TBB_BASE_DIR}/lib/cmake NO_DEFAULT_PATH)
-find_package(embree 4.0 REQUIRED PATHS ${ONEAPI_ROOT}/embree/latest/lib/cmake NO_DEFAULT_PATH)
+find_package(embree 4.0 REQUIRED PATHS ${EMBREE_BASE_DIR}/lib/cmake NO_DEFAULT_PATH)
#rkcommon objects for rendering are used in this example
-find_package(rkcommon REQUIRED CONFIG PATHS ${ONEAPI_ROOT}/rkcommon/latest/lib/cmake NO_DEFAULT_PATH)
+find_package(rkcommon REQUIRED CONFIG PATHS ${RKCOMMON_BASE_DIR}/lib/cmake NO_DEFAULT_PATH)
+
+if(PATHADDITIONS_DIRS STREQUAL "")
+ set(PATHADDITIONS_DIRS "PATH=%PATH%;${COMPILERRUNTIMES_BASE_DIR}/bin;${embree_DIR}/../../../bin;${rkcommon_DIR}/../../../bin;${tbb_DIR}/../../../bin;")
+endif(PATHADDITIONS_DIRS STREQUAL "")
+
if(MSVC)
set(CMAKE_CXX_STANDARD 11)
@@ -40,17 +63,18 @@ if (NOT CMAKE_BUILD_TYPE)
endif(NOT CMAKE_BUILD_TYPE)
endif(NOT MSVC)
-#stb headers are located in dev-utilities. oneAPI 2022.2 release and earlier: these header only libraries are distributed with the oneAPI Base Toolkit.
-include_directories(${ONEAPI_ROOT}/dev-utilities/latest/include)
+#stb headers are located in dev-utilities with the old oneAPI dires layout
+include_directories(${DEVUTILITIES_BASE_DIR}/include)
set(HEADERS src/CornellBox.h src/DefaultCubeAndPlane.h src/Geometry.h src/Lights.h src/Materials.h src/PathTracer.h src/Pool.h src/Renderer.h src/SceneGraph.h src/Sphere.h src/definitions.h src/RandomSampler.h)
add_executable(rkPathTracer src/rkPathTracer.cpp ${HEADERS})
if(MSVC)
+ message(STATUS "Using ${PATHADDITIONS_DIRS} for the MSVS Debugger env")
# Set MSVS debugger environment variables so it is easier to attach the MSVS debugger after altering the application
- set_target_properties(rkPathTracer
- PROPERTIES VS_DEBUGGER_ENVIRONMENT "PATH=%PATH%;${embree_DIR}/../../../bin;${rkcommon_DIR}/../../../bin;${tbb_DIR}/../../../bin;"
- )
+ set_target_properties(rkPathTracer
+ PROPERTIES VS_DEBUGGER_ENVIRONMENT ${PATHADDITIONS_DIRS}
+ )
endif(MSVC)
target_link_libraries(rkPathTracer PRIVATE embree TBB::tbb rkcommon::rkcommon)
diff --git a/RenderingToolkit/Tutorial/PathTracingWithEmbree/cpu/README.md b/RenderingToolkit/Tutorial/PathTracingWithEmbree/cpu/README.md
index ba98d4b1c3..1d2000e0c5 100644
--- a/RenderingToolkit/Tutorial/PathTracingWithEmbree/cpu/README.md
+++ b/RenderingToolkit/Tutorial/PathTracingWithEmbree/cpu/README.md
@@ -1,6 +1,6 @@
# Path Tracing with Intel® Embree Sample Program
-This sample program illustrates path tracing using Intel Embree from the Intel® oneAPI Rendering Toolkit (Render Kit).
+This sample program illustrates path tracing using Intel Embree from the Intel® Rendering Toolkit (Render Kit).
[](example-images/pathtracer-accu-cornell-spp1-accu4000-plength8-512x512.png)
@@ -33,17 +33,17 @@ Make sure to try the [rkRayTracer](../IntroToRayTracingWithEmbree) sample progra
| Minimum Requirements | Description |
|:-------------------- |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| OS | Linux* Ubuntu* 18.04
CentOS* 8 (or compatible)
Windows* 10
macOS* 10.15+ |
+| OS | Linux* Ubuntu* 18.04
CentOS* 8 (or compatible)
Windows* 10 or 11
macOS* 10.15+ |
| Hardware |