| 1 |
# |
| 2 |
# This file is part of the GROMACS molecular simulation package. |
| 3 |
# |
| 4 |
# Copyright 2025- The GROMACS Authors |
| 5 |
# and the project initiators Erik Lindahl, Berk Hess and David van der Spoel. |
| 6 |
# Consult the AUTHORS/COPYING files and https://www.gromacs.org for details. |
| 7 |
# |
| 8 |
# GROMACS is free software; you can redistribute it and/or |
| 9 |
# modify it under the terms of the GNU Lesser General Public License |
| 10 |
# as published by the Free Software Foundation; either version 2.1 |
| 11 |
# of the License, or (at your option) any later version. |
| 12 |
# |
| 13 |
# GROMACS is distributed in the hope that it will be useful, |
| 14 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
# Lesser General Public License for more details. |
| 17 |
# |
| 18 |
# You should have received a copy of the GNU Lesser General Public |
| 19 |
# License along with GROMACS; if not, see |
| 20 |
# https://www.gnu.org/licenses, or write to the Free Software Foundation, |
| 21 |
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 22 |
# |
| 23 |
# If you want to redistribute modifications to GROMACS, please |
| 24 |
# consider that scientific software is very special. Version |
| 25 |
# control is crucial - bugs must be traceable. We will be happy to |
| 26 |
# consider code for inclusion in the official distribution, but |
| 27 |
# derived work must not be called official GROMACS. Details are found |
| 28 |
# in the README & COPYING files - if they are missing, get the |
| 29 |
# official version at https://www.gromacs.org. |
| 30 |
# |
| 31 |
# To help us fund GROMACS development, we humbly ask that you cite |
| 32 |
# the research papers on the package. Check out https://www.gromacs.org. |
| 33 |
|
| 34 |
# Set up the module library |
| 35 |
add_library(h5md OBJECT) |
| 36 |
|
| 37 |
gmx_manage_hdf5() |
| 38 |
|
| 39 |
if(GMX_USE_HDF5) |
| 40 |
target_sources(h5md PRIVATE |
| 41 |
h5md.cpp |
| 42 |
h5md_attribute.cpp |
| 43 |
h5md_datasetbase.cpp |
| 44 |
h5md_error.cpp |
| 45 |
h5md_fixeddataset.cpp |
| 46 |
h5md_framedataset.cpp |
| 47 |
h5md_group.cpp |
| 48 |
h5md_guard.cpp |
| 49 |
h5md_particleblock.cpp |
| 50 |
h5md_timedatablock.cpp |
| 51 |
h5md_topologyutils.cpp |
| 52 |
) |
| 53 |
|
| 54 |
target_include_directories(h5md SYSTEM PUBLIC ${HDF5_INCLUDE_DIRS}) |
| 55 |
target_link_libraries(h5md PUBLIC ${HDF5_LIBRARIES}) |
| 56 |
else() |
| 57 |
# We do not need to compile H5md implementation files if we aren't building with it |
| 58 |
target_sources(h5md PRIVATE h5md.cpp) |
| 59 |
endif() |
| 60 |
|
| 61 |
target_link_libraries(h5md PRIVATE |
| 62 |
common |
| 63 |
legacy_api |
| 64 |
legacy_modules |
| 65 |
math |
| 66 |
topology |
| 67 |
utility |
| 68 |
) |
| 69 |
|
| 70 |
if (BUILD_SHARED_LIBS) |
| 71 |
set_target_properties(h5md PROPERTIES POSITION_INDEPENDENT_CODE ON) |
| 72 |
endif() |
| 73 |
|
| 74 |
# Set required compile flags |
| 75 |
gmx_target_compile_options(h5md) |
| 76 |
target_compile_definitions(h5md PRIVATE HAVE_CONFIG_H) |
| 77 |
|
| 78 |
if (BUILD_TESTING) |
| 79 |
add_subdirectory(tests) |
| 80 |
endif() |