CMake找不到wxWigets [英] Cmake Could not find wxWigets

查看:592
本文介绍了CMake找不到wxWigets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用CMake在Windows上编译源代码,它使用wxWigets库。
我从以下页面下载了wxWigets: https://www.wxwidgets.org/

I want to compile a source code on windows using CMake, it uses wxWigets library. I downloaded the wxWigets from the page: https://www.wxwidgets.org/

通过Visual Studio构建后,我得到了库/ lib文件。
我已经为wxWidgets_LIBRARIES和wxWidgets_INCLUDE_DIRS设置了PATH。但是以下错误无法解决。

After building by Visual Studio, I got the library /lib file. I have already set PATH for wxWidgets_LIBRARIES and wxWidgets_INCLUDE_DIRS. But the following errors cannot be resolved.

CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
      Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
      wxWidgets_INCLUDE_DIRS)
    Call Stack (most recent call first):
      C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
      C:/Program Files/CMake/share/cmake-3.11/Modules/FindwxWidgets.cmake:953 (find_package_handle_standard_args)
      CMakeLists.txt:52 (find_package)

我还在以下内容中阅读了有关此问题的主题: CMake在Windows上找不到wxWidgets
但是没有解决方案

I also read the thread about this problem in: CMake could not find wxWidgets on Windows But there is no solution for my case.

推荐答案

您可以指定 wxWidgets_ROOT_DIR 变量以指向ÿ我们的wxWidgets安装。

You may specify wxWidgets_ROOT_DIR variable to point to your wxWidgets installation.

据我了解,您可以通过 -D 选项将CMake变量设置为 cmake

As far as I understand, you may set either CMake variable via -D option to cmake:

cmake -DwxWidgets_ROOT_DIR:PATH=D:/path/to/wxWidgets/ ...

或者您可以设置 environment 变量

set wxWidgets_ROOT_DIR=D:\path\to\wxWidgets\ ...

(请注意,CMake路径变量使用通用目录分隔符 /,而环境变量使用本机目录分隔符,对于Windows )。

(Note that CMake path variables use "universal" directory separator '/', but environment variables use native directory separator, '\' for Windows).

此变量在 FindwxWidget的文档

使用 wxWidgets_LIB_DIR 变量可能很棘手,请参阅该问题

Using wxWidgets_LIB_DIR variable could be tricky, see that question.

这篇关于CMake找不到wxWigets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