Build System
Build System
Build System
As of 2021/02 :
**** 1A- Steps to compile freediag on win with MS Windows Visual Studio 2019/Visual
Studio Code ****
To compile freediag on win using these IDEs, the general process is as such
-extract the source tree (git clone, or a source package).
-make sure cmake version 3.10 or higher is installed and %PATH% holds the
cmake/bin directory.
Visual Studio 2019 has a cmake installation integrated so no extra action is
required.
-open the source directory from the IDE. Visual Studio 2019 has the option
"Open local folder" which
will start the cmake integration automatically. There is no need to generate
MSBuild project files
with cmake although this works as well. Visual Studio Code may suggest the
installation of serveral
extensions (e.g. C/C++ support, IntelliSense, CMake Tools).
-the cmake integration in both IDEs will guide you through the cmake
configuration process.
-Visual Studio Code will detect existing MinGW and Visual Studio Build Tool
installations. The
Borland/Embarcadero Compiler (e.g Embarcadero C++ Compiler Tools or C++
Builder Community Edition)
can be added manually. For Visual Studio 2019 the build targets x86/x64
Debug/Release are tested.
-After configuration start the build process in the IDE.
**** 1B- Steps to compile freediag on win with MS Windows Visual Studio 2019 for
Windows XP (toolset 141_xp) ****
To compile freediag on win using these IDEs, the general process is as such
-extract the source tree (git clone, or a source package).
-make sure cmake version 3.14 or higher is installed and %PATH% holds the
cmake/bin directory.
-from the Visual Studio 2019 installer install "MSVC v141 - VS 2017
C++x64/x86-Buildtools(v14.16)
and "C++-Windows XP-Support for Tools in VS 2017 (v141) [deprecated]".
-open a "x86 Native Tools Command Prompt for Visual Studio 2019" command
prompt.
-from the command prompt configure the project like is to build Windows XP
32bit binaries:
**** 1C- Steps to compile freediag on MS Windows using Cmake GUI and MinGW ****
The instructions given above for Win may be used almost as-is on linux; here are
methods without using
"cmake-gui"
-extract the source tree (git clone, or a source package) to <srcdir>
-make an empty build directory not far from the source tree, I recommend
<srcdir>/../<builddir>
-cd to builddir (important !!)
-As required, run "cmake -L" to view current cache values. This is
similar to "./configure --help".
-As required, run "cmake -D <var>:<type>=<value>" to modify one of the
previously listed values, such as
USE_RCFILE, etc. Example : "cmake -D USE_RCFILE:BOOL=ON"
then
-run make; or open IDE project file if applicable
Once the Makefiles are generated, it's usually not necessary to run cmake again
unless the CMakeLists.txt files
were changed, or build options were changed.
I added a CMake build system specifically to support WIN targets, as the GNU
autotools
(autoconf, ./configure & friends) are not trivial to use on MS platforms. CMake
should also make
other platforms (OSX) easier to support as well.
As distributed, the CMake build system for freediag consists of the following files
in the source tree :
sudo apt install wget unzip build-essential cmake g++ make pkg-config