Always use relative install paths.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 10 Nov 2012 20:01:23 +0000 (22:01 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sat, 10 Nov 2012 20:01:23 +0000 (22:01 +0200)
Simplifies the build system, and makes it much simpler to write custom
install rules (will add some shortly).

Change-Id: I02066af15edb27609a386bc4585dfdad5c06d1d5

CMakeLists.txt

index 4485f35b33e5ccc9f43564f11d02725ddcce9f5e..b8f5b02be91f9177475f50125e3d9bb91a27418c 100644 (file)
@@ -56,15 +56,11 @@ set(API_VERSION ${NUM_VERSION})
 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 
 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND UNIX)
-set(CMAKE_INSTALL_PREFIX "/usr/local/gromacs" CACHE STRING "Installation prefix (installation will need write permissions here)" FORCE)
+    set(CMAKE_INSTALL_PREFIX "/usr/local/gromacs" CACHE STRING "Installation prefix (installation will need write permissions here)" FORCE)
 endif()
 
-if (GMX_USE_RELATIVE_INSTALL_PATH)
-    set(GMX_INSTALL_PREFIX "" CACHE STRING "Prefix gets appended to CMAKE_INSTALL_PREFIX. For cpack it sets the root folder of the archive.")
-    mark_as_advanced(GMX_INSTALL_PREFIX)
-else()
-    set(GMX_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
-endif()
+set(GMX_INSTALL_PREFIX "" CACHE STRING "Prefix gets appended to CMAKE_INSTALL_PREFIX. For cpack it sets the root folder of the archive.")
+mark_as_advanced(GMX_INSTALL_PREFIX)
 
 if(NOT CMAKE_BUILD_TYPE)
     set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
@@ -73,15 +69,9 @@ endif(NOT CMAKE_BUILD_TYPE)
 enable_language(C)
 enable_language(CXX)
 
-set(GMX_USE_RELATIVE_INSTALL_PATH OFF CACHE STRING "Use relative paths not absolute paths for cmake install. Has only an effect on cpack.")
-mark_as_advanced(GMX_USE_RELATIVE_INSTALL_PATH)
-
 set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
 set(CPACK_PACKAGE_VENDOR "gromacs.org")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Gromacs - a toolkit for high-performance molecular simulation")
-if (NOT GMX_USE_RELATIVE_INSTALL_PATH)
-    set(CPACK_SET_DESTDIR "ON")
-endif()
 set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/admin/InstallWelcome.txt")
 # Its GPL/LGPL, so they do not have to agree to a license for mere usage, but some installers require this...
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")