aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-26 17:26:36 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-26 17:26:36 +0200
commit6781cee55a4e7f232eae3e5f2a652045412339ae (patch)
tree2bfd37fd36f4513d24c076051c64ee07608ddcf6
parentc101364d4aafe50807cf7c8a831fb66eade3fb7f (diff)
use cmake instead of make
-rw-r--r--.gitignore4
-rw-r--r--CMakeLists.txt17
-rw-r--r--backend/CMakeLists.txt7
-rw-r--r--frontend/CMakeLists.txt4
-rw-r--r--frontend/main.cpp (renamed from main.cpp)0
-rw-r--r--makefile19
6 files changed, 29 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore
index b24328f..9785597 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,2 @@
-main
-*.o
-compile_commands.json
+build
.cache
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..98c41b3
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.28)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
+set(CMAKE_BUILD_TYPE Debug)
+
+find_package(pugixml REQUIRED)
+
+project(main CXX)
+
+add_executable(main)
+
+add_subdirectory(backend)
+add_subdirectory(frontend)
+
+target_link_libraries(main pugixml)
+
diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt
new file mode 100644
index 0000000..c9232f4
--- /dev/null
+++ b/backend/CMakeLists.txt
@@ -0,0 +1,7 @@
+target_sources(main PUBLIC
+ EnemyFactory.cpp
+ LocationFactory.cpp
+ Object.cpp
+ ObjectFactory.cpp
+)
+
diff --git a/frontend/CMakeLists.txt b/frontend/CMakeLists.txt
new file mode 100644
index 0000000..dd74089
--- /dev/null
+++ b/frontend/CMakeLists.txt
@@ -0,0 +1,4 @@
+target_sources(main PUBLIC
+ main.cpp
+)
+
diff --git a/main.cpp b/frontend/main.cpp
index acaf028..acaf028 100644
--- a/main.cpp
+++ b/frontend/main.cpp
diff --git a/makefile b/makefile
deleted file mode 100644
index f6797c7..0000000
--- a/makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-.PHONY: FORCE
-
-CXXFLAGS += -std=c++20
-LDFLAGS += -lstdc++
-
-OBJS += main.o
-OBJS += backend/EnemyFactory.o
-OBJS += backend/LocationFactory.o
-OBJS += backend/ObjectFactory.o
-OBJS += backend/Object.o
-
-main: $(OBJS)
-
-memtest: main FORCE
- valgrind ./$<
-
-compile_commands.json:
- compiledb make -Bn
-