cmake problems, "Disabling cook, which requires glut and opengl."

I am trying to copy cook example as a starting point. I have copied contents of cook example to another directory at the same level. I added the new thing to the CMakeLists.txt file.

I was getting cmake refusal to do anything as the cache did not match my modified CMakeLists.txt file, but I think I fixed that by running ccmake

But now it does nothing for cook or my cook copy, saying

Disabling cook, which requires glut and opengl.

What is it looking for? I can run the precompiled cook (and every other OptiX sample I tried)
as well as the Cuda 6 samples, like simpleGL.

Linux mom 3.14.8-200.fc20.x86_64 #1 SMP Mon Jun 16 21:57:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Device 0: “GeForce GT 640”
CUDA Driver Version / Runtime Version 6.0 / 6.0


NVIDIA Driver Version: 331.79

The samples inside the OptiX SDK need to be built with the top-level CMakeLists.txt file in the SDK which does some general setups for the utilities and 3rd party libraries.
That file contains explanations how to add a new example isnide the OptiX SDK folder structure.

If you took the CMakeLists.txt inside a the individual example folder that setup wouldn’t have happened and builds are deemed to fail.
In your case it seems to not find the FreeGLUT and OpenGL libraries.
That error message is inside the cook folders CMakeLists.txt at the bottom.

In case you just copied the cook folder, have you also renamed the project name in that local CMakeLists.txt copy inside your new folder?

It should work if you clear the CMake cache, configure, and generate after adding a new folder with a copied and renamed example project when that had been added to the list of examples inside the top-level CMakeLists.txt in the block containing all the add_subdirector(your_example_folder_name)

yes, I changed the “cook” in the copied folder CMakeLists.txt to the new name of the new folder, and changed cook.cpp to newname.cpp .

What is cmake looking for to determine if it can find the FreeGLUT and OpenGL libraries? I have freeglut and freeglut-devel installed. I can actually run the precompiled cook, so I think all the libraries are actually installed. But cmake does not think they are there.

It will not even compile the original “cook”, saying that it cannot find (at least one of?) glut and opengl.

That the pre-built examples run only means the dynamic link libraries are found on your system, not that CMake can find the 3rd party SDK installations.

Could you compile the cook SDK example before you changed anything?
Only the cook example is complaining now (and that is not the error message from the coy?) but the others are still working?
If the answer is yes to either, you broke it.

As said, the error message come from the CMakeLists.txt inside the cook or your folder. It’s in the else-block of the condition if(GLUT_FOUND AND OPENGL_FOUND) and these two variables are set by CMake itself inside their own FindGLUT.cmake and FindOpenGL.cmake scripts somehow.
If you want to know what exactly CMake is searching for on your operating system look into them.

You could check which of the two are not found individually my adding message() calls printing these variables before that if-statement.

If that doesn’t help maybe try a newer CMake installation as well.