From a7d3abb5aeebd90f719263ed408f737df29904bb Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Tue, 29 Aug 2023 20:36:32 -0700 Subject: [PATCH] CMake: Verify pyAMReX_..._src paths exit (#182) Give a clean error message if a `pyAMReX_thirdparty_src` directory does not exist. --- cmake/dependencies/AMReX.cmake | 3 +++ cmake/dependencies/pybind11.cmake | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cmake/dependencies/AMReX.cmake b/cmake/dependencies/AMReX.cmake index 14990aaf..d6adc64a 100644 --- a/cmake/dependencies/AMReX.cmake +++ b/cmake/dependencies/AMReX.cmake @@ -4,6 +4,9 @@ macro(find_amrex) elseif(pyAMReX_amrex_src) message(STATUS "Compiling local AMReX ...") message(STATUS "AMReX source path: ${pyAMReX_amrex_src}") + if(NOT IS_DIRECTORY ${pyAMReX_amrex_src}) + message(FATAL_ERROR "Specified directory pyAMReX_amrex_src='${pyAMReX_amrex_src}' does not exist!") + endif() elseif(pyAMReX_amrex_internal) message(STATUS "Downloading AMReX ...") message(STATUS "AMReX repository: ${pyAMReX_amrex_repo} (${pyAMReX_amrex_branch})") diff --git a/cmake/dependencies/pybind11.cmake b/cmake/dependencies/pybind11.cmake index 626f5e66..bee122e5 100644 --- a/cmake/dependencies/pybind11.cmake +++ b/cmake/dependencies/pybind11.cmake @@ -4,6 +4,9 @@ function(find_pybind11) elseif(pyAMReX_pybind11_src) message(STATUS "Compiling local pybind11 ...") message(STATUS "pybind11 source path: ${pyAMReX_pybind11_src}") + if(NOT IS_DIRECTORY ${pyAMReX_pybind11_src}) + message(FATAL_ERROR "Specified directory pyAMReX_pybind11_src='${pyAMReX_pybind11_src}' does not exist!") + endif() elseif(pyAMReX_pybind11_internal) message(STATUS "Downloading pybind11 ...") message(STATUS "pybind11 repository: ${pyAMReX_pybind11_repo} (${pyAMReX_pybind11_branch})")