Skip to content

Commit

Permalink
code beautify
Browse files Browse the repository at this point in the history
  • Loading branch information
UmbrellaLeaf5 committed Oct 27, 2024
1 parent 729a22e commit f01684b
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 14 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.20)

project(homeworks)
project(homeworks LANGUAGES CXX)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -std=c++20 -O2")

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/sandbox)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/additional_tasks)

file(GLOB_RECURSE tasks_dirs LIST_DIRECTORIES true ".")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ add_executable(${PROJECT_NAME} ${source_list} ${lib_source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down
1 change: 0 additions & 1 deletion additional_tasks/template_task/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ add_executable(${PROJECT_NAME} ${source_list} ${lib_source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down
1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ file(GLOB_RECURSE lib_source_list "src/*.cpp" "src/*.hpp")

add_library(${PROJECT_NAME} ${lib_source_list})

set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
2 changes: 1 addition & 1 deletion lib/src/graph/for_string/graph_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void Graph<vert_t, weight_t>::RemoveVert(vert_t vert) {
template <AllowedVertType vert_t, AllowedWeightType weight_t>
std::pair<vert_t, vert_t> Graph<vert_t, weight_t>::ParseEdgeString(
const std::string& edge_str) {
size_t pos = edge_str.find("->");
const size_t pos = edge_str.find("->");

if (pos == std::string::npos)
throw std::invalid_argument("EdgeString: invalid edge string format: " +
Expand Down
1 change: 0 additions & 1 deletion sandbox/template/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ add_executable(${PROJECT_NAME} ${source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down
1 change: 0 additions & 1 deletion task_01/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ add_executable(${PROJECT_NAME} ${source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down
1 change: 0 additions & 1 deletion task_02/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ add_executable(${PROJECT_NAME} ${source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down
1 change: 0 additions & 1 deletion task_03/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ add_executable(${PROJECT_NAME} ${source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down
1 change: 0 additions & 1 deletion task_04/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ add_executable(${PROJECT_NAME} ${source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down
1 change: 0 additions & 1 deletion task_05/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ add_executable(${PROJECT_NAME} ${source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down
1 change: 0 additions & 1 deletion task_06/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ add_executable(${PROJECT_NAME} ${source_list})
# Locate GTest
enable_testing()
find_package(GTest REQUIRED)

include_directories(${GTEST_INCLUDE_DIRS})

find_library(Utils ../)
Expand Down

0 comments on commit f01684b

Please sign in to comment.