summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-02-20 09:15:40 -0700
committercflip <cflip@cflip.net>2022-02-20 09:15:40 -0700
commita3f4ac00ee76f5e3b2dae7838a6c13ccae40ceac (patch)
treeaf8575869f901657b2252c56c7a15e278ef2c0f7
parent3828bb56022c636a7dd056a4781249222ea0d3ca (diff)
Set up CMake build systemHEADmaster
-rw-r--r--.gitignore24
-rw-r--r--CMakeLists.txt16
-rw-r--r--Makefile6
-rw-r--r--src/audio.cpp (renamed from audio.cpp)2
-rw-r--r--src/audio.h (renamed from audio.h)0
-rw-r--r--src/gui.cpp (renamed from gui.cpp)1
-rw-r--r--src/gui.h (renamed from gui.h)2
-rw-r--r--src/main.cpp (renamed from main.cpp)2
-rw-r--r--src/sequence.h (renamed from sequence.h)0
9 files changed, 34 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 93659d7..1b963c4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,16 @@
-.vscode
-fmseq
+CMakeLists.txt.user
+CMakeCache.txt
+CMakeFiles/
+CMakeScripts/
+Testing/
+cmake_install.cmake
+install_manifest.txt
+compile_commands.json
+CTestTestfile.cmake
+_deps/
+
+Makefile
+out/
+.vs/
-# Visual Studio garbage
-Debug/
-*.sln
-*.vcxproj
-*.vcxproj.filters
-*.vcxproj.user
-*.pdb \ No newline at end of file
+fmseq
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..f9c8fa9
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.5)
+set(CMAKE_CXX_STANDARD 17)
+
+project(fmseq)
+
+find_package(SDL2 REQUIRED)
+include_directories(${SDL2_INCLUDE_DIRS})
+
+set(SOURCES
+ src/audio.cpp
+ src/main.cpp
+ src/gui.cpp
+)
+
+add_executable(fmseq ${SOURCES})
+target_link_libraries(fmseq ${SDL2_LIBRARIES}) \ No newline at end of file
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 4cfed7a..0000000
--- a/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-SRC=main.cpp\
- audio.cpp\
- gui.cpp
-
-fmseq: ${SRC}
- g++ ${SRC} -lSDL2 -o fmseq \ No newline at end of file
diff --git a/audio.cpp b/src/audio.cpp
index 712dddc..db915e1 100644
--- a/audio.cpp
+++ b/src/audio.cpp
@@ -3,7 +3,7 @@
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include "sequence.h"
diff --git a/audio.h b/src/audio.h
index 6205de7..6205de7 100644
--- a/audio.h
+++ b/src/audio.h
diff --git a/gui.cpp b/src/gui.cpp
index 1070e9f..fcd4511 100644
--- a/gui.cpp
+++ b/src/gui.cpp
@@ -1,6 +1,5 @@
#include "gui.h"
-#include <SDL2/SDL.h>
#include "sequence.h"
void Slider::Draw(SDL_Renderer* renderer)
diff --git a/gui.h b/src/gui.h
index ee6a51c..76a1128 100644
--- a/gui.h
+++ b/src/gui.h
@@ -1,6 +1,6 @@
#pragma once
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include <vector>
#include "sequence.h"
diff --git a/main.cpp b/src/main.cpp
index 8fd1f2a..6056442 100644
--- a/main.cpp
+++ b/src/main.cpp
@@ -1,4 +1,4 @@
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include <iostream>
#include "audio.h"
diff --git a/sequence.h b/src/sequence.h
index decd9fd..decd9fd 100644
--- a/sequence.h
+++ b/src/sequence.h