CMake:找到用MinGW/MSYS构建的wxWidgets? [英] CMake: find wxWidgets built with MinGW/MSYS?

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

问题描述

我使用MinGW编译了wxWidgets 2.8.12.为了真正进行构建,我使用H:\ MinGW-libs的安装前缀通过MSYS Shell调用了与wxWidgets一起分发的autotools构建文件.

I compiled wxWidgets 2.8.12 using MinGW. To actually do the build I invoked the autotools build files distributed with wxWidgets through the MSYS shell, using an install prefix of H:\MinGW-libs.

结果是,我有一个Unix风格的文件树,其中包含wxWidgets标头和libs(它们是.a文件,而不是.dll),其根目录为H:\ MinGW-libs.

The result of this is that I have a Unix style file tree containing my wxWidgets headers and libs (which are .a files, not .dll) with root directory H:\MinGW-libs.

我的问题是我无法让CMake查找文件.当我尝试使用CMake gui中的配置"按钮时,它会发现其他依赖项(即boost,我必须为其指定BOOST_ROOT,但找不到wxWidgets.我看到wxWidgets_ROOT_DIR是我可以设置的可用常量,但是没有明显的选择

My problem is that I can't get CMake to find the files. When I try to use the "configure" button in the CMake gui it finds other dependencies (namely boost, for which I had to specify BOOST_ROOT, but it does not find wxWidgets. I see that wxWidgets_ROOT_DIR is an available constant that I can set but none of the obvious choices

H:\ MinGW-libs (我的wxWidgets安装前缀)

H:\MinGW-libs (my install prefix for wxWidgets)

H:\ MinGW-libs \ lib

H:\ MinGW-libs \ include

修复错误.

CMake邮件列表上有一个旧帖子关于此问题,但实际上没有任何信息表明如何在此用例中进行修复.我唯一的提示是,在"Unix样式"文件树和"Windows样式"文件树中寻找wxWidgets是有区别的.

There is an old post on the CMake mailing list about this issue but there isn't actually any information indicating how to fix it in this use case. The only hint I have is that there's a difference between looking for wxWidgets in "Unix style" file trees and "Windows style" file trees.

如何让CMake在Windows 7上的Unix样式文件树中找到安装的wxWidget?有没有办法让CMake使用wx-config?我之所以这么问,是因为从MSYS命令行使用wx-config获取lib和标头位置就可以了.

How can I get CMake to find wxWidgets installed in a Unix style file tree on Windows 7? Is there are way to get CMake to use wx-config? I ask this because from the MSYS command line using wx-config to get lib and header locations works just fine.

推荐答案

来自 FindwxWidgets.cmake :

if(WIN32 AND NOT CYGWIN AND NOT MSYS)
  set(wxWidgets_FIND_STYLE "win32")
else()
  if(UNIX OR MSYS)
    set(wxWidgets_FIND_STYLE "unix")
  endif()
endif()

因此,假定"MSYS Makefiles"生成器( cmake -G"MSYS Makefiles" )使用Unix风格的树,但不使用"MinGW Makefiles"生成器.您使用哪一个?

So Unix-style tree is assumed for the "MSYS Makefiles" generator (cmake -G "MSYS Makefiles") but not for the "MinGW Makefiles" generator. Which one do you use?

这篇关于CMake:找到用MinGW/MSYS构建的wxWidgets?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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