From 1563ce13e336d2a5c8a03aaf06798f58b01a8aea Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Mon, 1 Jun 2015 16:16:35 +0200 Subject: [PATCH] move doc to sphinx --- README.md | 62 ------------------------------------------- doc/bootstrap.rst | 25 +++++++++++++++++ doc/cmakelists.rst | 28 +++++++++++++++++++ doc/customization.rst | 12 +++++++++ doc/index.rst | 9 +++++-- 5 files changed, 72 insertions(+), 64 deletions(-) create mode 100644 doc/bootstrap.rst create mode 100644 doc/cmakelists.rst create mode 100644 doc/customization.rst diff --git a/README.md b/README.md index afc788b..f0f305a 100644 --- a/README.md +++ b/README.md @@ -16,65 +16,3 @@ Licensed under [BSD-3](../master/LICENSE). - [Numgrid](https://github.com/bast/numgrid/) - [DIRAC](http://diracprogram.org) - - -## Bootstrapping a new project - -Download the ``bootstrap.py`` and execute it to fetch other infrastructure files -which will be needed to build the project: - - mkdir cmake # does not have to be called "cmake" - take the name you prefer - cd cmake - wget https://github.com/scisoft/autocmake/raw/master/bootstrap.py - python bootstrap.py --update - -This creates (or updates) the following files (an existing ``autocmake.cfg`` is -not overwritten by the script): - - cmake/ - ├── bootstrap.py # no need to edit - ├── autocmake.cfg # edit this file - └── lib/ - ├── config.py # no need to edit - └── docopt.py # no need to edit - -If you use version control, then now is a good moment to status/diff/add -the newly created files. - - -## Creating the CMake infrastructure - -Then edit ``autocmake.cfg`` and run the ``bootstrap.py`` script which -creates ``CMakeLists.txt`` and ``setup.py`` in the build path: - - python bootstrap.py .. - -The script also copies or downloads CMake modules specified in ``autocmake.cfg`` to a directory -called ``modules/``: - - cmake/ - ├── bootstrap.py - ├── autocmake.cfg - └── lib/ - ├── config.py - └── docopt.py - └── modules/ # CMakeLists.txt includes CMake modules from this directory - -Now you have ``CMakeLists.txt`` and ``setup.py`` in the project root and you can build -the project: - - cd .. - python setup.py [-h] - cd build - make - - -## Customizing the CMake modules - -The CMake modules can be customized directly inside ``modules/`` but this is -not very convenient as the customizations may be overwritten by the -``boostrap.py`` script. - -A better solution is to download the CMake modules that you wish you customize -to a separate directory and source the customized CMake modules in -``autocmake.cfg``. diff --git a/doc/bootstrap.rst b/doc/bootstrap.rst new file mode 100644 index 0000000..c913d97 --- /dev/null +++ b/doc/bootstrap.rst @@ -0,0 +1,25 @@ + + +Bootstrapping a new project +=========================== + +Download the ``bootstrap.py`` and execute it to fetch other infrastructure files +which will be needed to build the project:: + + mkdir cmake # does not have to be called "cmake" - take the name you prefer + cd cmake + wget https://github.com/scisoft/autocmake/raw/master/bootstrap.py + python bootstrap.py --update + +This creates (or updates) the following files (an existing ``autocmake.cfg`` is +not overwritten by the script):: + + cmake/ + ├── bootstrap.py # no need to edit + ├── autocmake.cfg # edit this file + └── lib/ + ├── config.py # no need to edit + └── docopt.py # no need to edit + +If you use version control, then now is a good moment to status/diff/add +the newly created files. diff --git a/doc/cmakelists.rst b/doc/cmakelists.rst new file mode 100644 index 0000000..7aea31f --- /dev/null +++ b/doc/cmakelists.rst @@ -0,0 +1,28 @@ + + +Generating the CMake infrastructure +=================================== + +Edit ``autocmake.cfg`` and run the ``bootstrap.py`` script which +creates ``CMakeLists.txt`` and ``setup.py`` in the build path:: + + python bootstrap.py .. + +The script also copies or downloads CMake modules specified in ``autocmake.cfg`` to a directory +called ``modules/``:: + + cmake/ + ├── bootstrap.py + ├── autocmake.cfg + └── lib/ + ├── config.py + └── docopt.py + └── modules/ # CMakeLists.txt includes CMake modules from this directory + +Now you have ``CMakeLists.txt`` and ``setup.py`` in the project root and you can build +the project:: + + cd .. + python setup.py [-h] + cd build + make diff --git a/doc/customization.rst b/doc/customization.rst new file mode 100644 index 0000000..dbfc96f --- /dev/null +++ b/doc/customization.rst @@ -0,0 +1,12 @@ + + +Customizing the CMake modules +============================= + +The CMake modules can be customized directly inside ``modules/`` but this is +not very convenient as the customizations may be overwritten by the +``boostrap.py`` script. + +A better solution is to download the CMake modules that you wish you customize +to a separate directory and source the customized CMake modules in +``autocmake.cfg``. diff --git a/doc/index.rst b/doc/index.rst index 1a9fb5c..099f5dc 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,6 +1,11 @@ Autocmake ---------- +========= -Write me ... +.. toctree:: + :maxdepth: 2 + + bootstrap.rst + cmakelists.rst + customization.rst