From 51061e906868bdc059c5cf79317f99d7f40efff8 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Wed, 4 Aug 2021 09:35:34 -0400 Subject: [PATCH] deps built via ExternalProject_add use default dir structure of FetchContent (CMAKE_BINARY_DIR/_deps, etc.) --- external/cutt.cmake | 10 +++++----- external/eigen.cmake | 6 ++---- external/madness.cmake | 16 ++++++++-------- external/umpire.cmake | 10 +++++----- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/external/cutt.cmake b/external/cutt.cmake index e0fbf00c5d..f945b54b15 100644 --- a/external/cutt.cmake +++ b/external/cutt.cmake @@ -23,10 +23,10 @@ else() enable_language(C) # set source and build path for cuTT in the TiledArray project - set(EXTERNAL_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/source/cutt) + set(EXTERNAL_SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/cutt-src) # cutt only supports in source build - set(EXTERNAL_BUILD_DIR ${PROJECT_BINARY_DIR}/external/build/cutt) - set(EXTERNAL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/external/cutt) + set(EXTERNAL_BUILD_DIR ${CMAKE_BINARY_DIR}/_deps/cutt-build) + set(EXTERNAL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) if (NOT CUTT_URL) set(CUTT_URL https://github.com/ValeevGroup/cutt.git) @@ -92,8 +92,8 @@ else() ExternalProject_Add(cutt PREFIX ${CMAKE_INSTALL_PREFIX} - STAMP_DIR ${PROJECT_BINARY_DIR}/external/cutt-stamp - TMP_DIR ${PROJECT_BINARY_DIR}/external/tmp + STAMP_DIR ${CMAKE_BINARY_DIR}/_deps/cutt-ep-artifacts + TMP_DIR ${CMAKE_BINARY_DIR}/_deps/cutt-ep-artifacts # needed in case CMAKE_INSTALL_PREFIX is not writable #--Download step-------------- DOWNLOAD_DIR ${EXTERNAL_SOURCE_DIR} GIT_REPOSITORY ${CUTT_URL} diff --git a/external/eigen.cmake b/external/eigen.cmake index 1b034177b7..361a8fe8ae 100644 --- a/external/eigen.cmake +++ b/external/eigen.cmake @@ -93,15 +93,13 @@ else() include(ExternalProject) # Set source and build path for Eigen3 in the TiledArray Project - set(EXTERNAL_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/source/eigen) - set(EXTERNAL_BUILD_DIR ${PROJECT_BINARY_DIR}/external/build/eigen) + set(EXTERNAL_SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/eigen-src) + set(EXTERNAL_BUILD_DIR ${CMAKE_BINARY_DIR}/_deps/eigen-build) message("** Will build Eigen from ${EIGEN3_URL}") ExternalProject_Add(eigen3 PREFIX ${CMAKE_INSTALL_PREFIX} - STAMP_DIR ${EXTERNAL_BUILD_DIR}/stamp - TMP_DIR ${EXTERNAL_BUILD_DIR}/tmp #--Download step-------------- DOWNLOAD_DIR ${EXTERNAL_SOURCE_DIR} URL ${EIGEN3_URL} diff --git a/external/madness.cmake b/external/madness.cmake index 0c9f2fa482..9ab766f7e6 100644 --- a/external/madness.cmake +++ b/external/madness.cmake @@ -129,9 +129,9 @@ else() # Create a cache entry for MADNESS build variables. # Note: This will not overwrite user specified values. - set(MADNESS_SOURCE_DIR "${PROJECT_BINARY_DIR}/external/madness-src" CACHE PATH + set(MADNESS_SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/madness-src" CACHE PATH "Path to the MADNESS source directory") - set(MADNESS_BINARY_DIR "${PROJECT_BINARY_DIR}/external/madness-build" CACHE PATH + set(MADNESS_BINARY_DIR "${CMAKE_BINARY_DIR}/_deps/madness-build" CACHE PATH "Path to the MADNESS build directory") set(MADNESS_URL "https://github.com/m-a-d-n-e-s-s/madness.git" CACHE STRING "Path to the MADNESS repository") @@ -152,16 +152,16 @@ else() # If the MADNESS source directory is the default location and does not exist, # MADNESS will be downloaded from git. message(STATUS "Checking MADNESS source directory: ${MADNESS_SOURCE_DIR}") - if("${MADNESS_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}/external/madness-src") + if("${MADNESS_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}/_deps/madness-src") - # Create the external source directory - if(NOT EXISTS ${PROJECT_BINARY_DIR}/external) + # Create the source directory + if(NOT EXISTS ${CMAKE_BINARY_DIR}/_deps) set(error_code 1) execute_process( - COMMAND "${CMAKE_COMMAND}" -E make_directory "${PROJECT_BINARY_DIR}/external" + COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_BINARY_DIR}/_deps" RESULT_VARIABLE error_code) if(error_code) - message(FATAL_ERROR "Failed to create directory \"${PROJECT_BINARY_DIR}/external\"") + message(FATAL_ERROR "Failed to create directory \"${CMAKE_BINARY_DIR}/_deps\"") endif() endif() @@ -173,7 +173,7 @@ else() while(error_code AND number_of_tries LESS 3) execute_process( COMMAND ${GIT_EXECUTABLE} clone ${MADNESS_URL} madness-src - WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps RESULT_VARIABLE error_code) math(EXPR number_of_tries "${number_of_tries} + 1") endwhile() diff --git a/external/umpire.cmake b/external/umpire.cmake index 964f9f65b7..d90100cf4d 100644 --- a/external/umpire.cmake +++ b/external/umpire.cmake @@ -29,9 +29,9 @@ else() enable_language(C) # set source and build path for Umpire in the TiledArray project - set(EXTERNAL_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/source/Umpire) - set(EXTERNAL_BUILD_DIR ${PROJECT_BINARY_DIR}/external/build/Umpire) - set(EXTERNAL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/external/Umpire) + set(EXTERNAL_SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/umpire-src) + set(EXTERNAL_BUILD_DIR ${CMAKE_BINARY_DIR}/_deps/umpire-build) + set(EXTERNAL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) if (NOT UMPIRE_URL) set(UMPIRE_URL https://github.com/LLNL/Umpire.git) @@ -107,8 +107,8 @@ else() ExternalProject_Add(Umpire PREFIX ${CMAKE_INSTALL_PREFIX} - STAMP_DIR ${PROJECT_BINARY_DIR}/external/Umpire-stamp - TMP_DIR ${PROJECT_BINARY_DIR}/external/tmp + STAMP_DIR ${CMAKE_BINARY_DIR}/_deps/umpire-ep-artifacts + TMP_DIR ${CMAKE_BINARY_DIR}/_deps/umpire-ep-artifacts # needed in case CMAKE_INSTALL_PREFIX is not writable #--Download step-------------- DOWNLOAD_DIR ${EXTERNAL_SOURCE_DIR} GIT_REPOSITORY ${UMPIRE_URL}