Added brief discussion on how to use presets files with CMake

This commit is contained in:
Richard Berger
2018-08-14 11:51:37 -04:00
parent 3384c683df
commit 7ab11488d0

View File

@ -130,9 +130,35 @@ the Git or SVN repositories, no packages are pre-installed.
[CMake shortcuts for installing many packages]:
TODO: brief discussion of the cmake command line options with presets
that Axel or Richard enabled to install sets of packages at once?
Are these just for cmake, or also ccmake and cmake-gui?
Instead of specifying all the CMake options via the command-line, CMake allows
initializing the variable cache using script files. These are regular CMake
files which can manipulate and set variables, and can also contain control flow
constructs.
LAMMPS includes several of these files to define configuration "presets",
similar to the options that exist for the Make based system. Using these files
you can enable/disable portions of the available packages in LAMMPS. If you need a
custom preset you can take one of them as a starting point and customize it to your
needs.
cmake -C ../cmake/presets/all_on.cmake \[OPTIONS\] ../cmake | enable all packages
cmake -C ../cmake/presets/all_off.cmake \[OPTIONS\] ../cmake | disable all packages
cmake -C ../cmake/presets/std.cmake \[OPTIONS\] ../cmake | enable standard packages
cmake -C ../cmake/presets/user.cmake \[OPTIONS\] ../cmake | enable user packages
cmake -C ../cmake/presets/std_nolib.cmake \[OPTIONS\] ../cmake | enable standard packages that do not require extra libraries
cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake | disable all packages that do not require extra libraries
cmake -C ../cmake/presets/manual_selection.cmake \[OPTIONS\] ../cmake | example of how to create a manual selection of packages :tb(s=|,a=l)
NOTE: Running cmake this way manipulates the variable cache in your current
build directory. You can combine presets and options with multiple cmake runs.
[Example:]
# build LAMMPS with all "standard" packages which don't
# use libraries and enable GPU package
mkdir build
cd build
cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake :pre
:line