[CMake] How to find wxWidgets with cmake under Windows?

Miguel A. Figueroa-Villanueva miguelf at ieee.org
Sat Jul 5 16:53:22 EDT 2008


On Sat, Jul 5, 2008 at 12:40 PM, Bob Paddock wrote:
>
> I need to build wxWidgets, under Windows XP with MingW.
>
> I have a Linux CMakeLists.txt that works fine under Linux,
> but cmake 2.6 under Windows tells me "wxWidgets not found".
>
> I have installed wx288.exe that should have set the registry key,
> and I have set wxwin to point at C:\wxwidgets-2.8.8
>
> What does it take for cmake to find wxWidgets?

Hello Bob,

I hope you mean, "build a wxWidgets *app* with Windows XP with MinGW".
The FindwxWidgets module just finds the already built wxWidgets libs
to use in your app.

That said, I need to add the wxWidgets-2.8.8 prefix to the search
locations. I don't use the installer, so I don't get the registry
setting. Could you let me know what registry key has the install
location (C:\wxWidgets-2.8.8) so I can add it to the search path?
Something like:

[HKEY_LOCAL_MACHINE\SOFTWARE\...]:InstallDir

In the mean time, you can either change the wxWidgets_ROOT_DIR
location using the GUI to C:/wxWidgets-2.8.8 and it should detect
everything else or you can change the following piece of code in the
FindwxWidgets.cmake module:

  FIND_PATH(wxWidgets_ROOT_DIR
    NAMES include/wx/wx.h
    PATHS
      $ENV{wxWidgets_ROOT_DIR}
      $ENV{WXWIN}
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno
Setup: App Path]"  # WX 2.6.x
      C:/
      D:/
      $ENV{ProgramFiles}
    PATH_SUFFIXES
      wxWidgets-2.8.8                      # <--- add this location
      wxWidgets-2.8.7
      wxWidgets-2.8.6
      wxWidgets-2.8.5
      wxWidgets-2.8.4
      wxWidgets-2.8.3
      wxWidgets-2.8.2
      wxWidgets-2.8.1
      wxWidgets-2.8.0
      wxWidgets-2.7.4
      wxWidgets-2.7.3
      wxWidgets-2.7.2
      wxWidgest-2.7.1
      wxWidgets-2.7.0
      wxWidgets-2.7.0-1
      wxWidgets-2.6.3
      wxWidgets-2.6.2
      wxWidgets-2.6.1
      wxWidgets-2.5.4
      wxWidgets-2.5.3
      wxWidgets-2.5.2
      wxWidgets-2.5.1
      wxWidgets
    DOC "wxWidgets base/installation directory?"
    )

Hope this helps.

--Miguel


More information about the CMake mailing list