Skip to content

Commit 74e1292

Browse files
committed
refactor: rename CMake project from NetworkSystem to network_system
Closes #914 - Rename project() from NetworkSystem to network_system - Rename all CMake targets (add_library, target_link_libraries, etc.) - Rename cmake module files to snake_case: NetworkSystemFeatures.cmake -> network_system_features.cmake NetworkSystemDependencies.cmake -> network_system_dependencies.cmake NetworkSystemCPack.cmake -> network_system_cpack.cmake NetworkSystemInstall.cmake -> network_system_install.cmake NetworkSystemIntegration.cmake -> network_system_integration.cmake - Update config.cmake.in namespace to network_system::network_system - Remove legacy backward-compatibility variables - Update all test/sample/benchmark CMakeLists.txt references - Update vcpkg port usage and portfile - Update documentation CMake examples - Update release workflow - No backward-compatible aliases provided (clean break)
1 parent d75ee17 commit 74e1292

36 files changed

Lines changed: 243 additions & 253 deletions

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
echo "" >> release-notes.md
198198
echo "# Include in your CMake project" >> release-notes.md
199199
echo "find_package(network_system REQUIRED)" >> release-notes.md
200-
echo "target_link_libraries(your_app NetworkSystem::NetworkSystem)" >> release-notes.md
200+
echo "target_link_libraries(your_app network_system::network_system)" >> release-notes.md
201201
echo '```' >> release-notes.md
202202
echo "" >> release-notes.md
203203

CMakeLists.txt

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endif()
1111
# Independent high-performance network system
1212
##################################################
1313

