Skip to content

Commit

Permalink
Merge pull request #6 from chuckatkins/add-mpi-dependency
Browse files Browse the repository at this point in the history
Add mpi dependency
  • Loading branch information
Chuck Atkins authored Dec 13, 2016
2 parents 2ff8853 + 1d527d4 commit f7c8a42
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

#------------------------------------------------------------------------------#
Expand Down Expand Up @@ -50,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
#------------------------------------------------------------------------------#
Expand Down
16 changes: 12 additions & 4 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f7c8a42

Please sign in to comment.