Add -a executable option to print the version of all dependencies + compilation related-modifications in terms of CMake internals and user options
This MR adds a function that prints the version of all dependencies, and a corresponding option in the argument parser for easy access (through the option "-a" or "--all-versions"). It also adds compilation options: USE_PYTHON
(default to OFF) and USE_VTK
(default to ON).
Here is an example of the table this new option prints:
$ mpm -a
mpm 0d2a902a
--------------------
Dependency Version
--------------------
GCC 11.4.0
G++ 11.4.0
Git 2.34.1
CMake 3.22.1
Boost 1_74
Eigen 4.0
TBB 2021.5.0
Python 3.10.12
VTK 9.1.0
Qt 5.15.3
MPI Disabled
--------------------
This MR also reorganizes the CMakeLists.txt
, by putting the parts of the code that are common to all 3 executables (mpm
, mpm-test
, and mpm-python
) into a static library mpm_src_lib
, which is later linked to each executable. Because of this change, the instanciation of all classes that were defined using the Factory
(e.g. all material classes, see material.cc) had to be wrapped into a mpm::registerXXXXX
function, which is called in the new registerEverything
function, which is itself called in the main of each executable (main.cc
, main_python.cc
, test_main.cc
).