- Remove obsolete globbing for *.c files.
- Do not install anything remaining in legacyheaders/, which makes it
possible to remove the whole CMakeLists.txt files from there.
- Add gmx_add_libgromacs_sources() as an alternative to globbing, and
use it in places where we were only using the globbing to get full
paths (so that they work where we want).
Change-Id: I654b84b6f48b7991faa3d7a349d5118be932493d
set(LIBGROMACS_SOURCES)
+set_property(GLOBAL PROPERTY GMX_LIBGROMACS_SOURCES)
set_property(GLOBAL PROPERTY GMX_INSTALLED_HEADERS)
+function (_gmx_add_files_to_property PROPERTY)
+ foreach (_file ${ARGN})
+ if (IS_ABSOLUTE "${_file}")
+ set_property(GLOBAL APPEND PROPERTY ${PROPERTY} ${_file})
+ else()
+ set_property(GLOBAL APPEND PROPERTY ${PROPERTY}
+ ${CMAKE_CURRENT_LIST_DIR}/${_file})
+ endif()
+ endforeach()
+endfunction ()
+
+function (gmx_add_libgromacs_sources)
+ _gmx_add_files_to_property(GMX_LIBGROMACS_SOURCES ${ARGN})
+endfunction ()
+
function (gmx_install_headers)
if (NOT GMX_BUILD_MDRUN_ONLY)
file(RELATIVE_PATH _dest ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_LIST_DIR})
DESTINATION "${INCL_INSTALL_DIR}/${_dest}"
COMPONENT development)
endif()
- foreach (_file ${ARGN})
- if (IS_ABSOLUTE "${_file}")
- set_property(GLOBAL APPEND PROPERTY GMX_INSTALLED_HEADERS ${_file})
- else()
- set_property(GLOBAL APPEND PROPERTY GMX_INSTALLED_HEADERS
- ${CMAKE_CURRENT_LIST_DIR}/${_file})
- endif()
- endforeach()
+ _gmx_add_files_to_property(GMX_INSTALLED_HEADERS ${ARGN})
endfunction ()
function (gmx_write_installed_header_list)
add_subdirectory(simd)
add_subdirectory(imd)
if (NOT GMX_BUILD_MDRUN_ONLY)
- add_subdirectory(legacyheaders)
add_subdirectory(gmxana)
add_subdirectory(gmxpreprocess)
add_subdirectory(correlationfunctions)
add_subdirectory(tools)
endif()
-list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES})
+get_property(PROPERTY_SOURCES GLOBAL PROPERTY GMX_LIBGROMACS_SOURCES)
+list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES} ${PROPERTY_SOURCES})
# This would be the standard way to include thread_mpi, but
# we want libgromacs to link the functions directly
# Recent versions of gcc and clang give warnings on scanner.cpp, which
# is a generated source file. These are awkward to suppress inline, so
# we do it in the compilation command (after testing that the compiler
-# supports the suppressions). Setting the properties only works after
-# the related target has been created, e.g. after when the file is
-# used with add_library().
+# supports the suppressions).
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wno-unused-parameter HAS_NO_UNUSED_PARAMETER)
if (HAS_NO_UNUSED_PARAMETER)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015, 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.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-# GLOB is used to get full paths
-file(GLOB FFT_SOURCES
- fft.cpp fft5d.cpp parallel_3dfft.cpp)
+gmx_add_libgromacs_sources(
+ fft.cpp
+ fft5d.cpp
+ parallel_3dfft.cpp
+ )
if (GMX_FFT_FFTPACK)
- file(GLOB FFT_SPECIFIC_SOURCES fft_fftpack.cpp)
- list(APPEND FFT_SPECIFIC_SOURCES
- ${CMAKE_SOURCE_DIR}/src/external/fftpack/fftpack.c)
+ gmx_add_libgromacs_sources(
+ fft_fftpack.cpp
+ ${CMAKE_SOURCE_DIR}/src/external/fftpack/fftpack.c)
endif()
if (GMX_FFT_FFTW3)
- file(GLOB FFT_SPECIFIC_SOURCES fft_fftw3.cpp)
+ gmx_add_libgromacs_sources(fft_fftw3.cpp)
endif()
if (GMX_FFT_MKL)
- file(GLOB FFT_SPECIFIC_SOURCES fft_mkl.cpp)
+ gmx_add_libgromacs_sources(fft_mkl.cpp)
endif()
-set(LIBGROMACS_SOURCES
- ${LIBGROMACS_SOURCES} ${FFT_SOURCES} ${FFT_SPECIFIC_SOURCES} PARENT_SCOPE)
-
gmx_install_headers(fft.h)
if (BUILD_TESTING)
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-file(GLOB FILEIO_SOURCES *.cpp *.c)
+file(GLOB FILEIO_SOURCES *.cpp)
if(GMX_USE_PLUGINS)
set(FILEIO_SOURCES ${FILEIO_SOURCES} ${CMAKE_SOURCE_DIR}/src/external/vmd_molfile/vmddlopen.c)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015, 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.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-file(GLOB GMXANA_SOURCES *.c *.cpp)
+file(GLOB GMXANA_SOURCES *.cpp)
gmx_install_headers(
gstat.h
# The nonbonded directory contains subdirectories that are only
# conditionally built, so we cannot use a GLOB_RECURSE here.
-file(GLOB GMXLIB_SOURCES *.c *.cpp)
+file(GLOB GMXLIB_SOURCES *.cpp)
# gpu utils + cuda tools module
if(GMX_GPU)
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-file(GLOB HARDWARE_SOURCES hardwaretopology.cpp cpuinfo.cpp)
-set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${HARDWARE_SOURCES} PARENT_SCOPE)
+gmx_add_libgromacs_sources(
+ cpuinfo.cpp
+ hardwaretopology.cpp
+ )
if (BUILD_TESTING)
add_subdirectory(tests)
+++ /dev/null
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2014,2015, 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.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-# includes: Nothing to build, just installation
-file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
-gmx_install_headers(${HEADERS})
-
-add_subdirectory(types)
+++ /dev/null
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2014, 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.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-# includes: Nothing to build, just installation
-file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
-list(REMOVE_ITEM HEADERS commrec.h)
-gmx_install_headers(${HEADERS})
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2010,2013,2014,2015, 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.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-file(GLOB TRAJECTORYANALYSIS_SOURCES *.cpp modules/*.cpp modules/*.c)
+file(GLOB TRAJECTORYANALYSIS_SOURCES *.cpp modules/*.cpp)
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TRAJECTORYANALYSIS_SOURCES} PARENT_SCOPE)
gmx_install_headers(
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-file(GLOB UTILITY_SOURCES *.c *.cpp)
+file(GLOB UTILITY_SOURCES *.cpp)
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${UTILITY_SOURCES} PARENT_SCOPE)
gmx_install_headers(