Move a few defines to buildinfo.h
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 16 May 2015 06:20:27 +0000 (09:20 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 17 May 2015 22:08:11 +0000 (00:08 +0200)
Move CMAKE_INSTALL_PREFIX, CMAKE_SOURCE_DIR, and related defines to
buildinfo.h to reduce exposure of these defines.  In particular, this
removes the need for a ~full rebuild when changing the installation
prefix.

Remove GMX_BINARY_SUFFIX from config.h, as it is no longer used in any
source code.

Change-Id: I830e8df15806a22f40726947c92d2612245d8d25

docs/install-guide/index.rst
src/buildinfo.h.cmakein
src/config.h.cmakein
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/commandline/tests/cmdlinemodulemanager.cpp
src/gromacs/commandline/tests/cmdlineprogramcontext.cpp
src/gromacs/utility/datafilefinder.cpp
src/gromacs/utility/errorformat.cpp
src/testutils/testinit.cpp

index ef7131afc025dce1944030f760bb378e79a6e0f5..ab66e6170757706cac02f50573f74d08174cf7d0 100644 (file)
@@ -379,9 +379,8 @@ configuration, in particular if you need to resolve errors.
 
 A key thing to consider here is the setting of
 ``CMAKE_INSTALL_PREFIX``. You will need to be able to write to this
-directory in order to install |Gromacs| later, and if you change your
-mind later, changing it in the cache triggers a full re-build,
-unfortunately. So if you do not have super-user privileges on your
+directory in order to install |Gromacs| later.
+So if you do not have super-user privileges on your
 machine, then you will need to choose a sensible location within your
 home directory for your |Gromacs| installation. Even if you do have
 super-user privileges, you should use them only for the installation
index cb094830c1b4e2c44fe51453707367814767cbf3..333250ce08eddda463168aae02a69030a290deb6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
 /** C++ compiler flags used to build */
 #define BUILD_CXXFLAGS          "@BUILD_CXXFLAGS@"
 
+/** Installation prefix (default location of data files) */
+#define CMAKE_INSTALL_PREFIX    "@CMAKE_INSTALL_PREFIX@"
+
+/** Source directory for the build */
+#define CMAKE_SOURCE_DIR        "@CMAKE_SOURCE_DIR@"
+
+/** Binary directory for the build */
+#define CMAKE_BINARY_DIR        "@CMAKE_BINARY_DIR@"
+
+/** Location of data files in the installation directory */
+#define DATA_INSTALL_DIR        "@DATA_INSTALL_DIR@"
+
 /** CUDA nvcc compiler version information */
 #define CUDA_NVCC_COMPILER_INFO "@CUDA_NVCC_COMPILER_INFO@"
 
index d5acd94d29211912911c83b833d4900c914d13cf..a480f1cdfe1b72aab4caa1df9ee02507a9757caa 100644 (file)
 /* TODO: For now, disable Doxygen warnings from here */
 /*! \cond */
 
-/* Binary suffix for the created binaries */
-#define GMX_BINARY_SUFFIX "@GMX_BINARY_SUFFIX@"
-
-/* Installation prefix (default location of data files) */
-#define CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
-
-/* Location of data files in the installation directory */
-#define DATA_INSTALL_DIR "@DATA_INSTALL_DIR@"
-
-/* Source directory for the build */
-#cmakedefine CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@"
-
-/* Binary directory for the build */
-#cmakedefine CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@"
-
 /* IEEE754 floating-point format. Memory layout is defined by macros
  * GMX_IEEE754_BIG_ENDIAN_BYTE_ORDER and GMX_IEEE754_BIG_ENDIAN_WORD_ORDER. 
  */
index 084646698075d800cde85b2baf79ac1358f974b0..ebfa26613bf4a9dbb4db7fae4f801a34f6af10c6 100644 (file)
@@ -55,6 +55,7 @@
 
 #include "thread_mpi/mutex.h"
 
+#include "buildinfo.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
 #include "gromacs/utility/gmxassert.h"
index 6a420e921ed7bc7ae6ee98245156990013c12352..d680cfef6e435964c72e22101944ecf4d58055c3 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
-// For GMX_BINARY_SUFFIX
 #include "gmxpre.h"
 
 #include "gromacs/commandline/cmdlinemodulemanager.h"
 
-#include "config.h"
-
 #include <vector>
 
 #include <gmock/gmock.h>
index edfb9491d160afd22d02a0542e7cf10025f3c4b6..3ffdad11aac93099da69399dd704e0c975c8a87b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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.
@@ -51,6 +51,7 @@
 #include <boost/shared_ptr.hpp>
 #include <gtest/gtest.h>
 
+#include "buildinfo.h"
 #include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/path.h"
 
index bdf673df5d6b5adf6344d68643e7ef9940f17518..2bc6a9b875015052bd5bfca2fec774ca94c33a37 100644 (file)
 
 #include "datafilefinder.h"
 
-#include "config.h"
-
 #include <cstdlib>
 
 #include <string>
 #include <vector>
 
+#include "buildinfo.h"
 #include "gromacs/utility/directoryenumerator.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
index a8f7159c296e910c5ee7c90380928a15ba1fda06..74cfeabb3261ead57745b56b0f824f418f84f5b1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,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.
 
 #include "errorformat.h"
 
-#include "config.h"
-
 #include <cctype>
 #include <cstdio>
 #include <cstring>
 
+#include "buildinfo.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/stringutil.h"
index 3969e4c363285e96426ba7d9395705aff3d59895..4bfdd9e2030c690451170887d3bef209064bc609 100644 (file)
 
 #include "testinit.h"
 
-#include "config.h"
-
 #include <cstdio>
 #include <cstdlib>
 
 #include <boost/scoped_ptr.hpp>
 #include <gmock/gmock.h>
 
+#include "buildinfo.h"
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/cmdlinehelpwriter.h"
 #include "gromacs/commandline/cmdlineinit.h"