Debian Codegraph @

examples/simulations/heatTransfer/readFileOnly/CMakeLists.txt

raw
1 # SPDX-FileCopyrightText: 2026 Oak Ridge National Laboratory and Contributors
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 #------------------------------------------------------------------------------#
6 # Distributed under the OSI-approved Apache License, Version 2.0. See
7 # accompanying file Copyright.txt for details.
8 #------------------------------------------------------------------------------#
9
10 cmake_minimum_required(VERSION 3.12)
11 project(ADIOS2SimulationsHeatTransferReadFileOnlyExample)
12
13 set(maybe_standalone_project OFF)
14 if(NOT TARGET adios2_core)
15 set(maybe_standalone_project ON)
16 set(_components C CXX)
17
18 find_package(MPI COMPONENTS ${_components})
19 if(MPI_FOUND)
20 # Workaround for various MPI implementations forcing the link of C++ bindings
21 add_definitions(-DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX)
22
23 list(APPEND _components MPI)
24 endif()
25
26 find_package(ADIOS2 REQUIRED COMPONENTS ${_components})
27 endif()
28
29 if(ADIOS2_HAVE_MPI)
30 add_executable(adios2_simulations_heatTransferReadFileOnly heatReadFileOnly.cpp PrintData.h)
31 target_link_libraries(adios2_simulations_heatTransferReadFileOnly adios2::cxx_mpi MPI::MPI_CXX)
32 if (maybe_standalone_project)
33 install(TARGETS adios2_simulations_heatTransferReadFileOnly RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
34 endif()
35 endif()