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

Bob Paddock bob.paddock at gmail.com
Sat Jul 5 19:58:53 EDT 2008


> I hope you mean, "build a wxWidgets *app* with Windows XP with MinGW".

Yes, sorry.  Was feeling frustrated that something that I thought was going
to be simple wasn't.

> 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, 

Normally I don't either.  I only did it because it wasn't being found with
the WXWIN environment variable.   I usually just unzip because I frequently
build with different versions.

> 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

This is all I'm finding:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\wxWidgets_is1


> In the mean time, you can either change the wxWidgets_ROOT_DIR
> location using the GUI

wxWidgets_CONFIG_EXECUTABLE-NOTFOUND
wxWidgets_wxrc_EXECUTABLE-NOTFOUND

are the only two wxWidgets I see in 
C:\program files\cmake 2.6\bin\cmake-gui.exe 
even with 'show advanced settings' set.

Where should I be seeing wxWidgets_ROOT_DIR?


> 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}

Why did WXWIN not locate it?

> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninsta
>ll\\wxWidgets_is1;Inno Setup: App Path]"  # WX 2.6.x
>       C:/
>       D:/
>       $ENV{ProgramFiles}
>     PATH_SUFFIXES
>       wxWidgets-2.8.8                      # <--- add this location

Did that. Still doesn't find it.  :-(

I know it is at c:\wxWidgets-2.8.8 and works because I ran some of the sample 
programs after building it.

You have C:/wxW... above where I have C:\wxW...  does the direction of the
slash make a difference here?





More information about the CMake mailing list