[CMake] How to find wxWidgets with cmake under Windows?
Werner Smekal
smekal at iap.tuwien.ac.at
Mon Jul 7 08:38:37 EDT 2008
Hi Bob,
I'm also using wxWidgets 2.8.7 with MinGW/CLI and as Miguel wrote, you
need to pass some extra parameters so that cmake can find wxWidgets. I
usually use the zipped wxWidgets package, set the WXWIN environment
variable, then compile it, and then pass the following to cmake:
cmake -DwxWidgets_LIB_DIR=%WXWIN%\lib\gcc_dll -
DwxWidgets_CONFIGURATION=msw ../path_to_source
I don't now if you need wxWidgets_CONFIGURATION, but I think you need
it if you want the debug version (-DwxWidgets_CONFIGURATION=mswd). If
it still doesn't work, you should enable the debug messages in share/
cmake-2.6/Modules/FindwxWidgets.cmake by uncommenting the relevant
parts between line 119 and 126. This usually gives a lot of
information and should give you enough hints, where the problem is.
To Miguel,
I use this solution ever since, but as you write this is actually a
bug/feature, since I think if you don't set the wxWidgets_LIB_DIR
macro, it assumes vc_dll which is wrong for mingw. So I would be happy
to do some tests, if this is of any help to you.
Regards,
Werner
On 06.07.2008, at 17:19, Miguel A. Figueroa-Villanueva wrote:
> On Sun, Jul 6, 2008 at 7:36 AM, Bob Paddock wrote:
>> On Sunday 06 July 2008 03:40:15 am Miguel A. Figueroa-Villanueva
>> wrote:
>>
>>> For unix and windows the CMakeLists.txt file
>>> should work transparently. It is just that it finds things
>>> differently. With windows it searches for it according to the
>>> standard
>>> places and finds each lib, etc. In unix (and in cygwin and msys also
>>> for that matter) it uses wx-config.
>>
>> A wx-config.exe for Windows dose exist:
>>
>> http://wxconfig.googlepages.com/
>>
>> Few know of it, it seems.
>
> I know of it, don't know if it is any good (i.e., up to date), but
> since many don't have it... can't rely on it for the module.
>
>>> http://www.cmake.org/files/vCVS/cmake-2.7.20080706-win32-x86.exe
>>
>> Installed that after uninstalling 2.6. It has a lot more wx entries,
>> all of which say "NOTFOUND".
>
> This is good. The process is that it finds the ROOT_DIR, then the
> LIB_DIR, then all the libs. You're getting closer to the libs ;)
>
>>> I'm unsure where MinGW will build the libs, since I don't use it...
>>
>> Download Mingw32 setup 5.1.4 and share the pain: :-)
>> http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780
>
> Yeah, maybe I'll need to do that... but this way I make a new
> friend ;)
>
>>> C:/wxwidgets-2.8.8/lib/mingw_lib
>
> Ok, I need to make a fix for this to be done automatically.
>
>> 'Build for: "MingGW Makefiles"'.
>>
>> C:/wxWidgets-2.8.8/lib/gcc_lib
>>
>> I got all of the Red entries to go away,
>> but it *still* tells me it can't find it.
>
> Send me a listing of the names of the libs in gcc_lib, so I can make a
> change to find them and then send you a modified version.
>
>> Does this mater?:
>> wxWidgets_wxrc_EXECUTABLE-NOTFOUND
>> I see no sign that it was built when I built wxwidgets.
>
> No, this is an optional tool that is not build by default, which you
> can find at C:/wxWidgets/utils/wxrc.
>
>>> If this is the case, then it won't find it automatically, but it
>>> will
>>> allow you to set wxWidgets_LIB_DIR to the correct path.
>>
>> Looks reasonable at C:/wxWidgets-2.8.8/lib/gcc_lib .
>
> But I suppose you set it manually to C:/wxWidgets-2.8.8/lib/gcc_lib,
> right?
>
>>> Remember to empty the build directory and start over from scratch
>>
>> Did that.
>
> --Miguel
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria
email: smekal at iap.tuwien.ac.at
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499
More information about the CMake
mailing list