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) + 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) + 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) + 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) +