cmake, premake, bakefile for wxWidgets application?

102 views
Skip to first unread message

Gerald Brandt

unread,
Apr 2, 2016, 11:27:50 AM4/2/16
to wx-users
Hi,

I've been maintaining separate projects for XCode, Visual Studio, and
Code::Blocks for quite some time. I'd like to simplify the process and
am looking at cmake, premake, or bakefile to help me.

My source tree is laid out fairly standard, with sub-dirs for specific
modules. The end result is a single executable. I prefer my object
modules to live outside my source tree (eg: src
/home/gbr/src/application object /home/gbr/obj/application).

My wxWidgets location varies, depending on what I need to do. For
example, /home/gbr/wxWidgets/build-release contains a GTK2 release build
of wxWidgets. Some of the others are
/home/gbr/wxWidgets/build-release-gtk3 or
/home/gbr/wxWidgets/build-debug and so on.

Which build system do you recommend, and how would I deal with multiple
wxWidgets builds in my home dir (using trunk), and wxWidgets installed
by the OS (eg: Ubuntu package manager). I do not want to use the OS
installed one.

Thanks for your help (and examples?)

Gerald

Fulvio Senore

unread,
Apr 2, 2016, 3:00:10 PM4/2/16
to wx-u...@googlegroups.com
I use CMake and I am very satisfied. Dealing with multiple wxWidgets
builds is simple: there is a variable for the wxWidgets path and you set
it when you first configure your project. Just choose different folders.

You can find a CMake example in the source code of this project:

https://sourceforge.net/p/vvvp/code/HEAD/tree/trunk/

Feel free to ask for help.

Fulvio Senore

Gerald Brandt

unread,
Apr 2, 2016, 4:30:56 PM4/2/16
to wx-u...@googlegroups.com
Hi,

I don't see where you specify the wxwidgets location. It may just be my
lack of knowledge on cmake, but...

Gerald

Fulvio Senore

unread,
Apr 2, 2016, 5:05:23 PM4/2/16
to wx-u...@googlegroups.com

Il 02/04/2016 22:30, Gerald Brandt ha scritto:
> Hi,
>
> I don't see where you specify the wxwidgets location. It may just be my
> lack of knowledge on cmake, but...
>
> Gerald
>

It's in the CMakeLists.txt file in the root folder. Just look at the
comments.

Fulvio

Gerald Brandt

unread,
Apr 2, 2016, 5:12:20 PM4/2/16
to wx-u...@googlegroups.com
Hi,

I'm REALLY new to cmake. I see this:

# look for wxWidgets
FIND_PACKAGE(wxWidgets REQUIRED html adv core base net aui xrc qa richtext )
INCLUDE(${wxWidgets_USE_FILE})
But I don't see where I specify my specific directories.

In my VS2013 projects (and XCode, and CodeBlocks), I was several builds, each with their own wxWidgets directory

Release : /home/gbr/wxwidgets/build-release
Debug: /home/gbr/wxWidgets/build-debug
Release GTK3: /home/gbr/wxWidgets/build-release-gtk3
Debug GTK3: /home/gbr/wxWidgets/build-debufg-gtk3
Release OSX
Debug OSX
Release MSW
Debug MSW

I also want builds for profiling, but those would use existing wxWidgets directories. Does that make sense?

Gerald

Gerald Brandt

unread,
Apr 2, 2016, 5:14:11 PM4/2/16
to wx-u...@googlegroups.com
Hmm, that came out weird. Ignore the strikethrough. and the top posting

Gerald
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to wx-users+u...@googlegroups.com
or visit http://groups.google.com/group/wx-users

Fulvio Senore

unread,
Apr 2, 2016, 5:22:54 PM4/2/16
to wx-u...@googlegroups.com
CMake has a rather steep learning curve.
First of all you really need to look at some tutorials to understand how
it works.
Years ago, when I learned it, the web site used to contains some good ones.

Anyway, the concept is that you feed the CMAke file to the CMake GUI
program that looks for libraries (and other things) and lets you edit
those values (for example the xWidgets path). Then the GUI program
creates the required build files.

Fulvio
Reply all
Reply to author
Forward
0 new messages