From bdac232357c538f80baac889ca75700bbccd0777 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 22 May 2024 09:58:11 -0600 Subject: [PATCH] Use shorter executable name --- CMakeLists.txt | 12 ++++++------ README.md | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8398e55..247672c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,16 +10,16 @@ FetchContent_Declare(SFML GIT_TAG 2.6.x) FetchContent_MakeAvailable(SFML) -add_executable(CMakeSFMLProject src/main.cpp) -target_link_libraries(CMakeSFMLProject PRIVATE sfml-graphics) -target_compile_features(CMakeSFMLProject PRIVATE cxx_std_17) +add_executable(main src/main.cpp) +target_link_libraries(main PRIVATE sfml-graphics) +target_compile_features(main PRIVATE cxx_std_17) if(WIN32) add_custom_command( - TARGET CMakeSFMLProject + TARGET main COMMENT "Copy OpenAL DLL" - PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$,x64,x86>/openal32.dll $ + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$,x64,x86>/openal32.dll $ VERBATIM) endif() -install(TARGETS CMakeSFMLProject) +install(TARGETS main) diff --git a/README.md b/README.md index 0f5bf40..53be2fe 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The template starts out very basic, but might receive additional features over t 1. Install Git and CMake. Use your system's package manager if available. 1. Follow the above instructions about how to use GitHub's project template feature to create your own project. 1. Clone your new GitHub repo and open the repo in your text editor of choice. -1. Open [CMakeLists.txt](CMakeLists.txt). Rename the project and the executable to whatever name you want. The project and executable names don't have to match. +1. Open [CMakeLists.txt](CMakeLists.txt). Rename the project and the executable to whatever name you want. 1. 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. 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: ```