March 13, 2017

Cross platform builds, thy name is CMake

When it comes to building cross platform C++ applications, I have had pretty good experience with CMake.

Below shows the general steps  in building your CMake structured app, once you have CMakeLists.txt defined.

mkdir build
cd build
cmake ../
make or nmake

What may change are options passed to CMake  such as -DBOOST_ROOT=”/usr/include/boost” or -DCMAKE_BUILD_TYPE=Debug for example. Ultimately this is pretty much my build workflow on Mac, Linux and Windows.

If you need more info, head on over to the CMake site and check out their documentation. A great place to start is their tutorial.