我的CMakeLists.txt文件中有一些选项可以-D在命令行中选择,如下所示:
# Set some options the user may choose
OPTION(USE_MPI "Use the MPI library for parallelization" OFF)
OPTION(USE_OPENMP "Use OpenMP for parallelization" OFF)
OPTION(TESTING "Enable testing of both Fortran and Python code" OFF)
OPTION(PYTHON_TOOLS "Build the python helper tools" OFF)
OPTION(BUILD_DOCS "Build the documentation; turns on PYTHON_TOOLS" OFF)
Run Code Online (Sandbox Code Playgroud)
我可以用类似的东西激活其中一个
$ cmake . -DUSE_MPI=ON
Run Code Online (Sandbox Code Playgroud)
有时候我会忘记我选择的选项.如果有某种-h标志可以用来以自动方式在命令行上显示(以python的风格),那将是很好的argparse.
是否有自动生成特定CMakeLists.txt帮助文档的方法,和/或使用某种-h或--help标志调用该帮助?我正在寻找能给我这种行为的东西:
$ cmake . --help
USE_MPI - Use the MPI library for parallelization (Default: OFF)
USE_OPENMP - Use OpenMP for parallelization (Default: OFF)
TESTING - Enable testing of both Fortran and Python code (Default: OFF)
PYTHON_TOOLS - Build the python helper tools (Default: OFF)
BUILD_DOCS - Build the documentation; turns on PYTHON_TOOLS (Default: OFF)
Run Code Online (Sandbox Code Playgroud)
如果没有自动化的方式,有至少一个简单的方法来传递--help或-h到的CMakeLists.txt,这样我可以手动编写的帮助消息?
| 归档时间: |
|
| 查看次数: |
537 次 |
| 最近记录: |