aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-10 07:29:17 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-10 07:29:17 +0200
commitbbf55eaabd09f6d2a98fad9c0a68db83c140f3e1 (patch)
treebb3a6d6a0ca2249befa0752864cc25a095a6f1e7 /src
parent29fb4bda4872bdfe33a2416a239fb62fc0238167 (diff)
use find_package instead of add_subdirectory
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt11
-rw-r--r--src/crepe/Sound.h4
-rw-r--r--src/crepe/SoundContext.h2
3 files changed, 9 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 49d65a6..09c60bd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -5,11 +5,12 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_BUILD_TYPE Debug)
-add_subdirectory(../lib/soloud soloud)
-add_subdirectory(../lib/googletest googletest)
-
project(crepe C CXX)
+find_package(SDL2 REQUIRED)
+find_package(SoLoud REQUIRED)
+find_package(GTest REQUIRED)
+
add_library(crepe SHARED)
add_executable(test_main EXCLUDE_FROM_ALL)
@@ -17,9 +18,9 @@ target_include_directories(crepe
PUBLIC SYSTEM INTERFACE .
)
-# TODO: libraries should be linked as PRIVATE
target_link_libraries(crepe
- PUBLIC soloud
+ PRIVATE soloud
+ PRIVATE SDL2
)
add_subdirectory(crepe)
diff --git a/src/crepe/Sound.h b/src/crepe/Sound.h
index 1ac20a7..b7cfbb8 100644
--- a/src/crepe/Sound.h
+++ b/src/crepe/Sound.h
@@ -1,7 +1,7 @@
#pragma once
-#include <soloud.h>
-#include <soloud_wav.h>
+#include <soloud/soloud.h>
+#include <soloud/soloud_wav.h>
#include <memory>
diff --git a/src/crepe/SoundContext.h b/src/crepe/SoundContext.h
index 090966d..d3123d2 100644
--- a/src/crepe/SoundContext.h
+++ b/src/crepe/SoundContext.h
@@ -1,6 +1,6 @@
#pragma once
-#include <soloud.h>
+#include <soloud/soloud.h>
#include "Sound.h"