From 7ab11488d06505c53ecfab87974d8c3ffeb9ac7f Mon Sep 17 00:00:00 2001 From: Richard Berger <richard.berger@temple.edu> Date: Tue, 14 Aug 2018 11:51:37 -0400 Subject: [PATCH] Added brief discussion on how to use presets files with CMake --- doc/src/Build_package.txt | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/doc/src/Build_package.txt b/doc/src/Build_package.txt index cfaa39f331..3244e0f94a 100644 --- a/doc/src/Build_package.txt +++ b/doc/src/Build_package.txt @@ -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 -- GitLab