mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-29 17:28:42 +00:00
examples: Add CMake glue to optionally build examples, as we do for the tests.
In fact, most of the CMake code was stolen from the test directory.
This commit is contained in:
parent
2038620717
commit
16535b7ee2
4 changed files with 447 additions and 1 deletions
|
|
@ -44,6 +44,14 @@ cmake -S ~/sdl -B ~/build -DSDL_TEST_LIBRARY=ON -DSDL_TESTS=ON
|
|||
```
|
||||
and then building normally. In this example, the test programs will be built and can be run from `~/build/tests/`.
|
||||
|
||||
### Building SDL examples
|
||||
|
||||
You can build the SDL example programs by adding `-DSDL_EXAMPLES=ON` to the first cmake command above:
|
||||
```sh
|
||||
cmake -S ~/sdl -B ~/build -DSDL_EXAMPLES=ON
|
||||
```
|
||||
and then building normally. In this example, the example programs will be built and can be run from `~/build/examples/`.
|
||||
|
||||
## Including SDL in your project
|
||||
|
||||
SDL can be included in your project in 2 major ways:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue