From cc45f309d95779079ea25e5a9f99c97f95547960 Mon Sep 17 00:00:00 2001 From: Jinsun Yoo Date: Tue, 11 Nov 2025 17:36:30 +0000 Subject: [PATCH] Import submodules through FetchContent --- CMakeLists.txt | 10 ++++++++-- extern/googletest | 1 - extern/yaml-cpp | 1 - test/CMakeLists.txt | 8 +++++++- 4 files changed, 15 insertions(+), 5 deletions(-) delete mode 160000 extern/googletest delete mode 160000 extern/yaml-cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 80b1c10..f0f308f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,14 @@ set(BUILDTARGET "all" CACHE STRING "Compilation target ([all]/congestion_unaware # Can be compiled into either library or executable option(NETWORK_BACKEND_BUILD_AS_LIBRARY "Build as a library" OFF) -# Compile external libraries -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extern/yaml-cpp yaml-cpp) +# Add external libraries +include(FetchContent) +FetchContent_Declare( + yaml-cpp + GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git + GIT_TAG a83cd31 # Current as of 2025-10-01 +) +FetchContent_MakeAvailable(yaml-cpp) # Include src files to compile file(GLOB srcs_common diff --git a/extern/googletest b/extern/googletest deleted file mode 160000 index 1204d63..0000000 --- a/extern/googletest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1204d634444b0ba6da53201a8b6caf2a502d883c diff --git a/extern/yaml-cpp b/extern/yaml-cpp deleted file mode 160000 index 3d2888c..0000000 --- a/extern/yaml-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3d2888cc8a45da2f420454ad728cdfad01a3d54f diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f4f7a02..b1695ff 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -19,7 +19,13 @@ option(NETWORK_BACKEND_BUILD_AS_LIBRARY "Build as a library" ON) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. analytical) # Compile GoogleTest -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../extern/googletest googletest) +include(FetchContent) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG 1204d63 # Commit of 2024-10-31 +) +FetchContent_MakeAvailable(googletest) include(GoogleTest) # Compile Congestion Unaware Backend