forked from ornladios/ADIOS2-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
41 lines (31 loc) · 1.17 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
cmake_minimum_required(VERSION 3.8)
set(CMAKE_CXX_STANDARD 17)
# 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(ADIOS2Examples VERSION 2.5.0)
# to enable -DADIOS2_ROOT in modern cmake
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# Dependencies
find_package(ADIOS2 REQUIRED 2.5.0)
find_package(MPI)
# Workaround for various MPI implementations forcing the link of C++ bindings
add_definitions(-DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX)
# place executables
# define CMAKE_INSTALL_BINDIR
include(GNUInstallDirs)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# set build type
set(CMAKE_BUILD_TYPE Release)
enable_testing()
set(NPROCS 2)
add_subdirectory(source)