This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git


The following commit(s) were added to refs/heads/master by this push:
     new d016d3d  CMake: Make the code subproject self-contained for 
FetchContent (#8)
d016d3d is described below

commit d016d3d1685c10dc63c8a1a22cb2d5d95eb7ddb5
Author: Brian Neradt <[email protected]>
AuthorDate: Mon Mar 9 10:11:36 2026 -0500

    CMake: Make the code subproject self-contained for FetchContent (#8)
    
    `code/CMakeLists.txt` uses `cmake_dependent_option`, but it did not
    load the `CMakeDependentOption` module itself. That works when the top-
    level project includes the module first, but it breaks consumers that
    pull `code/` in directly with `FetchContent` and `SOURCE_SUBDIR`.
    
    Include `CMakeDependentOption` in the subproject so the standalone
    subdirectory build works in both direct and embedded CMake builds.
    
    Co-authored-by: bneradt <[email protected]>
---
 code/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index 134573e..85719b3 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -6,6 +6,7 @@ set(CMAKE_CXX_STANDARD 17)
 cmake_policy(SET CMP0087 NEW)
 # override "lib64" to be "lib" unless the user explicitly sets it.
 set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "directory for libraries" FORCE)
+include(CMakeDependentOption)
 include(GNUInstallDirs)
 
 cmake_dependent_option(LIBSWOC_INSTALL

Reply via email to