2020-04-24 23:52:27 +02:00
|
|
|
include(external_dependency.cmake)
|
2020-04-22 21:04:30 +02:00
|
|
|
|
2020-04-24 23:52:27 +02:00
|
|
|
# Add your dependencies with the function
|
|
|
|
#
|
|
|
|
# external_dependency(name
|
|
|
|
# [VERSION <version-number>]
|
|
|
|
# [GIT_REPO <url>]
|
2020-04-28 22:25:28 +02:00
|
|
|
# [GIT_TAG <tag>]
|
2020-04-28 23:18:25 +02:00
|
|
|
# [BUILD_ALWAYS]
|
2020-04-24 23:52:27 +02:00
|
|
|
# [EXCLUDE_FROM_ALL]
|
|
|
|
# )
|
|
|
|
#
|
|
|
|
# Resolve the dependency using the following steps in order.
|
|
|
|
# If a step was successful, skip the remaining ones.
|
|
|
|
#
|
|
|
|
# 1. Use find_package(name [<version-number>])
|
|
|
|
# to locate the package in the system.
|
|
|
|
# Skip this step if Build_Deps option is set.
|
|
|
|
# 2. Try to find a directory containing the sources
|
|
|
|
# at ${CMAKE_SOURCE_DIR}/deps/name. If found
|
|
|
|
# build it as a cmake sub-project.
|
|
|
|
# 3. If GIT_REPO is provided, git clone the sources,
|
|
|
|
# and build them as a cmake sub-project.
|
|
|
|
#
|
|
|
|
# Addtional options:
|
|
|
|
#
|
2020-04-28 22:25:28 +02:00
|
|
|
# GIT_TAG - Use this keyword to specify the git-tag, branch or commit hash
|
2020-04-24 23:52:27 +02:00
|
|
|
#
|
2020-04-28 23:18:25 +02:00
|
|
|
# BUILD_ALWAYS - If set, this dependency will always be built from source
|
|
|
|
# and will never be searched in the system.
|
|
|
|
#
|
2020-04-24 23:52:27 +02:00
|
|
|
# EXCLUDE_FROM_ALL - If set, targets of the dependency cmake subproject
|
|
|
|
# will not be included in the ALL target of the project.
|
|
|
|
# In particular the dependency will not be installed.
|
2020-04-22 21:04:30 +02:00
|
|
|
|
2020-04-28 22:23:27 +02:00
|
|
|
if(NOT DEFINED Build_Deps)
|
|
|
|
set(Build_Deps "Never" CACHE STRING "Do we build dependencies from source? [Never/Always/IfNotFound]")
|
|
|
|
else()
|
|
|
|
set(Build_Deps_Opts "Never" "Always" "IfNotFound")
|
|
|
|
if(NOT ${Build_Deps} IN_LIST Build_Deps_Opts)
|
|
|
|
message(FATAL_ERROR "Build_Deps option should be either 'Never', 'Always' or 'IfNotFound'")
|
|
|
|
endif()
|
|
|
|
set(Build_Deps ${Build_Deps} CACHE STRING "Do we build dependencies from source? [Never/Always/IfNotFound]")
|
2020-05-01 20:28:44 +02:00
|
|
|
if(NOT IS_SUBPROJECT AND NOT Build_Deps STREQUAL "Always" AND (ASAN OR UBSAN))
|
|
|
|
message(WARNING "For builds with llvm sanitizers (ASAN/UBSAN) it is recommended to use -DBuild_Deps=Always to avoid false positives.")
|
|
|
|
endif()
|
2020-04-28 22:23:27 +02:00
|
|
|
endif()
|
2020-04-24 23:52:27 +02:00
|
|
|
|
|
|
|
# -- GTest --
|
|
|
|
external_dependency(GTest
|
2020-04-28 22:23:27 +02:00
|
|
|
GIT_REPO https://github.com/google/googletest
|
2020-04-28 22:25:28 +02:00
|
|
|
GIT_TAG release-1.10.0
|
2020-04-28 23:18:25 +02:00
|
|
|
BUILD_ALWAYS
|
2020-04-24 23:52:27 +02:00
|
|
|
EXCLUDE_FROM_ALL
|
|
|
|
)
|
2020-04-29 21:30:19 +02:00
|
|
|
|
|
|
|
# -- Cpp2Py --
|
|
|
|
external_dependency(Cpp2Py
|
|
|
|
GIT_REPO https://github.com/TRIQS/cpp2py
|
|
|
|
VERSION 2.0
|
2020-04-29 21:38:45 +02:00
|
|
|
GIT_TAG master
|
2020-04-29 21:30:19 +02:00
|
|
|
EXCLUDE_FROM_ALL
|
|
|
|
)
|