The OptiX SDK application framework sets the OPTIX_SAMPLE_NAME_DEFINE
and OPTIX_SAMPLE_DIR_DEFINE
automatically inside the macro OPTIX_add_sample_executable
of the root CMakeLists.txt.
set_target_properties( ${target_name} PROPERTIES
COMPILE_DEFINITIONS
"OPTIX_SAMPLE_NAME_DEFINE=${target_name};OPTIX_SAMPLE_DIR_DEFINE=${target_name}" )
The resulting OPTIX_SAMPLE_NAME
and OPTIX_SAMPLE_DIR
strings will hardly contain any of the MSVS built-in variables like $(ProjectDir)
. That need to be valid paths.
This is what I think about hardcoding build paths into executables inside the OptiX SDK example framework:
https://forums.developer.nvidia.com/t/optixhello-embeded-in-new-application-run-in-release-but-not-in-debug-mode/253037/4
https://forums.developer.nvidia.com/t/optix7-2-sutil-getptxstring/195507/2
https://forums.developer.nvidia.com/t/sdk-samples-sutil-getptxstring-file-path/70963/2