From bbf55eaabd09f6d2a98fad9c0a68db83c140f3e1 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 10 Oct 2024 07:29:17 +0200 Subject: use find_package instead of add_subdirectory --- src/CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/CMakeLists.txt') 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) -- cgit v1.2.3