3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-29 00:15:00 +02:00

[cmake] Manage dependencies in a seperate deps subdirectory

This commit is contained in:
Nils Wentzell 2020-04-22 15:04:30 -04:00
parent 2736682002
commit b9d934554c
5 changed files with 30 additions and 4 deletions

View File

@ -52,6 +52,10 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR (NOT IS_ABSOLUTE ${CMAKE_INSTA
endif()
message(STATUS "-------- CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} --------")
# ############
# Dependencies
add_subdirectory(deps)
# ############
# Options

18
deps/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,18 @@
# Each dependency should be either
# * a cmake subproject in this directory
# * found in the system using find_package
# Provide either a download.sh script to get all sources
# or use e.g. git subtree/submodule or softlinks
# Add all subdirectories as CMake Sub-Projects
file(GLOB allfiles CONFIGURE_DEPENDS *)
foreach(file ${allfiles})
if(IS_DIRECTORY ${file})
add_subdirectory(${file})
endif()
endforeach()
# -- googletest --
if(NOT TARGET gtest)
find_package(GTest REQUIRED)
endif()

1
deps/download.sh vendored Executable file
View File

@ -0,0 +1 @@
git clone https://github.com/google/googletest --branch v1.10.x --depth 1

View File

@ -19,6 +19,13 @@ Installation steps
$ git clone https://github.com/TRIQS/app4triqs app4triqs.src
#. Make sure that all additional dependencies are installed on your system and available in your environment.
Alternatively build the dependencies from source instead with::
$ (cd deps && ./download.sh)
In this case they will be installed together with your application.
#. Create and move to a new directory where you will compile the code::
$ mkdir app4triqs.build && cd app4triqs.build

View File

@ -1,7 +1,3 @@
# Build googletest
set(PYTHON_EXECUTABLE ${TRIQS_PYTHON_EXECUTABLE})
add_subdirectory(gtest EXCLUDE_FROM_ALL)
# Copy h5 files to binary dir
file(GLOB_RECURSE all_h5_ref_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.ref.h5)
foreach(file ${all_h5_ref_files})