Skip to content

Commit

Permalink
add recipe titles to cross-refs and monospace commands
Browse files Browse the repository at this point in the history
  • Loading branch information
bast committed Sep 20, 2018
1 parent 407f82d commit 384c32b
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 26 deletions.
10 changes: 5 additions & 5 deletions chapter-06/recipe-02/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

In this recipe, we generate `print_info.c` from the template `print_info.c.in`
by emulating the CMake function
[configure_file](https://cmake.org/cmake/help/latest/command/configure_file.html)
[`configure_file`](https://cmake.org/cmake/help/latest/command/configure_file.html)
with a custom Python script.

The goal of this recipe is to learn how we can generate source code at
configure time.

We should point out that this recipe has a serious limitation and cannot
emulate
[configure_file](https://cmake.org/cmake/help/latest/command/configure_file.html)
[`configure_file`](https://cmake.org/cmake/help/latest/command/configure_file.html)
fully. The approach that we present here cannot generate an automatic
dependency which would regenerate `print_info.c` at build time. In other words,
if you remove the generated `print_info.c` after the configure step, this file
will not be regenerated and the build step will fail. To proper mimic the
behavior of
[configure_file](https://cmake.org/cmake/help/latest/command/configure_file.html)
[`configure_file`](https://cmake.org/cmake/help/latest/command/configure_file.html)
we would require
[add_custom_command](https://cmake.org/cmake/help/latest/command/add_custom_command.html)
[`add_custom_command`](https://cmake.org/cmake/help/latest/command/add_custom_command.html)
and
[add_custom_target](https://cmake.org/cmake/help/latest/command/add_custom_target.html),
[`add_custom_target`](https://cmake.org/cmake/help/latest/command/add_custom_target.html),
which we will use in the subsequent [Recipe 3, *Generating source code at build
time using Python*](../recipe-03), where we will overcome this limitation.

Expand Down
10 changes: 5 additions & 5 deletions chapter-06/recipe-02/abstract.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
In this recipe, we generate `print_info.c` from the template `print_info.c.in`
by emulating the CMake function
[configure_file](https://cmake.org/cmake/help/latest/command/configure_file.html)
[`configure_file`](https://cmake.org/cmake/help/latest/command/configure_file.html)
with a custom Python script.

The goal of this recipe is to learn how we can generate source code at
configure time.

We should point out that this recipe has a serious limitation and cannot
emulate
[configure_file](https://cmake.org/cmake/help/latest/command/configure_file.html)
[`configure_file`](https://cmake.org/cmake/help/latest/command/configure_file.html)
fully. The approach that we present here cannot generate an automatic
dependency which would regenerate `print_info.c` at build time. In other words,
if you remove the generated `print_info.c` after the configure step, this file
will not be regenerated and the build step will fail. To proper mimic the
behavior of
[configure_file](https://cmake.org/cmake/help/latest/command/configure_file.html)
[`configure_file`](https://cmake.org/cmake/help/latest/command/configure_file.html)
we would require
[add_custom_command](https://cmake.org/cmake/help/latest/command/add_custom_command.html)
[`add_custom_command`](https://cmake.org/cmake/help/latest/command/add_custom_command.html)
and
[add_custom_target](https://cmake.org/cmake/help/latest/command/add_custom_target.html),
[`add_custom_target`](https://cmake.org/cmake/help/latest/command/add_custom_target.html),
which we will use in the subsequent [Recipe 3, *Generating source code at build
time using Python*](../recipe-03), where we will overcome this limitation.
4 changes: 2 additions & 2 deletions chapter-06/recipe-05/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Recording the project version from a file

The goal of this recipe is similar to [Recipe 4](../recipe-04), but the
starting point is different; our plan is to read the version information from a
The goal of this recipe is similar to [Recipe 4, *Recording the project version information for reproducibility*](../recipe-04),
but the starting point is different; our plan is to read the version information from a
file, rather than setting it inside of `CMakeLists.txt`.

The motivation for keeping the version in a separate file, outside of CMake
Expand Down
4 changes: 2 additions & 2 deletions chapter-06/recipe-05/abstract.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The goal of this recipe is similar to [Recipe 4](../recipe-04), but the
starting point is different; our plan is to read the version information from a
The goal of this recipe is similar to [Recipe 4, *Recording the project version information for reproducibility*](../recipe-04),
but the starting point is different; our plan is to read the version information from a
file, rather than setting it inside of `CMakeLists.txt`.

The motivation for keeping the version in a separate file, outside of CMake
Expand Down
3 changes: 2 additions & 1 deletion chapter-06/recipe-07/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Recording the Git hash at build time

In [Recipe 6](../recipe-06), we recorded the state of the code repository
In [Recipe 6, *Recording the Git hash at configure time*](../recipe-06),
we recorded the state of the code repository
(Git hash) at configure time. In this recipe, we wish to go a step further and
demonstrate how to record the Git hash (or, generally, perform other actions)
at build time, to make sure that these actions are run every time we build the
Expand Down
3 changes: 2 additions & 1 deletion chapter-06/recipe-07/abstract.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
In [Recipe 6](../recipe-06), we recorded the state of the code repository
In [Recipe 6, *Recording the Git hash at configure time*](../recipe-06),
we recorded the state of the code repository
(Git hash) at configure time. In this recipe, we wish to go a step further and
demonstrate how to record the Git hash (or, generally, perform other actions)
at build time, to make sure that these actions are run every time we build the
Expand Down
2 changes: 1 addition & 1 deletion chapter-08/recipe-01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This recipe introduces the superbuild pattern with a very simple example. We
will show how to use the
[ExternalProject_Add](https://cmake.org/cmake/help/latest/module/ExternalProject.html)
[`ExternalProject_Add`](https://cmake.org/cmake/help/latest/module/ExternalProject.html)
command to build a simple "Hello, World" program.


Expand Down
2 changes: 1 addition & 1 deletion chapter-08/recipe-01/abstract.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This recipe introduces the superbuild pattern with a very simple example. We
will show how to use the
[ExternalProject_Add](https://cmake.org/cmake/help/latest/module/ExternalProject.html)
[`ExternalProject_Add`](https://cmake.org/cmake/help/latest/module/ExternalProject.html)
command to build a simple "Hello, World" program.
6 changes: 3 additions & 3 deletions chapter-08/recipe-04/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

In this recipe we reuse the code from [Recipe 3 in Chapter 4](../../chapter-04/recipe-03)
and fetch and build the [Google Test](https://github.com/google/googletest) framework
using [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html),
using [`FetchContent`](https://cmake.org/cmake/help/latest/module/FetchContent.html),
which provides a compact and
versatile module to assemble project dependencies at configure time. For additional insight
and for CMake below 3.11, we will also discuss how to emulate [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) using
[ExternalProject_Add](https://cmake.org/cmake/help/latest/module/ExternalProject_Add.html)
and for CMake below 3.11, we will also discuss how to emulate [`FetchContent`](https://cmake.org/cmake/help/latest/module/FetchContent.html) using
[`ExternalProject_Add`](https://cmake.org/cmake/help/latest/module/ExternalProject_Add.html)
at configure time.


Expand Down
6 changes: 3 additions & 3 deletions chapter-08/recipe-04/abstract.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
In this recipe we reuse the code from [Recipe 3 in Chapter 4](../../chapter-04/recipe-03)
and fetch and build the [Google Test](https://github.com/google/googletest) framework
using [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html),
using [`FetchContent`](https://cmake.org/cmake/help/latest/module/FetchContent.html),
which provides a compact and
versatile module to assemble project dependencies at configure time. For additional insight
and for CMake below 3.11, we will also discuss how to emulate [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) using
[ExternalProject_Add](https://cmake.org/cmake/help/latest/module/ExternalProject_Add.html)
and for CMake below 3.11, we will also discuss how to emulate [`FetchContent`](https://cmake.org/cmake/help/latest/module/FetchContent.html) using
[`ExternalProject_Add`](https://cmake.org/cmake/help/latest/module/ExternalProject_Add.html)
at configure time.
2 changes: 1 addition & 1 deletion chapter-08/recipe-05/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Managing your project as a superbuild

This recipe shows how to use
[ExternalProject_Add](https://cmake.org/cmake/help/latest/module/ExternalProject_Add.html)
[`ExternalProject_Add`](https://cmake.org/cmake/help/latest/module/ExternalProject_Add.html)
to handle dependencies available from open source Git repositories.

As an example we will build a project which depends on https://github.com/dev-cafe/message.
Expand Down
2 changes: 1 addition & 1 deletion chapter-08/recipe-05/abstract.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This recipe shows how to use
[ExternalProject_Add](https://cmake.org/cmake/help/latest/module/ExternalProject_Add.html)
[`ExternalProject_Add`](https://cmake.org/cmake/help/latest/module/ExternalProject_Add.html)
to handle dependencies available from open source Git repositories.

As an example we will build a project which depends on https://github.com/dev-cafe/message.

0 comments on commit 384c32b

Please sign in to comment.