Hi all,

good thing with holidays is, that you have enough time for the experiments that 
take a lot of time.
So now it seems I have finished a first version of a Maven build that is able 
to compile the C++ API module which Markus provided us with.
I had to tweak the code a little, but now it seems I was able to build on 64bit 
machines with Mac, Linux (Ubuntu) and Windows 10.

In contrast to Java, C++ doesn’t have a nice an simple library repository. Also 
wouldn’t the binaries built on a mac be runnable on Windows for example.
Markus’ initial code used a library called “boost” which seems to provide a 
platform independent abstraction of some of the essential things we need 
(Sockets, Types, …)
So next to the “api” module is a “libs” module, which does nothing else than 
download an build any required third party libraries and to install them in the 
“libs/libs” directory.

This directory is then explicitly imported in the builds of the other modules 
(currently just the API)

As building the boost lib takes a very, very long time, I decided to have it 
only built, if the “libs/libs” directory is missing. So if you are building for 
the first time … get yourself a big cup of coffee.
Hopefully we’ll be able to strip that build down to the parts we need and not 
compile everything.

The build itself is performed with a tool called “CMake”. This claims to be a 
meta-build system that allows generating everything needed to build with a 
variety of other build systems.
On windows it requires a gcc compliant compiler to be installed. I decided to 
go down the mingw path. So if you want to build from the commandline with a 
Windows system, be sure to install that first and to add the bin directory of 
that to your systems PATH. 
(http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download)

Right now the module is not directly integrated to be automatically built with 
the rest of the project. In order to build the C++ part, just change the 
directory into the “plc4cpp” directory and do a “mvn install” in there.

I would be really happy for some feedback, as this stuff is a lot more 
complicated to configure than in my normal Java world.
I hope I got everything right.

So … then I’ll wish you all happy testing ;-)


Chris

Reply via email to