[CMake] FindwxWidgets.cmake, suggestion add option to pass to wx-config

Jorgen Bodde jorgen.maillist at gmail.com
Thu Nov 30 06:59:57 EST 2006


The wx-config being taken should be the wxWidgets version installed on
your system. If you tweak it by passing options you are forcing
another version which might not work.

Your solution can be handy if there are multiple wxWidgets versions on
your system, but a better way is:

- Compile wxWidgets and use wx-config to specify your options, and add
--prefix=... like

   wx-config --enable-debug --disable-shared
--prefix=/home/jorg/src/wxGTK-ansi-debug-static

- Then build wxWidgets
- Install without root privileges
- Make a shortcut in /usr/local/bin to the config you are currently using

Advantages are:
1) No system pollution because it is installed in your home dir
2) Multiple configs can be easily switched
3) Easy to clean up (simply remove the
/home/jorg/src/wxGTK-ansi-debug-static dir when done

It might not be what you want, but it works well.

Regards,
- Jorgen

On 11/29/06, Peter Visser <pervulgo at gmail.com> wrote:
> Hi,
>
> I'm using FindwxWidgets, currently it seems that it is not possible to
> specify options like version, debug static and so on. At least not for
> non-WIN32 (The documentation describes to specify arguments to nmake at
> build time.).
>
> Perhaps it is an idea  to pass options to wx-config. This could be done by
> making a small change to FindwxWidgets.cmake, for every call to wx-config
> add e.g. ${wxWidgets_WXCONFIG_OPTS}.
>
> --> ARGS "${wxWidgets_CONFIG_EXECUTABLE} ${wxWidgets_WXCONFIG_OPTS} --libs
> ${wxWidgets_USE_LIBS}"
>
> Then in the CMakelists.txt:
> ******************
> # wxWidgets_WXCONFIG_OPTS
> # Set options to pass to wx-config.
> # --debug=[yes/no]
> # --static=[yes/no]
> # --version=[2.6/2.8]
> # and so on
> #
>
> SET (wxWidgets_WXCONFIG_OPTS "--debug=no --static=no --version=2.6")
> *******************
>
> If options are not satisfied wxWidgets is not found.
> If the variable is not set, the behavior will not change.
>
> It is a very basic approach but it gives control over the wxWidgets options.
>
> Cheers,
>
> Peter.
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
>


More information about the CMake mailing list