From 28eb1c5b79e8a59480640d9563a00c62efd18faa Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 8 Nov 2025 21:02:53 +0300 Subject: [PATCH 1/4] add root CMakeLists.txt --- HW4/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 HW4/CMakeLists.txt diff --git a/HW4/CMakeLists.txt b/HW4/CMakeLists.txt new file mode 100644 index 0000000..7ed9f5a --- /dev/null +++ b/HW4/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.25) +project(homework4 C) + +if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + message(STATUS "Using GCC/Clang warnings") + add_compile_options(-Wall -Wextra -Wpedantic) +elseif(MSVC) + message(STATUS "Using MSVC warnings") + add_compile_options(/W4) +else() + message(STATUS "Unknown compiler - using default warnings") +endif() + +add_subdirectory(modules) +add_subdirectory(ParenthesesBalance) +add_subdirectory(ShuntingYard) + From 708347c4e91e75d1ec9f27b7593d87465f925db8 Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 8 Nov 2025 21:03:45 +0300 Subject: [PATCH 2/4] Add CMake for stack and queue modules --- HW4/modules/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 HW4/modules/CMakeLists.txt diff --git a/HW4/modules/CMakeLists.txt b/HW4/modules/CMakeLists.txt new file mode 100644 index 0000000..2ee0f79 --- /dev/null +++ b/HW4/modules/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(stack STATIC stack/stack.c stack/stack.h) +target_include_directories(stack PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/stack) + +add_library(queue STATIC queue/queue.c queue/queue.h) +target_include_directories(queue PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/queue) + From 5ceb3b0dac68012bf182a3b131e61201640398ee Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 8 Nov 2025 21:04:15 +0300 Subject: [PATCH 3/4] Add cmake forparentheses balance --- HW4/ParenthesesBalance/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 HW4/ParenthesesBalance/CMakeLists.txt diff --git a/HW4/ParenthesesBalance/CMakeLists.txt b/HW4/ParenthesesBalance/CMakeLists.txt new file mode 100644 index 0000000..bcb0a80 --- /dev/null +++ b/HW4/ParenthesesBalance/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(parenthesesBalance src/main.c) + +target_link_libraries(parenthesesBalance stack) +target_include_directories(parenthesesBalance PRIVATE ${CMAKE_SOURCE_DIR}/modules) + From a57824915b200816869669d4fc3a98be5a16bd04 Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 8 Nov 2025 21:05:05 +0300 Subject: [PATCH 4/4] Add CMake for shunting yard --- HW4/ShuntingYard/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 HW4/ShuntingYard/CMakeLists.txt diff --git a/HW4/ShuntingYard/CMakeLists.txt b/HW4/ShuntingYard/CMakeLists.txt new file mode 100644 index 0000000..137419b --- /dev/null +++ b/HW4/ShuntingYard/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(shuntingYard src/main.c) + +target_link_libraries(shuntingYard stack queue) +target_include_directories(shuntingYard PRIVATE ${CMAKE_SOURCE_DIR}/modules) +