Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename GetDownloadSpec to GetDownloadClause #29

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,25 @@ elseif(NOT CMAKE_CROSSCOMPILING)
endif()

#-----------------------------------------------------------------------
# GetDownloadSpec
# GetDownloadClause
#
# Generates the ExternalProject_Add() parameters needed to download
# a git repository and returns them in the VAR parameter. Returns an
# empty string if the DOWNLOAD option is false.
#-----------------------------------------------------------------------

function(GetDownloadSpec VAR _url _tag)
function(GetDownloadClause VAR _url _tag)
if(DOWNLOAD)
set(_spec
set(_clause
GIT_REPOSITORY ${_url}
GIT_TAG ${_tag}
GIT_PROGRESS ON
)
else()
set(_spec "")
set(_clause "")
endif()
set(${VAR} ${_spec} PARENT_SCOPE)
endfunction(GetDownloadSpec)
set(${VAR} ${_clause} PARENT_SCOPE)
endfunction(GetDownloadClause)

#-----------------------------------------------------------------------
# Dependencies
Expand Down
4 changes: 2 additions & 2 deletions cmake/abseil-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ if(DEFINED CURRENT_CXX_STANDARD AND NOT CURRENT_CXX_STANDARD STREQUAL "")
)
endif()

GetDownloadSpec(DOWNLOAD_ABSL ${ABSEIL_GIT_URL} ${ABSEIL_GIT_TAG})
GetDownloadClause(_download_clause ${ABSEIL_GIT_URL} ${ABSEIL_GIT_TAG})

ExternalProject_Add(abseil-cpp
${DOWNLOAD_ABSL}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/abseil-cpp
Expand Down
4 changes: 2 additions & 2 deletions cmake/c-ares.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#

GetDownloadSpec(DOWNLOAD_CARES ${CARES_GIT_URL} ${CARES_GIT_TAG})
GetDownloadClause(_download_clause ${CARES_GIT_URL} ${CARES_GIT_TAG})

ExternalProject_Add(cares
${DOWNLOAD_CARES}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/c-ares
Expand Down
4 changes: 2 additions & 2 deletions cmake/cctz.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#

GetDownloadSpec(DOWNLOAD_CCTZ ${CCTZ_GIT_URL} ${CCTZ_GIT_TAG})
GetDownloadClause(_download_clause ${CCTZ_GIT_URL} ${CCTZ_GIT_TAG})

ExternalProject_Add(cctz
${DOWNLOAD_CCTZ}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/cctz
Expand Down
4 changes: 2 additions & 2 deletions cmake/gflags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#

GetDownloadSpec(DOWNLOAD_GFLAGS ${GFLAGS_GIT_URL} ${GFLAGS_GIT_TAG})
GetDownloadClause(_download_clause ${GFLAGS_GIT_URL} ${GFLAGS_GIT_TAG})

ExternalProject_Add(gflags
${DOWNLOAD_GFLAGS}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/gflags
Expand Down
4 changes: 2 additions & 2 deletions cmake/glog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#

GetDownloadSpec(DOWNLOAD_GLOG ${GLOG_GIT_URL} ${GLOG_GIT_TAG})
GetDownloadClause(_download_clause ${GLOG_GIT_URL} ${GLOG_GIT_TAG})

ExternalProject_Add(glog
${DOWNLOAD_GLOG}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/glog
Expand Down
4 changes: 2 additions & 2 deletions cmake/grpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ if(DEFINED CURRENT_CXX_STANDARD AND NOT CURRENT_CXX_STANDARD STREQUAL "")
set(_grpc_cxx_standard -DCMAKE_CXX_STANDARD=${CURRENT_CXX_STANDARD})
endif()

GetDownloadSpec(_download_clause ${GRPC_GIT_URL} ${GRPC_GIT_TAG})

if(OVERRIDE_PKGS)
set(_package_providers
-DgRPC_ABSL_PROVIDER=package
Expand All @@ -64,6 +62,8 @@ if(OVERRIDE_PKGS)
)
endif()

GetDownloadClause(_download_clause ${GRPC_GIT_URL} ${GRPC_GIT_TAG})

ExternalProject_Add(grpc
${_download_clause}
${_patch_clause}
Expand Down
4 changes: 2 additions & 2 deletions cmake/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#

GetDownloadSpec(DOWNLOAD_GTEST ${GTEST_GIT_URL} ${GTEST_GIT_TAG})
GetDownloadClause(_download_clause ${GTEST_GIT_URL} ${GTEST_GIT_TAG})

ExternalProject_Add(gtest
${DOWNLOAD_GTEST}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/gtest
Expand Down
4 changes: 2 additions & 2 deletions cmake/json.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#

GetDownloadSpec(DOWNLOAD_JSON ${JSON_GIT_URL} ${JSON_GIT_TAG})
GetDownloadClause(_download_clause ${JSON_GIT_URL} ${JSON_GIT_TAG})

ExternalProject_Add(json
${DOWNLOAD_JSON}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/json
Expand Down
6 changes: 3 additions & 3 deletions cmake/protobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ unset(_absl_provider)
unset(_build_shared_libs)
unset(_source_subdir)

GetDownloadSpec(DOWNLOAD_PROTOBUF ${PROTOBUF_GIT_URL} ${PROTOBUF_GIT_TAG})

# In older versions of protobuf, the primary CMakeLists.txt file
# is in the cmake subdirectory.
if(NOT RECENT_PKGS)
Expand All @@ -31,8 +29,10 @@ if(RECENT_PKGS)
set(_absl_provider -Dprotobuf_ABSL_PROVIDER=package)
endif()

GetDownloadClause(_download_clause ${PROTOBUF_GIT_URL} ${PROTOBUF_GIT_TAG})

ExternalProject_Add(protobuf
${DOWNLOAD_PROTOBUF}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/protobuf
Expand Down
4 changes: 2 additions & 2 deletions cmake/zlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#

GetDownloadSpec(DOWNLOAD_ZLIB ${ZLIB_GIT_URL} ${ZLIB_GIT_TAG})
GetDownloadClause(_download_clause ${ZLIB_GIT_URL} ${ZLIB_GIT_TAG})

ExternalProject_Add(zlib
${DOWNLOAD_ZLIB}
${_download_clause}

SOURCE_DIR
${DEPS_SOURCE_DIR}/zlib
Expand Down