{"id":16356045,"url":"https://github.com/joehowarth/sfml-workspace","last_synced_at":"2025-12-08T04:30:12.509Z","repository":{"id":241453012,"uuid":"805924475","full_name":"JoeHowarth/SFML-workspace","owner":"JoeHowarth","description":"Messing around with SFML and C++!!","archived":false,"fork":false,"pushed_at":"2024-05-28T02:59:02.000Z","size":594,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-29T06:11:30.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoeHowarth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-25T21:25:12.000Z","updated_at":"2024-05-28T02:59:05.000Z","dependencies_parsed_at":"2024-05-28T12:37:39.991Z","dependency_job_id":null,"html_url":"https://github.com/JoeHowarth/SFML-workspace","commit_stats":null,"previous_names":["joehowarth/sfml-workspace"],"tags_count":0,"template":false,"template_full_name":"SFML/cmake-sfml-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeHowarth%2FSFML-workspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeHowarth%2FSFML-workspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeHowarth%2FSFML-workspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeHowarth%2FSFML-workspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoeHowarth","download_url":"https://codeload.github.com/JoeHowarth/SFML-workspace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239665479,"owners_count":19676942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T01:42:29.272Z","updated_at":"2025-12-08T04:30:12.457Z","avatar_url":"https://github.com/JoeHowarth.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CMake SFML Project Template\n\nThis repository template should allow for a fast and hassle-free kick start of your next SFML project using CMake.\nThanks to [GitHub's nature of templates](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template), you can fork this repository without inheriting its Git history.\n\nThe template starts out very basic, but might receive additional features over time:\n\n- Basic CMake script to build your project and link SFML on any operating system\n- Basic [GitHub Actions](https://github.com/features/actions) script for all major platforms\n\n## How to Use\n\n1. Install Git and CMake. Use your system's package manager if available.\n1. Follow the above instructions about how to use GitHub's project template feature to create your own project.\n1. Clone your new GitHub repo and open the repo in your text editor of choice.\n1. Open [CMakeLists.txt](CMakeLists.txt). Rename the project and the executable to whatever name you want.\n1. If you want to add or remove any .cpp files, change the source files listed in the [`add_executable`](CMakeLists.txt#L10) 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.\n1. 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:\n    ```\n    sudo apt update\n    sudo apt install \\\n        libxrandr-dev \\\n        libxcursor-dev \\\n        libudev-dev \\\n        libfreetype-dev \\\n        libopenal-dev \\\n        libflac-dev \\\n        libvorbis-dev \\\n        libgl1-mesa-dev \\\n        libegl1-mesa-dev\n    ```\n1. Configure and build your project. Most popular IDEs support CMake projects with very little effort on your part.\n    - [VS Code](https://code.visualstudio.com) via the [CMake extension](https://code.visualstudio.com/docs/cpp/cmake-linux)\n    - [Visual Studio](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170)\n    - [CLion](https://www.jetbrains.com/clion/features/cmake-support.html)\n    - [Qt Creator](https://doc.qt.io/qtcreator/creator-project-cmake.html)\n\n    Using CMake from the command line is straightforward as well.\n\n    For a single-configuration generator (typically the case on Linux and macOS):\n    ```\n    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release\n    cmake --build build\n    ```\n\n    For a multi-configuration generator (typically the case on Windows):\n    ```\n    cmake -S . -B build\n    cmake --build build --config Release\n    ```\n1. Enjoy!\n\n## Upgrading SFML\n\nSFML is found via CMake's [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) module.\nFetchContent automatically downloads SFML from GitHub and builds it alongside your own code.\nBeyond the convenience of not having to install SFML yourself, this ensures ABI compatability and simplifies things like specifying static versus shared libraries.\n\nModifying what version of SFML you want is as easy as changing the [`GIT_TAG`](CMakeLists.txt#L7) argument.\nCurrently it uses the latest in-development version of SFML 2 via the `2.6.x` tag.\nIf you're feeling adventurous and want to give SFML 3 a try, use the `master` tag.\nBeware, this requires changing your code to suit the modified API!\nThe nice folks in the [SFML community](https://github.com/SFML/SFML#community) can help you with that transition and the bugs you may encounter along the way.\n\n## But I want to...\n\nModify CMake options by adding them as configuration parameters (with a `-D` flag) or by modifying the contents of CMakeCache.txt and rebuilding.\n\n### Use Static Libraries\n\nBy default SFML builds shared libraries and this default is inherited by your project.\nCMake's [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html) option lets you pick static or shared libraries for the entire project.\n\n### Change Compilers\n\nSee the variety of [`CMAKE_\u003cLANG\u003e_COMPILER`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER.html) options.\nIn particular you'll want to modify `CMAKE_CXX_COMPILER` to point to the C++ compiler you wish to use.\n\n### Change Compiler Optimizations\n\nCMake abstracts away specific optimizer flags through the [`CMAKE_BUILD_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) option.\nBy default this project recommends `Release` builds which enable optimizations.\nOther build types include `Debug` builds which enable debug symbols but disable optimizations.\nIf you're using a multi-configuration generator (as is often the case on Windows), you can modify the [`CMAKE_CONFIGURATION_TYPES`](https://cmake.org/cmake/help/latest/variable/CMAKE_CONFIGURATION_TYPES.html#variable:CMAKE_CONFIGURATION_TYPES) option.\n\n### Change Generators\n\nWhile CMake will attempt to pick a suitable default generator, some systems offer a number of generators to choose from.\nUbuntu, for example, offers Makefiles and Ninja as two potential options.\nFor a list of generators, click [here](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html).\nTo modify the generator you're using you must reconfigure your project providing a `-G` flag with a value corresponding to the generator you want.\nYou can't simply modify an entry in the CMakeCache.txt file unlike the above options.\nThen you may rebuild your project with this new generator.\n\n## More Reading\n\nHere are some useful resources if you want to learn more about CMake:\n\n- [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)\n- [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)\n- [Better CMake YouTube series by Jefferon Amstutz](https://www.youtube.com/playlist?list=PL8i3OhJb4FNV10aIZ8oF0AA46HgA2ed8g)\n\n## License\n\nThe source code is dual licensed under Public Domain and MIT -- choose whichever you prefer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoehowarth%2Fsfml-workspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoehowarth%2Fsfml-workspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoehowarth%2Fsfml-workspace/lists"}