From 005c018b3de8fa5130a7204000d5ec6aea14abe3 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Fri, 9 Dec 2016 09:11:33 -0500 Subject: [PATCH 1/3] Block in-source-builds --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec47dd506f..9c3809584d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,14 @@ #------------------------------------------------------------------------------# cmake_minimum_required(VERSION 3.7) + +# Fail immediately if not using an out-of-source build +if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) + message(FATAL_ERROR + "In-source builds are not supported. Please create a build directory " + "separate from the source directory") +endif() + project(ADIOS VERSION 2.0.0) #------------------------------------------------------------------------------# From 35eed0dfcfe94a1513402a43be2140eef1216a2a Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Tue, 13 Dec 2016 16:14:33 -0500 Subject: [PATCH 2/3] ThirdParty: Fix USE_SYSTEM option for GTest --- thirdparty/CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 17c6380627..39215e37af 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -14,14 +14,22 @@ set(EP_ARGS # Use Google Test for a unit testing framework cmake_dependent_option(ADIOS_USE_SYSTEM_GOOGLETEST - "Use a system-supplied Google Test framework" OFF + "Use a system-supplied Google Test framework" ON "BUILD_TESTING" OFF) if(BUILD_TESTING) - if(NOT ADIOS_USE_SYSTEM_GOOGLETEST) - add_subdirectory(googletest) + if(ADIOS_USE_SYSTEM_GOOGLETEST) + find_package(GTest REQUIRED) + if(NOT GTEST_FOUND) + message(WARNING + "Unable to find Google Test framework. " + "Using an internal version") + set(ADIOS_USE_SYSTEM_GOOGLETEST OFF + CACHE BOOL "Use a system-supplied Google Test framework" FORCE) + endif() endif() - find_package(GTest REQUIRED) if(NOT ADIOS_USE_SYSTEM_GOOGLETEST) + add_subdirectory(googletest) + find_package(GTest REQUIRED) add_dependencies(GTest::GTest googletest) add_dependencies(GTest::Main googletest) endif() From 1d527d4275bf05b600f70c1db47574b794a6af9d Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Tue, 13 Dec 2016 16:15:20 -0500 Subject: [PATCH 3/3] Add MPI dependency --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c3809584d..7fa43ba2fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,16 @@ if(ADIOS_ENABLE_PIC) set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() +# MPI +option(ADIOS_USE_MPI "Enable the MPI version of ADIOS" ON) +if(ADIOS_USE_MPI) + find_package(MPI COMPONENTS C) + if(NOT MPI_FOUND) + message(WARNING "Unable to find MPI. Disabling ADIOS_USE_MPI") + set(ADIOS_USE_MPI OFF CACHE BOOL "Enable the MPI version of ADIOS" FORCE) + endif() +endif() + #------------------------------------------------------------------------------# # Third party libraries #------------------------------------------------------------------------------#