diff --git a/CMakeLists.txt b/CMakeLists.txt index fe301b0a..f6a915d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt new file mode 100644 index 00000000..13b691e8 --- /dev/null +++ b/deps/CMakeLists.txt @@ -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() diff --git a/deps/download.sh b/deps/download.sh new file mode 100755 index 00000000..f9f2bfac --- /dev/null +++ b/deps/download.sh @@ -0,0 +1 @@ +git clone https://github.com/google/googletest --branch v1.10.x --depth 1 diff --git a/doc/install.rst b/doc/install.rst index 38303d11..08b85434 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -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 diff --git a/test/c++/CMakeLists.txt b/test/c++/CMakeLists.txt index 86ccb533..15bcdfdb 100644 --- a/test/c++/CMakeLists.txt +++ b/test/c++/CMakeLists.txt @@ -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})