简体   繁体   English

如何正确设置 ComputeCpp_DIR?

[英]How to set ComputeCpp_DIR properly?

I recently installed ComputeCpp to D:/Programs/Codeplay/ComputeCpp .我最近将 ComputeCpp 安装到D:/Programs/Codeplay/ComputeCpp Then I set ComputeCpp_DIR="D:/Programs/Codeplay/ComputeCpp" in the CMakeLists.txt file for compiling OpenCV.然后我在CMakeLists.txt文件中设置ComputeCpp_DIR="D:/Programs/Codeplay/ComputeCpp"用于编译 OpenCV。 I use cmake-gui.exe to configure build options and to generate the project files for Visual Studio 2019.我使用cmake-gui.exe来配置构建选项并为 Visual Studio 2019 生成项目文件。

After each time I press Configure in cmake-gui.exe , the variable ComputeCpp_DIR is reset to ComputeCpp_DIR-NOTFOUND .每次按cmake-gui.exe中的Configure后,变量ComputeCpp_DIR都会重置为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/ , ie "This should be set to the root directory of the ComputeCpp install (ie the directory with the folders bin, include, lib)" .根据https://developer.codeplay.com/products/computecpp/ce/guides/的官方指南, "D:/Programs/Codeplay/ComputeCpp"的值是正确的,即“这应该设置为ComputeCpp 安装(即包含 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.我也尝试直接修改build/CMakeCache.txt ,但cmake-gui.exe一直在重置我的设置。

I wonder why??我想知道为什么?? How can I get cmake to accept my setting, which is apparently correct.我怎样才能让 cmake 接受我的设置,这显然是正确的。

Add an empty ComputeCppConfig.cmake file into the D:/Programs/Codeplay/ComputeCpp directory.将一个空的ComputeCppConfig.cmake文件添加到D:/Programs/Codeplay/ComputeCpp目录中。 After that cmake-gui.exe will stop overwriting your setting.之后cmake-gui.exe将停止覆盖您的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM