Wx-Config

From WxWiki

Jump to: navigation, search

[edit] wx-config

wx-config is a small command-line utility which can help you while building on unix-like systems.

 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version]
                  [--libs] [--gl-libs] [--cppflags] [--cflags] [--cxxflags]
                  [--cc] [--cxx] [--ld]
 
 wx-config returns configuration information about the installed
 version of wxWidgets. It may be used to query its version and
 installation directories and also retrieve the C and C++ compilers
 and linker which were used for its building and the corresponding
 flags.

Simple use might be something like this:

 `wx-config --cxx --cppflags` -o out *.cpp `wx-config --libs`

On Unix systems, wx-config may be a symlink to specific wx-config files for various wxWidgets ports/platforms (wxbase-2.5-config, wxgtk-2.5-config, ...).

So this is in fact how to switch between various ports (GTK, GTK2, X11, ...) for your build (I don't remember it being mentioned anywhere else before!).

Note that, while in 2.2 you could use '--cflags', using wxWidgets 2.4 and up you're required to use '--cxxflags' instead.

Note if you are using a version past 2.4.1, then there is also a --basename and --release option, which are helpful for write-once Makefiles (using the same makefile across linux and OSX and for different versions of the library like debug/nondebug unicode/non-unicode, gkt/mac).

The --release and --basename options appear in wxWidgets 2.4.2, but not in earlier versions.


[edit] Windows port

Now there is also a c++ wx-config Windows port, which works similar to this wx-config.

Personal tools