mirror of
https://github.com/triqs/dft_tools
synced 2025-01-08 20:33:16 +01:00
[cmake] Add option BUILD_ALWAYS to function external_dependency for force build
This commit is contained in:
parent
984a89e569
commit
a14bf3975b
5
deps/CMakeLists.txt
vendored
5
deps/CMakeLists.txt
vendored
@ -6,6 +6,7 @@ include(external_dependency.cmake)
|
|||||||
# [VERSION <version-number>]
|
# [VERSION <version-number>]
|
||||||
# [GIT_REPO <url>]
|
# [GIT_REPO <url>]
|
||||||
# [GIT_TAG <tag>]
|
# [GIT_TAG <tag>]
|
||||||
|
# [BUILD_ALWAYS]
|
||||||
# [EXCLUDE_FROM_ALL]
|
# [EXCLUDE_FROM_ALL]
|
||||||
# )
|
# )
|
||||||
#
|
#
|
||||||
@ -25,6 +26,9 @@ include(external_dependency.cmake)
|
|||||||
#
|
#
|
||||||
# GIT_TAG - Use this keyword to specify the git-tag, branch or commit hash
|
# GIT_TAG - Use this keyword to specify the git-tag, branch or commit hash
|
||||||
#
|
#
|
||||||
|
# BUILD_ALWAYS - If set, this dependency will always be built from source
|
||||||
|
# and will never be searched in the system.
|
||||||
|
#
|
||||||
# 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.
|
||||||
# In particular the dependency will not be installed.
|
# In particular the dependency will not be installed.
|
||||||
@ -43,5 +47,6 @@ endif()
|
|||||||
external_dependency(GTest
|
external_dependency(GTest
|
||||||
GIT_REPO https://github.com/google/googletest
|
GIT_REPO https://github.com/google/googletest
|
||||||
GIT_TAG release-1.10.0
|
GIT_TAG release-1.10.0
|
||||||
|
BUILD_ALWAYS
|
||||||
EXCLUDE_FROM_ALL
|
EXCLUDE_FROM_ALL
|
||||||
)
|
)
|
||||||
|
4
deps/external_dependency.cmake
vendored
4
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;GIT_TAG" "" ${ARGN})
|
cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL;BUILD_ALWAYS" "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)
|
||||||
@ -10,7 +10,7 @@ function(external_dependency)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# -- Try to find package in system.
|
# -- Try to find package in system.
|
||||||
if(NOT Build_Deps STREQUAL "Always")
|
if(NOT ARG_BUILD_ALWAYS AND NOT Build_Deps STREQUAL "Always")
|
||||||
find_package(${ARGV0} ${${ARGV0}_VERSION} QUIET)
|
find_package(${ARGV0} ${${ARGV0}_VERSION} QUIET)
|
||||||
if(${ARGV0}_FOUND)
|
if(${ARGV0}_FOUND)
|
||||||
message(STATUS "Found dependency ${ARGV0} in system.")
|
message(STATUS "Found dependency ${ARGV0} in system.")
|
||||||
|
Loading…
Reference in New Issue
Block a user