|
| 1 | +# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and |
| 2 | +# other Axom Project Developers. See the top-level LICENSE file for details. |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: (BSD-3-Clause) |
| 5 | +#------------------------------------------------------------------------------ |
| 6 | +# Sina -- API to write data to Sina's common file format |
| 7 | +#------------------------------------------------------------------------------ |
| 8 | + |
| 9 | +#------------------------------------------------------------------------------ |
| 10 | +# Specify necessary dependencies |
| 11 | +# |
| 12 | +# Note: Sina also optionally depends on Adiak when AXOM_USE_ADIAK=ON |
| 13 | +#------------------------------------------------------------------------------ |
| 14 | +axom_component_requires(NAME Sina |
| 15 | + TPLS Conduit ) |
| 16 | + |
| 17 | +#------------------------------------------------------------------------------ |
| 18 | +# Specify the sina headers/sources |
| 19 | +#------------------------------------------------------------------------------ |
| 20 | +set(sina_headers |
| 21 | + core/ConduitUtil.hpp |
| 22 | + core/Curve.hpp |
| 23 | + core/CurveSet.hpp |
| 24 | + core/DataHolder.hpp |
| 25 | + core/Datum.hpp |
| 26 | + core/Document.hpp |
| 27 | + core/File.hpp |
| 28 | + core/ID.hpp |
| 29 | + core/Record.hpp |
| 30 | + core/Relationship.hpp |
| 31 | + core/Run.hpp |
| 32 | + ) |
| 33 | + |
| 34 | +set(sina_sources |
| 35 | + core/ConduitUtil.cpp |
| 36 | + core/Curve.cpp |
| 37 | + core/CurveSet.cpp |
| 38 | + core/DataHolder.cpp |
| 39 | + core/Datum.cpp |
| 40 | + core/Document.cpp |
| 41 | + core/File.cpp |
| 42 | + core/ID.cpp |
| 43 | + core/Record.cpp |
| 44 | + core/Relationship.cpp |
| 45 | + core/Run.cpp |
| 46 | + ) |
| 47 | + |
| 48 | +# Add Adiak header and source |
| 49 | +blt_list_append( TO sina_headers ELEMENTS core/AdiakWriter.hpp IF AXOM_USE_ADIAK ) |
| 50 | +blt_list_append( TO sina_sources ELEMENTS core/AdiakWriter.cpp IF AXOM_USE_ADIAK ) |
| 51 | + |
| 52 | +# Add fortran interface for Sina |
| 53 | +if (ENABLE_FORTRAN) |
| 54 | + blt_list_append( TO sina_headers ELEMENTS interface/sina_fortran_interface.h) |
| 55 | + blt_list_append( TO sina_sources |
| 56 | + ELEMENTS interface/sina_fortran_interface.cpp interface/sina_fortran_interface.f) |
| 57 | +endif() |
| 58 | + |
| 59 | +#------------------------------------------------------------------------------ |
| 60 | +# Build and install the library |
| 61 | +#------------------------------------------------------------------------------ |
| 62 | +set(sina_depends |
| 63 | + core |
| 64 | + conduit::conduit |
| 65 | + ) |
| 66 | + |
| 67 | +blt_list_append( TO sina_depends ELEMENTS adiak::adiak IF AXOM_USE_ADIAK ) |
| 68 | + |
| 69 | +axom_add_library(NAME sina |
| 70 | + SOURCES ${sina_sources} |
| 71 | + HEADERS ${sina_headers} |
| 72 | + DEPENDS_ON ${sina_depends} |
| 73 | + FOLDER axom/sina) |
| 74 | + |
| 75 | +axom_write_unified_header(NAME sina |
| 76 | + HEADERS ${sina_headers}) |
| 77 | + |
| 78 | +axom_install_component(NAME sina |
| 79 | + HEADERS ${sina_headers}) |
| 80 | + |
| 81 | +#------------------------------------------------------------------------------ |
| 82 | +# Add tests and examples |
| 83 | +#------------------------------------------------------------------------------ |
| 84 | +if(AXOM_ENABLE_TESTS) |
| 85 | + add_subdirectory(tests) |
| 86 | +endif() |
| 87 | + |
| 88 | +if(AXOM_ENABLE_EXAMPLES) |
| 89 | + add_subdirectory(examples) |
| 90 | +endif() |
0 commit comments