Skip to content

Commit 1d3335a

Browse files
committed
Clarify requirement around GitHub
1 parent 969c5cd commit 1d3335a

File tree

1 file changed

+44
-34
lines changed

1 file changed

+44
-34
lines changed

README.md

+44-34
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,42 @@ The template starts out very basic, but might receive additional features over t
1010

1111
## How to Use
1212

13-
1. Install Git and CMake. Use your system's package manager if available.
14-
1. Follow [GitHub's instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for how to use their project template feature to create your own project.
15-
1. Clone your new GitHub repo and open the repo in your text editor of choice.
16-
1. Open [CMakeLists.txt](CMakeLists.txt). Rename the project and the executable to whatever name you want.
17-
1. If you want to add or remove any .cpp files, change the source files listed in the `add_executable` call in CMakeLists.txt to match the source files your project requires. If you plan on keeping the default main.cpp file then no changes are required.
18-
1. If your code uses the Audio or Network modules then add `sfml-audio` or `sfml-network` to the `target_link_libraries` call alongside the existing `sfml-graphics` library that is being linked.
19-
1. If you use Linux, install SFML's dependencies using your system package manager. On Ubuntu and other Debian-based distributions you can use the following commands:
20-
```
21-
sudo apt update
22-
sudo apt install \
23-
libxrandr-dev \
24-
libxcursor-dev \
25-
libudev-dev \
26-
libfreetype-dev \
27-
libopenal-dev \
28-
libflac-dev \
29-
libvorbis-dev \
30-
libgl1-mesa-dev \
31-
libegl1-mesa-dev
32-
```
33-
1. Configure and build your project. Most popular IDEs support CMake projects with very little effort on your part.
34-
- [VS Code](https://code.visualstudio.com) via the [CMake extension](https://code.visualstudio.com/docs/cpp/cmake-linux)
35-
- [Visual Studio](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170)
36-
- [CLion](https://www.jetbrains.com/clion/features/cmake-support.html)
37-
- [Qt Creator](https://doc.qt.io/qtcreator/creator-project-cmake.html)
38-
39-
Using CMake from the command line is straightforward as well.
40-
Be sure to run these commands in the root directory of the project you just created.
41-
42-
```
43-
cmake -B build
44-
cmake --build build
45-
```
46-
1. Enjoy!
13+
1. Install [Git](https://git-scm.com/downloads) and [CMake](https://cmake.org/download/). Use your system's package manager if available.
14+
2. Follow [GitHub's instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for how to use their project template feature to create your own project. If you don't want to use GitHub, see the section below.
15+
3. Clone your new GitHub repo and open the repo in your text editor of choice.
16+
4. Open [CMakeLists.txt](CMakeLists.txt). Rename the project and the target name of the executable to whatever name you want. Make sure to change all occurrences.
17+
5. If you want to add or remove any .cpp files, change the source files listed in the `add_executable` call in CMakeLists.txt to match the source files your project requires. If you plan on keeping the default main.cpp file then no changes are required.
18+
6. If your code uses the Audio or Network modules then add `sfml-audio` or `sfml-network` to the `target_link_libraries` call alongside the existing `sfml-graphics` library that is being linked.
19+
7. If you use Linux, install SFML's dependencies using your system package manager. On Ubuntu and other Debian-based distributions you can use the following commands:
20+
```
21+
sudo apt update
22+
sudo apt install \
23+
libxrandr-dev \
24+
libxcursor-dev \
25+
libudev-dev \
26+
libfreetype-dev \
27+
libopenal-dev \
28+
libflac-dev \
29+
libvorbis-dev \
30+
libgl1-mesa-dev \
31+
libegl1-mesa-dev
32+
```
33+
8. Configure and build your project. Most popular IDEs support CMake projects with very little effort on your part.
34+
35+
- [VS Code](https://code.visualstudio.com) via the [CMake extension](https://code.visualstudio.com/docs/cpp/cmake-linux)
36+
- [Visual Studio](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170)
37+
- [CLion](https://www.jetbrains.com/clion/features/cmake-support.html)
38+
- [Qt Creator](https://doc.qt.io/qtcreator/creator-project-cmake.html)
39+
40+
Using CMake from the command line is straightforward as well.
41+
Be sure to run these commands in the root directory of the project you just created.
42+
43+
```
44+
cmake -B build
45+
cmake --build build
46+
```
47+
48+
9. Enjoy!
4749

4850
## Upgrading SFML
4951

@@ -61,6 +63,13 @@ The nice folks in the [SFML community](https://github.com/SFML/SFML#community) c
6163

6264
Modify CMake options by adding them as configuration parameters (with a `-D` flag) or by modifying the contents of CMakeCache.txt and rebuilding.
6365

66+
### Not use GitHub
67+
68+
You aren't required to use a GitHub account or repository.
69+
It is the simplest approach if you already have an account and want to make use of GitHub Actions.
70+
You can also [download the contents](https://github.com/SFML/cmake-sfml-project/archive/refs/heads/master.zip) of this template repository and unpack it locally.
71+
This doesn't require a GitHub account and you don't even need to use a Git repository.
72+
6473
### Change Compilers
6574

6675
See the variety of [`CMAKE_<LANG>_COMPILER`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER.html) options.
@@ -86,6 +95,7 @@ Then you may rebuild your project with this new generator.
8695

8796
Here are some useful resources if you want to learn more about CMake:
8897

98+
- [Official CMake Tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/)
8999
- [How to Use CMake Without the Agonizing Pain - Part 1](https://alexreinking.com/blog/how-to-use-cmake-without-the-agonizing-pain-part-1.html)
90100
- [How to Use CMake Without the Agonizing Pain - Part 2](https://alexreinking.com/blog/how-to-use-cmake-without-the-agonizing-pain-part-2.html)
91101
- [Better CMake YouTube series by Jefferon Amstutz](https://www.youtube.com/playlist?list=PL8i3OhJb4FNV10aIZ8oF0AA46HgA2ed8g)

0 commit comments

Comments
 (0)