Skip to content

Commit a1be221

Browse files
committed
refactor(include): renamed subfolder parts to time_shield
1 parent 12ad8ba commit a1be221

16 files changed

+61
-13
lines changed

CMakeLists.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# При генерации Code::Blocks проекта с MinGW можно использовать так:
2+
# cmake -G "CodeBlocks - MinGW Makefiles" -S . -B build-cb
3+
cmake_minimum_required(VERSION 3.18)
4+
project(time_shield LANGUAGES CXX)
5+
6+
# Пути к инклудам и библиотекам
7+
set(PROJECT_INCLUDE_DIRS
8+
${CMAKE_CURRENT_SOURCE_DIR}/include/time_shield_cpp
9+
)
10+
11+
# Заголовочные файлы из include/
12+
file(GLOB_RECURSE PROJECT_HEADERS
13+
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
14+
include/*.hpp
15+
)
16+
17+
# Создаём виртуальную цель для заголовков, чтобы отображались в IDE
18+
add_custom_target(project_headers SOURCES ${PROJECT_HEADERS})
19+
20+
# Находим все .cpp файлы в examples/
21+
file(GLOB EXAMPLES_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} examples/*.cpp)
22+
23+
# Для каждого создаём отдельную цель
24+
foreach(example_src ${EXAMPLES_SOURCES})
25+
get_filename_component(example_name ${example_src} NAME_WE)
26+
27+
add_executable(${example_name} ${example_src})
28+
29+
target_include_directories(${example_name} PRIVATE ${PROJECT_INCLUDE_DIRS})
30+
target_link_directories(${example_name} PRIVATE ${PROJECT_LIBRARY_DIRS})
31+
target_compile_definitions(${example_name} PRIVATE ${PROJECT_DEFINES})
32+
target_link_libraries(${example_name} PRIVATE ${PROJECT_LIBS})
33+
34+
# Добавляем заголовочные файлы в IDE-представление цели
35+
set_source_files_properties(${PROJECT_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
36+
target_sources(${example_name} PRIVATE ${PROJECT_HEADERS})
37+
38+
foreach(dll ${DLL_FILES})
39+
add_custom_command(TARGET ${example_name} POST_BUILD
40+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
41+
"${dll}"
42+
"$<TARGET_FILE_DIR:${example_name}>"
43+
)
44+
endforeach()
45+
endforeach()

build-cb.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mkdir build-cb
2+
cmake -G "CodeBlocks - MinGW Makefiles" -S . -B build-cb
3+
pause

include/time_shield_cpp/time_shield.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
#ifndef _TIME_SHIELD_HPP_INCLUDED
1010
#define _TIME_SHIELD_HPP_INCLUDED
1111

12-
#include "parts/config.hpp" ///< Configuration settings for the Time Shield library.
13-
#include "parts/types.hpp" ///< Type definitions used throughout the library.
14-
#include "parts/constants.hpp" ///< Constants used in time calculations.
15-
#include "parts/enums.hpp" ///< Enumerations used in time representations.
16-
#include "parts/time_struct.hpp" ///< Structures representing time components.
17-
#include "parts/date_struct.hpp" ///< Structures representing date components.
18-
#include "parts/time_zone_struct.hpp" ///< Structure representing a time zone.
19-
#include "parts/date_time_struct.hpp" ///< Structure representing date and time components.
20-
#include "parts/validation.hpp" ///< Functions for validation of time-related values.
21-
#include "parts/time_utils.hpp" ///< Utility functions for time manipulation.
22-
#include "parts/time_conversions.hpp" ///< Functions for converting between different time representations.
23-
#include "parts/time_formatting.hpp" ///< Functions for formatting time in various standard formats.
24-
#include "parts/time_parser.hpp" ///< Functions for parsing time in various standard formats.
12+
#include "time_shield/config.hpp" ///< Configuration settings for the Time Shield library.
13+
#include "time_shield/types.hpp" ///< Type definitions used throughout the library.
14+
#include "time_shield/constants.hpp" ///< Constants used in time calculations.
15+
#include "time_shield/enums.hpp" ///< Enumerations used in time representations.
16+
#include "time_shield/time_struct.hpp" ///< Structures representing time components.
17+
#include "time_shield/date_struct.hpp" ///< Structures representing date components.
18+
#include "time_shield/time_zone_struct.hpp" ///< Structure representing a time zone.
19+
#include "time_shield/date_time_struct.hpp" ///< Structure representing date and time components.
20+
#include "time_shield/validation.hpp" ///< Functions for validation of time-related values.
21+
#include "time_shield/time_utils.hpp" ///< Utility functions for time manipulation.
22+
#include "time_shield/time_conversions.hpp" ///< Functions for converting between different time representations.
23+
#include "time_shield/time_formatting.hpp" ///< Functions for formatting time in various standard formats.
24+
#include "time_shield/time_parser.hpp" ///< Functions for parsing time in various standard formats.
2525

2626
/// \namespace tsh
2727
/// \brief Alias for the namespace time_shield.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)