View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008993CMakeModulespublic2009-05-10 04:082010-11-09 22:57
Reporteruser790 
Assigned ToMiguel Figueroa 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionCMake 2.8.3Fixed in VersionCMake 2.8.3 
Summary0008993: FindwxWidgets.cmake always uses default toolkit
DescriptionHere is a quote of the message I sent on the user list:
<quote>
I am trying to use CMake to configure a very simple project that uses
wxWidgets, and I am running into a problem. The wxUSE_GUI flag is set to 0
in the Makefile generated by CMake and I therefore cannot use the GUI part
of wxWidgets.

Diving into FindwxWidgets.cmake, I see that compilation options are obtained
through wx-config. Options to wx-config are based on only four flags that I
can set or not in my CMakeLists.cmake, which are
wxWidgets_USE_{DEBUG,UNICODE,UNIVERSAL,STATIC}.

The problem is that on my Ubuntu 9.04, there are two wxWidgets configuration
in /usr/lib/wx/config. One is base-unicode-debug-2.8, the other is
gtk2-unicode-debug-2.8. The base configuration (which cannot be used for GUI
building) is the default configuration. And unfortunately, I cannot
discriminated both configurations with the four aforementionned parameters.
I am able to differentiate them only with the "--toolkit" option of
wx-config. But I cannot add this option to the wxWidgets_SELECT_OPTIONS
variable of FindwxWidgets.cmake.

What could be a work-around? I quickly browsed the wx-config script and it seems to me that the setting of 'base' as the default toolkit is more or less hard coded in it.
</quote>

On request of Miguel A. Figueroa-Villanueva, here is a command line that would return the correct configuration:

wx-config --toolkit=gtk2 --cppflags

A solution could be to add a wxWidgets_USE_TOOLKIT flag that would function just like the four others wxWidgets_USE_XXX flags, and that would enable the user to select whichever toolkit s/he wants from the set of installed ones.
TagsNo tags attached.
Attached Filesdiff file icon FindwxWidgets.diff [^] (1,341 bytes) 2010-04-23 14:41 [Show Content]

 Relationships

  Notes
(0020380)
Andreas Mohr (reporter)
2010-04-23 14:40

While wxWidgets_USE_TOOLKIT might be a good option, much more important is to actually have a free-form wxWidgets_CUSTOM_OPTIONS setting or some such,
to be able to afford _any_ future extensions of the wx-config command on the user side (and wx-config did change quite a bit in its history!).

I've done a rough form of just this in the attached patch (not sure whether wxWidgets_CUSTOM_OPTIONS is a perfect nomenclature though).

I've been grepping through all EXECUTE_PROCESSes in /usr/share/cmake-2.6/Modules/ , but surprisingly _not_ _a_ _single_ _one_ of those remembered to actually reserve the last-ditch bailout to the user, namely of manually specifying further options to use.
Might want to consider adding such an option to all upstream-distributed Find*.cmake modules.

I'm currently using this as:

# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'.
set(wxWidgets_CUSTOM_OPTIONS "--toolkit=gtk2")
find_package(wxWidgets_corrected COMPONENTS core base REQUIRED)
include_directories(${wxWidgets_INCLUDE_DIRS})
add_definitions(${wxWidgets_DEFINITIONS} ${wxWidgets_CXX_FLAGS})

and on a very first attempt this seems to work since on a VERBOSE=1 make it now does use wxGTK instead of the default selection of wxX11.
(0022093)
Miguel Figueroa (developer)
2010-09-05 09:51

commit ede24f817124293de7d1d22353c0e6e81f250ebe
Author: Miguel A. Figueroa-Villanueva <miguelf@ieee.org>
Date: Sun Sep 5 09:39:37 2010 -0400

    ENH 0008993: FindwxWidgets add support for wx-config custom options.
    
    Added suport for setting a custom toolkit, refix, etc. when using
    wx-config.

 Issue History
Date Modified Username Field Change
2009-05-10 04:08 user790 New Issue
2009-05-12 09:24 Miguel Figueroa Status new => assigned
2009-05-12 09:24 Miguel Figueroa Assigned To => Miguel Figueroa
2010-04-23 14:40 Andreas Mohr Note Added: 0020380
2010-04-23 14:41 Andreas Mohr File Added: FindwxWidgets.diff
2010-09-05 09:51 Miguel Figueroa Note Added: 0022093
2010-09-05 09:51 Miguel Figueroa Status assigned => resolved
2010-09-05 09:51 Miguel Figueroa Fixed in Version => CMake 2.8.3
2010-09-05 09:51 Miguel Figueroa Resolution open => fixed
2010-09-09 23:49 David Cole Target Version => CMake 2.8.3
2010-11-09 22:57 Philip Lowman Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team