<dd>Required compiler flags.</dd>
</dl>
+Additionally an imported target named `Gromacs::libgromacs` is provided and can
+be used with `target_link_libraries(foo PRIVATE Gromacs::libgromacs)`.
+
Declared macros/functions that can be used for checking for correctness of some
settings:
Also, please use the syntax :issue:`number` to reference issues on GitLab, without the
a space between the colon and number!
+Fixed exported libgromacs CMake target
+""""""""""""""""""""""""""""""""""""""
+
+Update the exported libgromacs CMake target to not depend on non-
+existing include paths and add GMX_DOUBLE define to interface
+definitions. The target now gets exported into the Gromacs namespace.
+
+:issue:`3468`
# for the binary
if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS)
install(TARGETS libgromacs
+ COMPONENT libraries
EXPORT libgromacs
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- INCLUDES DESTINATION include
- COMPONENT libraries)
+ INCLUDES DESTINATION include)
+ target_compile_definitions(libgromacs PUBLIC $<INSTALL_INTERFACE:GMX_DOUBLE=${GMX_DOUBLE_VALUE}>)
+ add_library(Gromacs::libgromacs ALIAS libgromacs)
endif()
if (NOT GMX_BUILD_MDRUN_ONLY)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014,2016,2018,2019, by the GROMACS development team, led by
+# Copyright (c) 2014,2016,2018,2019,2020, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
endif()
install(EXPORT libgromacs
FILE ${EXPORT_FILE_NAME}
+ NAMESPACE Gromacs::
DESTINATION ${GMX_INSTALL_CMAKEPKGDIR}
COMPONENT libraries)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014,2016,2019, by the GROMACS development team, led by
+# Copyright (c) 2014,2016,2019,2020, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
include(${_gmx_import_file})
unset(_gmx_import_file)
-get_target_property(_libs libgromacs INTERFACE_LINK_LIBRARIES)
+get_target_property(_libs Gromacs::libgromacs INTERFACE_LINK_LIBRARIES)
if (_libs MATCHES "tng_io::tng_io")
include(CMakeFindDependencyMacro)
- find_dependency(TNG_IO)
+ find_dependency(TNG_IO REQUIRED)
+endif()
+if (_libs MATCHES "OpenMP::OpenMP_CXX")
+ include(CMakeFindDependencyMacro)
+ find_dependency(OpenMP REQUIRED)
endif()
unset(_libs)
list(APPEND GROMACS_INCLUDE_DIRS ${_gmx_root_dir}/${_dir})
endif()
endforeach()
-set(GROMACS_LIBRARIES libgromacs)
+set(GROMACS_LIBRARIES Gromacs::libgromacs)
set(GROMACS_DEFINITIONS @INSTALLED_HEADER_DEFINITIONS@)
set(GROMACS_IS_DOUBLE @GMX_DOUBLE@)
if (DEFINED GROMACS_SUFFIX AND NOT "${GROMACS_SUFFIX}" STREQUAL "@GMX_LIBS_SUFFIX@")