Setting up wxWidgets to compile with a custom project Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Karlovsky120
Knows some wx things
Knows some wx things
Posts: 26
Joined: Fri Dec 01, 2017 7:42 pm

Setting up wxWidgets to compile with a custom project

Post by Karlovsky120 »

Okay, I apologize for making two posts in a row, but this might just be simpler.

I want to build an application that uses wxWidgets.

However, I want to do proper version control via github, and I want portability regarding Windows 10, meaning that anyone with Windows 10 (and perhaps a few dependencies installed) should be able to clone my repository, open my main solution, compile and run it without any additional fuss.

The attempt I've made was done this way:

I created my own repository and created my solution in it. I've made wxWidgets a submodule of the repository. I've then included all of the appropriate versioned wxWidgets projects to my solution and set up the build order so they are all successfully built the first try. However, I had to mess with the _custom_build project in order to make it work (to deal with the location of setup.h), so this breaks it, since it will be reset when subomodule is cloned. This use to work for a while but it doesn't seem like a proper way of doing it.

So my question is, how do I add wxWidgets to my project as a submodule in a way that will work and will by buildable by anyone who clones the said repository?

I don't need details, I just need to know what are the general steps, what to use, where to research further, I just need something to go on.
Most of the tutorials go about how I can build it myself, but I have to set up a kind of automatic build process.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 550
Joined: Fri Nov 03, 2006 2:00 pm

Re: Setting up wxWidgets to compile with a custom project

Post by stahta01 »

How are you building wxWidgets and how are you building your project?

Why do you think having wxWidgets as a sub-module is the proper solution?

What wxWidgets branch is going to be used? Git master or what?

Edit: If you are using 3.0.3 or 3.1.1; is there any reason you can not ask your users to use the wxWidgets pre-built binaries?
https://github.com/wxWidgets/wxWidgets/ ... tag/v3.1.1

Tim S.
Karlovsky120
Knows some wx things
Knows some wx things
Posts: 26
Joined: Fri Dec 01, 2017 7:42 pm

Re: Setting up wxWidgets to compile with a custom project

Post by Karlovsky120 »

I have a solution with default x86/x64 and debug/release builds.
I want to build the static wxWidget equivalent when I build my project.

I want to make the repo self-sufficient so that anyone interested in the code who clones it has it working right of the bat. And the binaries are too big to be uploaded to the git with my project. A submodule way seemed like the best way to get what I want.

The users will have the binaries integrated into the my .exe anyway.

I'l use version >=3.1, but might update as I go along.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Setting up wxWidgets to compile with a custom project

Post by ONEEYEMAN »

Hi,
From what I heard CMake is properly capable of downloading the appropriate binaries and putting them at the proper place for the build. Didn'y actually tried it.
Remember that with submodules you will need a way to selec t an appropriate version of wx to use.

Thank you.
Karlovsky120
Knows some wx things
Knows some wx things
Posts: 26
Joined: Fri Dec 01, 2017 7:42 pm

Re: Setting up wxWidgets to compile with a custom project

Post by Karlovsky120 »

I ended up using is msbuild.exe as a prebuild command in my project:

Code: Select all

<Command>msbuild.exe "$(ProjectDir)dependencies\wxWidgets\build\msw\wx_vc15.sln" /t:Build /p:Configuration=$(Configuration);Platform=$(Platform);WindowsTargetPlatformVersion=$(WindowsTargetPlatformVersion)
This built the proper version of wxWidgets and ensured that the target windows SDK was the same as the one in my project.

I set the submodule to track the release commit of 3.1.1 from the git side of things.

I've managed to wipe the repo from my hard drive, clone it, and build it with just one click, just like I wanted.
Post Reply