14-
project(NetworkSystem
14+
project(network_system
1515
VERSION 0.1.1
1616
DESCRIPTION "Independent High-Performance Network System"
1717
LANGUAGES CXX
@@ -271,10 +271,10 @@ endfunction()
271271

272272
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
273273

274-
include(NetworkSystemFeatures)
275-
include(NetworkSystemDependencies)
276-
include(NetworkSystemIntegration)
277-
include(NetworkSystemInstall)
274+
include(network_system_features)
275+
include(network_system_dependencies)
276+
include(network_system_integration)
277+
include(network_system_install)
278278

279279
##################################################
280280
# Dependency Detection
@@ -305,7 +305,7 @@ endif()
305305
##################################################
306306
# Shared Integration Objects (ODR Fix - Issue #555)
307307
#
308-
# These sources are shared between NetworkSystem and network-tcp.
308+
# These sources are shared between network_system and network-tcp.
309309
# Using an OBJECT library ensures symbols are defined exactly once,
310310
# preventing ODR (One Definition Rule) violations that cause SEGV
311311
# in sanitizer tests.
@@ -414,7 +414,7 @@ endif()
414414
# Create Main Library
415415
##################################################
416416

417-
add_library(NetworkSystem
417+
add_library(network_system
418418
# Main API implementation
419419
src/network_system.cpp
420420

@@ -537,7 +537,7 @@ add_library(NetworkSystem
537537
# WARNING: Suppressions removed for strict code quality check.
538538
# Fix the code instead of suppressing warnings!
539539
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
540-
# target_compile_options(NetworkSystem PRIVATE
540+
# target_compile_options(network_system PRIVATE
541541
# -Wno-sign-conversion
542542
# -Wno-conversion
543543
# -Wno-implicit-fallthrough
@@ -547,7 +547,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
547547
# -Wno-unused-variable
548548
# )
549549
elseif(MSVC)
550-
# target_compile_options(NetworkSystem PRIVATE
550+
# target_compile_options(network_system PRIVATE
551551
# /wd4244 # conversion from 'type1' to 'type2', possible loss of data
552552
# /wd4267 # conversion from 'size_t' to 'type', possible loss of data
553553
# /wd4100 # unreferenced formal parameter
@@ -562,7 +562,7 @@ option(BUILD_TLS_SUPPORT "Build with TLS/SSL support for secure messaging" ON)
562562
option(BUILD_LZ4_COMPRESSION "Build with LZ4 compression support" ON)
563563

564564
if(BUILD_TLS_SUPPORT)
565-
target_sources(NetworkSystem PRIVATE
565+
target_sources(network_system PRIVATE
566566
# secure_tcp_socket moved to libs/network-tcp (Issue #554)
567567
# secure_messaging_udp moved to libs/network-udp (Issue #561)
568568
src/internal/dtls_socket.cpp
@@ -575,34 +575,34 @@ if(BUILD_TLS_SUPPORT)
575575
src/protocols/http2/http2_server.cpp
576576
src/protocols/http2/http2_server_stream.cpp
577577
)
578-
target_compile_definitions(NetworkSystem PUBLIC BUILD_TLS_SUPPORT)
578+
target_compile_definitions(network_system PUBLIC BUILD_TLS_SUPPORT)
579579

580580
# Find OpenSSL for TLS/SSL
581581
# Minimum requirement: OpenSSL 3.0.0
582582
# OpenSSL 1.1.x reached EOL on September 11, 2023 and is no longer supported
583583
find_package(OpenSSL 3.0.0 REQUIRED)
584-
target_link_libraries(NetworkSystem PUBLIC OpenSSL::SSL OpenSSL::Crypto)
584+
target_link_libraries(network_system PUBLIC OpenSSL::SSL OpenSSL::Crypto)
585585

586586
message(STATUS "TLS/SSL support enabled (TLS 1.2/1.3)")
587587
message(STATUS " OpenSSL version: ${OPENSSL_VERSION}")
588588
endif()
589589

590590
# WebSocket support (conditional) - part of HTTP layer
591591
if(BUILD_WEBSOCKET_SUPPORT)
592-
target_sources(NetworkSystem PRIVATE
592+
target_sources(network_system PRIVATE
593593
src/internal/websocket_frame.cpp
594594
src/internal/websocket_handshake.cpp
595595
src/internal/websocket_protocol.cpp
596596
src/internal/websocket_socket.cpp
597597
src/http/websocket_client.cpp
598598
src/http/websocket_server.cpp
599599
)
600-
target_compile_definitions(NetworkSystem PUBLIC BUILD_WEBSOCKET_SUPPORT)
600+
target_compile_definitions(network_system PUBLIC BUILD_WEBSOCKET_SUPPORT)
601601

602602
# Find OpenSSL for SHA-1 hashing in handshake (if not already found)
603603
if(NOT BUILD_TLS_SUPPORT)
604604
find_package(OpenSSL 3.0.0 REQUIRED)
605-
target_link_libraries(NetworkSystem PRIVATE OpenSSL::Crypto)
605+
target_link_libraries(network_system PRIVATE OpenSSL::Crypto)
606606
message(STATUS " OpenSSL version: ${OPENSSL_VERSION}")
607607
endif()
608608

@@ -616,9 +616,9 @@ if(BUILD_LZ4_COMPRESSION)
616616
find_path(LZ4_INCLUDE_DIR NAMES lz4.h)
617617

618618
if(LZ4_LIBRARY AND LZ4_INCLUDE_DIR)
619-
target_compile_definitions(NetworkSystem PUBLIC BUILD_LZ4_COMPRESSION)
620-
target_include_directories(NetworkSystem PRIVATE ${LZ4_INCLUDE_DIR})
621-
target_link_libraries(NetworkSystem PRIVATE ${LZ4_LIBRARY})
619+
target_compile_definitions(network_system PUBLIC BUILD_LZ4_COMPRESSION)
620+
target_include_directories(network_system PRIVATE ${LZ4_INCLUDE_DIR})
621+
target_link_libraries(network_system PRIVATE ${LZ4_LIBRARY})
622622
message(STATUS "LZ4 compression enabled")
623623
message(STATUS " LZ4 library: ${LZ4_LIBRARY}")
624624
message(STATUS " LZ4 include: ${LZ4_INCLUDE_DIR}")
@@ -628,9 +628,9 @@ if(BUILD_LZ4_COMPRESSION)
628628
if(PkgConfig_FOUND)
629629
pkg_check_modules(LZ4 QUIET liblz4)
630630
if(LZ4_FOUND)
631-
target_compile_definitions(NetworkSystem PUBLIC BUILD_LZ4_COMPRESSION)
632-
target_include_directories(NetworkSystem PRIVATE ${LZ4_INCLUDE_DIRS})
633-
target_link_libraries(NetworkSystem PRIVATE ${LZ4_LIBRARIES})
631+
target_compile_definitions(network_system PUBLIC BUILD_LZ4_COMPRESSION)
632+
target_include_directories(network_system PRIVATE ${LZ4_INCLUDE_DIRS})
633+
target_link_libraries(network_system PRIVATE ${LZ4_LIBRARIES})
634634
message(STATUS "LZ4 compression enabled (via pkg-config)")
635635
message(STATUS " LZ4 version: ${LZ4_VERSION}")
636636
else()
@@ -651,8 +651,8 @@ if(BUILD_ZLIB_COMPRESSION)
651651
find_package(ZLIB QUIET)
652652

653653
if(ZLIB_FOUND)
654-
target_compile_definitions(NetworkSystem PUBLIC BUILD_ZLIB_COMPRESSION)
655-
target_link_libraries(NetworkSystem PRIVATE ZLIB::ZLIB)
654+
target_compile_definitions(network_system PUBLIC BUILD_ZLIB_COMPRESSION)
655+
target_link_libraries(network_system PRIVATE ZLIB::ZLIB)
656656
message(STATUS "ZLIB compression enabled (gzip/deflate)")
657657
message(STATUS " ZLIB version: ${ZLIB_VERSION_STRING}")
658658
else()
@@ -671,13 +671,13 @@ if(NETWORK_ENABLE_GRPC_OFFICIAL AND GRPC_FOUND)
671671
message(STATUS "========================================")
672672

673673
# Add gRPC wrapper sources
674-
target_sources(NetworkSystem PRIVATE
674+
target_sources(network_system PRIVATE
675675
src/protocols/grpc/grpc_official_wrapper.cpp
676676
)
677677

678678
if(GRPC_CMAKE_CONFIG)
679679
# Use CMake config targets (preferred)
680-
target_link_libraries(NetworkSystem PRIVATE
680+
target_link_libraries(network_system PRIVATE
681681
gRPC::grpc++
682682
gRPC::grpc++_reflection
683683
protobuf::libprotobuf
@@ -697,12 +697,12 @@ if(NETWORK_ENABLE_GRPC_OFFICIAL AND GRPC_FOUND)
697697
endif()
698698
elseif(GRPC_PKGCONFIG)
699699
# Use pkg-config libraries
700-
target_include_directories(NetworkSystem PRIVATE
700+
target_include_directories(network_system PRIVATE
701701
${GRPCPP_INCLUDE_DIRS}
702702
${PROTOBUF_INCLUDE_DIRS}
703703
)
704704

705-
target_link_libraries(NetworkSystem PRIVATE
705+
target_link_libraries(network_system PRIVATE
706706
${GRPCPP_LIBRARIES}
707707
${PROTOBUF_LIBRARIES}
708708
)
@@ -712,7 +712,7 @@ if(NETWORK_ENABLE_GRPC_OFFICIAL AND GRPC_FOUND)
712712
endif()
713713

714714
# Define compile-time flag
715-
target_compile_definitions(NetworkSystem PUBLIC NETWORK_GRPC_OFFICIAL=1)
715+
target_compile_definitions(network_system PUBLIC NETWORK_GRPC_OFFICIAL=1)
716716

717717
message(STATUS "")
718718
message(STATUS "Note: Existing gRPC API (grpc_server, grpc_client) remains unchanged.")
@@ -726,13 +726,13 @@ else()
726726
endif()
727727

728728
# Set target properties
729-
set_target_properties(NetworkSystem PROPERTIES
729+
set_target_properties(network_system PROPERTIES
730730
CXX_STANDARD 20
731731
CXX_STANDARD_REQUIRED ON
732732
)
733733

734734
# Include directories
735-
target_include_directories(NetworkSystem
735+
target_include_directories(network_system
736736
PUBLIC
737737
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
738738
$<INSTALL_INTERFACE:include>
@@ -742,34 +742,34 @@ target_include_directories(NetworkSystem
742742

743743
# Link to network-core for shared interfaces (Issue #538, #539)
744744
if(TARGET network-core)
745-
target_link_libraries(NetworkSystem PUBLIC network-core)
745+
target_link_libraries(network_system PUBLIC network-core)
746746
endif()
747747

748748
# Link to network-tcp for TCP protocol support (Issue #554)
749749
if(TARGET network-tcp)
750-
target_link_libraries(NetworkSystem PUBLIC network-tcp)
750+
target_link_libraries(network_system PUBLIC network-tcp)
751751
endif()
752752

753753
# Link to network-udp for UDP protocol support (Issue #618)
754754
if(TARGET network-udp)
755-
target_link_libraries(NetworkSystem PUBLIC network-udp)
755+
target_link_libraries(network_system PUBLIC network-udp)
756756
endif()
757757

758758
# Note: Integration objects are provided by network-tcp (ODR fix - Issue #555)
759-
# NetworkSystem gets these symbols through linking with network-tcp
759+
# network_system gets these symbols through linking with network-tcp
760760

761761
##################################################
762762
# Configure Integrations
763763
##################################################
764764

765-
setup_network_system_integrations(NetworkSystem)
765+
setup_network_system_integrations(network_system)
766766

767767
# Messaging bridge (optional - requires external systems)
768768
if(BUILD_MESSAGING_BRIDGE)
769-
target_sources(NetworkSystem PRIVATE
769+
target_sources(network_system PRIVATE
770770
src/integration/messaging_bridge.cpp
771771
)
772-
target_compile_definitions(NetworkSystem PRIVATE BUILD_MESSAGING_BRIDGE)
772+
target_compile_definitions(network_system PRIVATE BUILD_MESSAGING_BRIDGE)
773773
endif()
774774

775775
##################################################
@@ -782,7 +782,7 @@ option(BUILD_VERIFY_BUILD "Build verify_build executable" OFF)
782782

783783
if(BUILD_VERIFY_BUILD)
784784
add_executable(verify_build verify_build.cpp)
785-
target_link_libraries(verify_build PRIVATE NetworkSystem)
785+
target_link_libraries(verify_build PRIVATE network_system)
786786

787787
# Add system include paths to verify_build
788788
if(CONTAINER_SYSTEM_INCLUDE_DIR)
@@ -890,7 +890,7 @@ endif()
890890

891891
# CPack only applies to standalone builds (not as a subdirectory)
892892
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
893-
include(cmake/NetworkSystemCPack.cmake)
893+
include(cmake/network_system_cpack.cmake)
894894
endif()
895895

896896
##################################################
@@ -973,7 +973,7 @@ endif()
973973
##################################################
974974

975975
message(STATUS "========================================")
976-
message(STATUS "NetworkSystem Build Configuration:")
976+
message(STATUS "network_system Build Configuration:")
977977
message(STATUS "========================================")
978978
message(STATUS "")
979979
message(STATUS "Dependency Chain (Tier 4):")

benchmarks/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if(benchmark_FOUND OR BENCHMARK_FOUND)
2828

2929
target_link_libraries(network_benchmarks
3030
PRIVATE
31-
NetworkSystem
31+
network_system
3232
benchmark::benchmark
3333
benchmark::benchmark_main
3434
)
@@ -40,7 +40,7 @@ if(benchmark_FOUND OR BENCHMARK_FOUND)
4040
${CMAKE_CURRENT_SOURCE_DIR}/../src
4141
)
4242

43-
# Setup integrations for benchmarks (same as NetworkSystem target)
43+
# Setup integrations for benchmarks (same as network_system target)
4444
setup_asio_integration(network_benchmarks)
4545

4646
# Add system integration paths and definitions

cmake/network_system-config.cmake.in

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ set(network_system_FOUND TRUE)
4343
# Provide information about the package
4444
set(network_system_VERSION @PROJECT_VERSION@)
4545
set(network_system_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/network_system")
46-
set(network_system_LIBRARIES network_system::NetworkSystem)
47-
48-
# Legacy variables for backward compatibility
49-
set(NetworkSystem_FOUND TRUE)
50-
set(NETWORKSYSTEM_FOUND TRUE)
51-
set(NetworkSystem_VERSION ${network_system_VERSION})
52-
set(NetworkSystem_INCLUDE_DIRS ${network_system_INCLUDE_DIRS})
53-
set(NetworkSystem_LIBRARIES ${network_system_LIBRARIES})
54-
set(NETWORKSYSTEM_VERSION ${network_system_VERSION})
55-
set(NETWORKSYSTEM_INCLUDE_DIRS ${network_system_INCLUDE_DIRS})
56-
set(NETWORKSYSTEM_LIBRARIES ${network_system_LIBRARIES})
46+
set(network_system_LIBRARIES network_system::network_system)
5747

5848
message(STATUS "Found network_system: ${network_system_VERSION}")
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CPack Configuration for Network System
22

3-
set(CPACK_PACKAGE_NAME "NetworkSystem")
3+
set(CPACK_PACKAGE_NAME "network_system")
44
set(CPACK_PACKAGE_VENDOR "Network System Team")
55
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "High-performance asynchronous network communication library")
66
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
@@ -35,15 +35,15 @@ if(WIN32)
3535

3636
# Start menu shortcuts
3737
set(CPACK_NSIS_CREATE_ICONS_EXTRA
38-
"CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk' '$INSTDIR\\\\share\\\\doc\\\\NetworkSystem\\\\API_REFERENCE.md'"
38+
"CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk' '$INSTDIR\\\\share\\\\doc\\\\network_system\\\\API_REFERENCE.md'"
3939
)
4040
set(CPACK_NSIS_DELETE_ICONS_EXTRA
4141
"Delete '$SMPROGRAMS\\\\$START_MENU\\\\Documentation.lnk'"
4242
)
4343

4444
elseif(APPLE)
4545
set(CPACK_GENERATOR "TGZ;DragNDrop")
46-
set(CPACK_DMG_VOLUME_NAME "NetworkSystem-${CPACK_PACKAGE_VERSION}")
46+
set(CPACK_DMG_VOLUME_NAME "network_system-${CPACK_PACKAGE_VERSION}")
4747
set(CPACK_DMG_FORMAT "UDZO") # Compressed
4848
set(CPACK_PACKAGE_FILE_NAME "network_system-${CPACK_PACKAGE_VERSION}-macos")
4949

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##################################################
22
# NetworkSystemDependencies.cmake
33
#
4-
# Dependency finding module for NetworkSystem
4+
# Dependency finding module for network_system
55
# Handles ASIO and system integrations
66
##################################################
77

@@ -684,7 +684,7 @@ endfunction()
684684
# Main dependency finding function
685685
##################################################
686686
function(find_network_system_dependencies)
687-
message(STATUS "Finding NetworkSystem dependencies...")
687+
message(STATUS "Finding network_system dependencies...")
688688

689689
find_asio_library()
690690
find_container_system()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##################################################
22
# NetworkSystemFeatures.cmake
33
#
4-
# Feature detection module for NetworkSystem
4+
# Feature detection module for network_system
55
# Checks ASIO and coroutine support
66
##################################################
77

@@ -98,7 +98,7 @@ endfunction()
9898
# Main feature check function
9999
##################################################
100100
function(check_network_system_features)
101-
message(STATUS "Checking NetworkSystem feature support...")
101+
message(STATUS "Checking network_system feature support...")
102102

103103
check_asio_support()
104104
check_coroutine_support()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##################################################
22
# NetworkSystemInstall.cmake
33
#
4-
# Installation configuration for NetworkSystem
4+
# Installation configuration for network_system
55
##################################################
66

77
include(GNUInstallDirs)
@@ -12,7 +12,7 @@ include(CMakePackageConfigHelpers)
1212
##################################################
1313
function(install_network_system_library)
1414
# Build list of targets to install
15-
set(_INSTALL_TARGETS NetworkSystem)
15+
set(_INSTALL_TARGETS network_system)
1616

1717
# Include network-core if it exists (Issue #538, #539)
1818
if(TARGET network-core)

0 commit comments

Comments
 (0)