If you find the CMake script using the nvcuda_compile_module.cmake, which BTW can translate to PTX and OptiX-IR intermediate representations, too involved, have a look at the GLTF_renderer example which is using native CMake features namely LANGUAGES CUDA for native CUDA kernels and a CMake “Object Library” for the OptiX device code.
Read this post and the linked one in there for explanations:
https://forums.developer.nvidia.com/t/optix-advanced-samples-on-github/48410/19
See the dedicated README.md for similar information.
In any case, the advanced examples always use the CMake-provided FindCUDAToolkit.cmake to determine the CUDA SDK installation on your system. There is some hierarchy of methods that uses to find that, but under Windows, it normally boils down to the folder referenced by the CUDA_PATH environment variable.