mirror of
https://github.com/triqs/dft_tools
synced 2024-09-12 13:48:30 +02:00
[cmake] Use GIT_TAG instead of TAG for external_dependency function
This commit is contained in:
parent
cce7b5cd2f
commit
d9f8e1e0bf
6
deps/CMakeLists.txt
vendored
6
deps/CMakeLists.txt
vendored
@ -5,7 +5,7 @@ include(external_dependency.cmake)
|
|||||||
# external_dependency(name
|
# external_dependency(name
|
||||||
# [VERSION <version-number>]
|
# [VERSION <version-number>]
|
||||||
# [GIT_REPO <url>]
|
# [GIT_REPO <url>]
|
||||||
# [TAG <tag>]
|
# [GIT_TAG <tag>]
|
||||||
# [EXCLUDE_FROM_ALL]
|
# [EXCLUDE_FROM_ALL]
|
||||||
# )
|
# )
|
||||||
#
|
#
|
||||||
@ -23,7 +23,7 @@ include(external_dependency.cmake)
|
|||||||
#
|
#
|
||||||
# Addtional options:
|
# Addtional options:
|
||||||
#
|
#
|
||||||
# TAG - Use this keyword to specify the git tag or branch
|
# GIT_TAG - Use this keyword to specify the git-tag, branch or commit hash
|
||||||
#
|
#
|
||||||
# EXCLUDE_FROM_ALL - If set, targets of the dependency cmake subproject
|
# EXCLUDE_FROM_ALL - If set, targets of the dependency cmake subproject
|
||||||
# will not be included in the ALL target of the project.
|
# will not be included in the ALL target of the project.
|
||||||
@ -42,6 +42,6 @@ endif()
|
|||||||
# -- GTest --
|
# -- GTest --
|
||||||
external_dependency(GTest
|
external_dependency(GTest
|
||||||
GIT_REPO https://github.com/google/googletest
|
GIT_REPO https://github.com/google/googletest
|
||||||
TAG release-1.10.0
|
GIT_TAG release-1.10.0
|
||||||
EXCLUDE_FROM_ALL
|
EXCLUDE_FROM_ALL
|
||||||
)
|
)
|
||||||
|
6
deps/external_dependency.cmake
vendored
6
deps/external_dependency.cmake
vendored
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
function(external_dependency)
|
function(external_dependency)
|
||||||
cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL" "VERSION;GIT_REPO;TAG" "" ${ARGN})
|
cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL" "VERSION;GIT_REPO;GIT_TAG" "" ${ARGN})
|
||||||
|
|
||||||
# -- Was dependency already found?
|
# -- Was dependency already found?
|
||||||
get_property(${ARGV0}_FOUND GLOBAL PROPERTY ${ARGV0}_FOUND)
|
get_property(${ARGV0}_FOUND GLOBAL PROPERTY ${ARGV0}_FOUND)
|
||||||
@ -32,8 +32,8 @@ function(external_dependency)
|
|||||||
set(bin_dir ${CMAKE_CURRENT_BINARY_DIR}/${ARGV0})
|
set(bin_dir ${CMAKE_CURRENT_BINARY_DIR}/${ARGV0})
|
||||||
set(src_dir ${bin_dir}_src)
|
set(src_dir ${bin_dir}_src)
|
||||||
if(NOT IS_DIRECTORY ${src_dir})
|
if(NOT IS_DIRECTORY ${src_dir})
|
||||||
if(ARG_TAG)
|
if(ARG_GIT_TAG)
|
||||||
set(clone_opts --branch ${ARG_TAG} -c advice.detachedHead=false)
|
set(clone_opts --branch ${ARG_GIT_TAG} -c advice.detachedHead=false)
|
||||||
endif()
|
endif()
|
||||||
execute_process(COMMAND git clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir})
|
execute_process(COMMAND git clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir})
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user