opencvcmakevisual-studio-2019cmake-gui

How to set ComputeCpp_DIR properly?


I recently installed ComputeCpp to D:/Programs/Codeplay/ComputeCpp. Then I set ComputeCpp_DIR="D:/Programs/Codeplay/ComputeCpp" in the CMakeLists.txt file for compiling OpenCV. I use cmake-gui.exe to configure build options and to generate the project files for Visual Studio 2019.

After each time I press Configure in cmake-gui.exe, the variable ComputeCpp_DIR is reset to ComputeCpp_DIR-NOTFOUND. The value "D:/Programs/Codeplay/ComputeCpp" is correct according to the official guide at https://developer.codeplay.com/products/computecpp/ce/guides/, i.e. "This should be set to the root directory of the ComputeCpp install (i.e the directory with the folders bin, include, lib)". The specified path does not contain any white space characters either. I also tried to modify build/CMakeCache.txt directly, but cmake-gui.exe keeps resetting my setting.

I wonder why?? How can I get cmake to accept my setting, which is apparently correct.


Solution

  • Add an empty ComputeCppConfig.cmake file into the D:/Programs/Codeplay/ComputeCpp directory. After that cmake-gui.exe will stop overwriting your setting.