Browse Source

Add project files

master
Jake Wakeling 2 years ago
commit
df0909874d
  1. 5
      .gitignore
  2. 10
      BuildUNIX.sh
  3. 16
      CMakeLists.txt

5
.gitignore vendored

@ -0,0 +1,5 @@
/.clangd/
/bin/
/build/
/compile_commands.json
/lib/

10
BuildUNIX.sh

@ -0,0 +1,10 @@
#!/usr/bin/env sh
dir="$(dirname $(realpath "$0"))"
cmake -S "${dir}" -B "${dir}/build" \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
cmake --build "${dir}/build"
mv -f "${dir}/build/compile_commands.json" "${dir}/compile_commands.json"

16
CMakeLists.txt

@ -0,0 +1,16 @@
# CMakeLists.txt
# CMakeLists file for Pong
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
PROJECT(Pong VERSION 0.1.0 LANGUAGES CXX)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
ADD_COMPILE_DEFINITIONS(PROJECT_VERSION="${PROJECT_VERSION}")
FIND_PACKAGE(SFML REQUIRED COMPONENTS graphics)
FILE(GLOB SOURCES ${PROJECT_SOURCE_DIR}/src/*)
ADD_EXECUTABLE(pong ${SOURCES})
TARGET_LINK_LIBRARIES(pong sfml-graphics)
Loading…
Cancel
Save