Unknown CMake command "OPTIX_add_sample_executable"

Bonjour à tous,

With my post debian7, cmake2.8.12 and OptiX3.5.1, when I try to compile the SDK sample “shadeTree” with CMake, I found this error :

CMake Error at CMakeLists.txt:45 (OPTIX_add_sample_executable):
  Unknown CMake command "OPTIX_add_sample_executable".

-- Configuring incomplete, errors occurred!
See also "/home/local/WorkSpace/shadeTree/build/CMakeFiles/CMakeOutput.log".

Maybe the problem can be solved after just finding the OptiX package. But I tried command like find_package(OPTIX) and apparently it doesn’t work.

Could anyone tell me how to make it?

Thanks in advance!

I guess you have tried to configure just the CMakeLists.txt within the shadeTree folder?
If so, without changing a lot, this is not possible. You need to tell CMake to configure the top-level CMakeLists.txt within the SDK folder. This will ensure that all packages are found and macros (such as OPTIX_add_sample_executable) are included correctly.

1 Like

I configure the top-level CMakeLists.txt and now everything works well.
Thanks a lot!

I have the same problem now.
I don’t know how to configure the top-level CMakelists.txt, can you help me out?

The solution is to use the CMakeLists.txt in the /SDK directory and not the ones in its child directories.