Skip to content

Commit e80c1eb

Browse files
committed
Add more help for first build and run
1 parent 28a90f7 commit e80c1eb

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,38 @@
155155
Creating an Image File
156156
-----------------------
157157
Because the file is written to the standard output stream, you'll need to redirect it to an image
158-
file. Typically this is done from the command-line by using the `>` redirection operator, like so:
158+
file. Typically this is done from the command-line by using the `>` redirection operator.
159+
160+
On Windows, you'd get the debug build from CMake running this command:
161+
162+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163+
cmake -B build
164+
cmake --build build
165+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166+
167+
Then run your newly-built program like so:
168+
169+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170+
build\Debug\inOneWeekend.exe > image.ppm
171+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172+
173+
Later, it will be better to run optimized builds for speed. In that case, you would build like this:
174+
175+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176+
cmake --build build --config release
177+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
178+
179+
and would run the optimized program like this:
159180

160181
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161182
build\Release\inOneWeekend.exe > image.ppm
162183
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163184

164-
(This example assumes that you are building with CMake, using the same approach as the
185+
The examples above assume that you are building with CMake, using the same approach as the
165186
`CMakeLists.txt` file in the included source. Use whatever build environment (and language) you're
166-
comfortable with.)
187+
most comfortable with.
167188

168-
This is how things would look on Windows with CMake. On Mac or Linux, it might look like this:
189+
On Mac or Linux, release build, you would launch the program like this:
169190

170191
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171192
build/inOneWeekend > image.ppm

0 commit comments

Comments
 (0)