Commit 53d46d71 authored by Jonas Johan Solsvik's avatar Jonas Johan Solsvik 🎮
Browse files

Enable multiple games in repo

parent 68b16dd9
project(double-trouble)
cmake_minimum_required (VERSION 3.16.3 FATAL_ERROR)
set(SRCDIR "${CMAKE_SOURCE_DIR}/src")
set(SRCDIR "${CMAKE_SOURCE_DIR}")
set(BINDIR ${CMAKE_BINARY_DIR})
set(SFML_USE_STATIC_STD_LIBS TRUE)
add_executable(${CMAKE_PROJECT_NAME} "${SRCDIR}/main.cpp")
set_target_properties(
${CMAKE_PROJECT_NAME}
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
RUNTIME_OUTPUT_DIRECTORY "${BINDIR}"
LIBRARY_OUTPUT_DIRECTORY "${BINDIR}/bin"
set(targets
01-red-circle
)
add_subdirectory("./external/sfml")
target_link_libraries(
${CMAKE_PROJECT_NAME}
PRIVATE sfml-window
PRIVATE sfml-graphics
PRIVATE sfml-audio
)
foreach(target ${targets})
add_executable(${target} "${SRCDIR}/${target}/main.cpp")
set_target_properties(
${target}
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
RUNTIME_OUTPUT_DIRECTORY "${BINDIR}"
LIBRARY_OUTPUT_DIRECTORY "${BINDIR}/bin"
)
add_subdirectory("./external/sfml")
target_link_libraries(
${target}
PRIVATE sfml-window
PRIVATE sfml-graphics
PRIVATE sfml-audio
)
endforeach()
run: build
./build/double-trouble;
all:
mkdir -p build;
cmake -S . -B build;
make -C build;
build: $(shell find src -type f) CMakeLists.txt
mkdir -p build && \
cmake -S . -B build && \
01:
mkdir -p build;
cmake --target 01-red-circle -S . -B build;
make -C build;
./build/01-red-circle;
.PHONY: 01 all
......@@ -4,11 +4,18 @@ A IMT3601 Games Programming project by Jonas and Viktor
## Getting started
To run the game run:
To build all:
```
make
```
To build and run a specific game:
```
make 01
```
_See `Makefile` for complete list of commands_
## System requirements
### Ubuntu and Pop!\_OS 20.04
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment