Debian Codegraph @

examples/simulations/heatTransfer/inline/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(ADIOS2SimulationsHeatTransferInlineExample)
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(Threads QUIET)
27
28 find_package(ADIOS2 REQUIRED COMPONENTS ${_components})
29 endif()
30
31 if(ADIOS2_HAVE_MPI AND Threads_FOUND)
32 add_executable(adios2_simulations_heatTransferInline
33 main.cpp
34 InlineIO.cpp
35 ../write/HeatTransfer.cpp
36 ../write/Settings.cpp
37 )
38 target_link_libraries(adios2_simulations_heatTransferInline adios2::cxx_mpi MPI::MPI_CXX ${CMAKE_THREAD_LIBS_INIT})
39 if (maybe_standalone_project)
40 install(TARGETS adios2_simulations_heatTransferInline RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
41 endif()
42 endif()