From 237218b5260848f26037b645980d943a37dd36fa Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 12 May 2026 14:35:56 +0200 Subject: [PATCH] feat: add lsl and concurrentQueue dependencies --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 13 +------------ cmake/Dependencies.cmake | 31 +++++++++++++++++++++++++++++++ src/CMakeLists.txt | 6 ++++++ 4 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 cmake/Dependencies.cmake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a2732e..9d1028c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y cmake clang-format clang-tidy + sudo apt-get install -y cmake clang-format clang-tidy libsdl2-dev - name: Check Code Formatting run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 974f37e..2f28891 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,25 +4,14 @@ project(NeuronIDE CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) - enable_testing() -include(FetchContent) -FetchContent_Declare( - googletest - URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip -) -# For Windows: Prevent overriding the parent project's compiler/linker settings -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -FetchContent_MakeAvailable(googletest) - - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +include(Dependencies) include(CompilerWarnings) include(StaticAnalysis) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) add_subdirectory(src) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake new file mode 100644 index 0000000..0c2b475 --- /dev/null +++ b/cmake/Dependencies.cmake @@ -0,0 +1,31 @@ +# cmake/Dependencies.cmake + +include(FetchContent) + +# 1. Google Test +FetchContent_Declare( + googletest + URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip +) +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) + +# 2. LSL +FetchContent_Declare( + liblsl + GIT_REPOSITORY https://github.com/sccn/liblsl.git + GIT_TAG v1.16.2 +) +set(LSL_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(liblsl) + +# 3. Moodycamel ConcurrentQueue +FetchContent_Declare( + concurrentqueue + GIT_REPOSITORY https://github.com/cameron314/concurrentqueue.git + GIT_TAG v1.0.4 +) +FetchContent_MakeAvailable(concurrentqueue) + +# 4. SDL2 (System installed) +find_package(SDL2 REQUIRED) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9798abb..854e2c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,12 @@ add_library(runtime_core Runtime.cpp) target_include_directories(runtime_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include) +target_link_libraries(runtime_core PUBLIC + lsl + concurrentqueue + ${SDL2_LIBRARIES} +) +target_include_directories(runtime_core PUBLIC ${SDL2_INCLUDE_DIRS}) add_executable(NeuronIDE main.cpp) target_link_libraries(NeuronIDE PRIVATE runtime_core) \ No newline at end of file