diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 19:56:09 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 19:56:09 +0300 |
| commit | 7fb132859fda54aa96bc9dd46d302b343eeb5a02 (patch) | |
| tree | b43ae77d7451fb470a260c03349a1caf2846c5e5 /neozip/cmake/fallback-macros.cmake | |
| parent | b1e34e861b5d732afe828d58aad2c638135061fd (diff) | |
| parent | c2712b8a345191f6ed79558c089777df94590087 (diff) | |
| download | Project-Tick-7fb132859fda54aa96bc9dd46d302b343eeb5a02.tar.gz Project-Tick-7fb132859fda54aa96bc9dd46d302b343eeb5a02.zip | |
Add 'neozip/' from commit 'c2712b8a345191f6ed79558c089777df94590087'
git-subtree-dir: neozip
git-subtree-mainline: b1e34e861b5d732afe828d58aad2c638135061fd
git-subtree-split: c2712b8a345191f6ed79558c089777df94590087
Diffstat (limited to 'neozip/cmake/fallback-macros.cmake')
| -rw-r--r-- | neozip/cmake/fallback-macros.cmake | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/neozip/cmake/fallback-macros.cmake b/neozip/cmake/fallback-macros.cmake new file mode 100644 index 0000000000..d2375cdcc7 --- /dev/null +++ b/neozip/cmake/fallback-macros.cmake @@ -0,0 +1,29 @@ +# fallback-macros.cmake -- CMake fallback macros +# Copyright (C) 2026 Vladislav Shchapov +# Licensed under the Zlib license, see LICENSE.md for details + +# Workaround for FetchContent EXCLUDE_FROM_ALL implementation for CMake before 3.28. +# The EXCLUDE_FROM_ALL argument for FetchContent_Declare added in version 3.28. +# Before CMake 3.28, FetchContent_MakeAvailable would add dependencies to the ALL target. +macro(ZNG_FetchContent_MakeAvailable) + if(CMAKE_VERSION VERSION_LESS 3.28) + foreach(__zng_contentName IN ITEMS ${ARGV}) + string(TOLOWER ${__zng_contentName} __zng_contentNameLower) + FetchContent_GetProperties(${__zng_contentName}) + if(NOT ${__zng_contentNameLower}_POPULATED) + FetchContent_Populate(${__zng_contentName}) + add_subdirectory(${${__zng_contentNameLower}_SOURCE_DIR} ${${__zng_contentNameLower}_BINARY_DIR} EXCLUDE_FROM_ALL) + endif() + endforeach() + unset(__zng_contentName) + unset(__zng_contentNameLower) + else() + FetchContent_MakeAvailable(${ARGV}) + endif() +endmacro() + +if(CMAKE_VERSION VERSION_LESS 3.28) + set(ZNG_FetchContent_Declare_EXCLUDE_FROM_ALL) +else() + set(ZNG_FetchContent_Declare_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL) +endif() |
