1- # ====================================================================
2- # Vix.cpp — Net Module
3- # ====================================================================
1+ # @file CMakeLists.cpp
2+ # @author Gaspard Kirira
3+ #
4+ # Copyright 2025, Gaspard Kirira. All rights reserved.
5+ # https://github.com/vixcpp/vix
6+ # Use of this source code is governed by a MIT license
7+ # that can be found in the License file.
8+ #
9+ # Vix.cpp
10+ # NET MODULE
411# Purpose:
512# Low-level networking primitives for Vix (connectivity probing,
613# reachability checks, lightweight network utilities). Builds as
2027# Installs into the umbrella export-set `VixTargets`.
2128# ====================================================================
2229
30+
2331cmake_minimum_required (VERSION 3.20 )
2432project (vix_net VERSION 0.1.0 LANGUAGES CXX )
2533
2634include (GNUInstallDirs )
2735
28- # ------------------------ Global settings ----------------------------
36+ # Global settings
2937set (CMAKE_CXX_STANDARD 20)
3038set (CMAKE_CXX_STANDARD_REQUIRED ON )
3139set (CMAKE_POSITION_INDEPENDENT_CODE ON )
3240
33- # ------------------------ Sources discovery --------------------------
41+ # Sources discovery
3442file (GLOB_RECURSE NET_SOURCES "${CMAKE_CURRENT_SOURCE_DIR} /src/*.cpp" )
3543
36- # ------------------------ Utils dependency (robust) ------------------
44+ # Utils dependency
3745option (VIX_NET_FETCH_UTILS "Auto-fetch vix::utils if missing" ON )
3846
3947if (NOT TARGET vix::utils)
@@ -45,7 +53,7 @@ if (NOT TARGET vix::utils)
4553 message (STATUS "[net] Fetching vix::utils via FetchContent" )
4654 FetchContent_Declare (vix_utils
4755 GIT_REPOSITORY https://github.com/vixcpp/utils.git
48- GIT_TAG dev
56+ GIT_TAG dev
4957 )
5058 FetchContent_MakeAvailable (vix_utils)
5159 else ()
@@ -58,7 +66,7 @@ if (NOT TARGET ${VIX_UTILS_TARGET} AND TARGET vix::utils)
5866 set (VIX_UTILS_TARGET vix::utils)
5967endif ()
6068
61- # ============================== STATIC ===============================
69+ # STATIC
6270if (NET_SOURCES)
6371 message (STATUS "[net] Building STATIC library with detected sources." )
6472
@@ -105,7 +113,7 @@ if (NET_SOURCES)
105113 install (DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
106114 FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" )
107115
108- # ============================ HEADER-ONLY ============================
116+ # HEADER-ONLY
109117else ()
110118 message (STATUS "[net] Building HEADER-ONLY library (no sources)." )
111119
@@ -134,7 +142,7 @@ else()
134142 FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h" )
135143endif ()
136144
137- # ----------------------------- Tests ---------------------------------
145+ # Tests
138146option (VIX_NET_BUILD_TESTS "Build net module tests" OFF )
139147
140148if (VIX_NET_BUILD_TESTS)
@@ -143,7 +151,7 @@ if (VIX_NET_BUILD_TESTS)
143151 add_subdirectory (tests )
144152endif ()
145153
146- # ----------------------------- Summary -------------------------------
154+ # Summary
147155message (STATUS "------------------------------------------------------" )
148156message (STATUS "vix::net configured (${PROJECT_VERSION} )" )
149157if (NET_SOURCES)
0 commit comments