From 6e87557c0816e1237e0cb0dc6eba96a154bc88cc Mon Sep 17 00:00:00 2001 From: John Szakmeister Date: Sun, 9 Nov 2014 17:48:19 -0500 Subject: build: allow installing into the root directory (/) It turns out that CMake always canonicalizes `CMAKE_INSTALL_PREFIX` to an absolute path--if it's a relative path, it canonicalizes it relative to the build directory. As a result, the only thing the DESTDIR and relative directory check prevents is an installation into the root directory since CMake strips the trailing slash, turning "/" into an empty string. Let's just remove the check all together, since it cannot accomplish what we intended. --- cmake/InstallHelpers.cmake | 4 ---- 1 file changed, 4 deletions(-) (limited to 'cmake') diff --git a/cmake/InstallHelpers.cmake b/cmake/InstallHelpers.cmake index 763b2a092c..bd03ae3875 100644 --- a/cmake/InstallHelpers.cmake +++ b/cmake/InstallHelpers.cmake @@ -22,10 +22,6 @@ function(create_install_dir_with_perms) install(CODE " - if(DEFINED ENV{DESTDIR} AND NOT IS_ABSOLUTE \${CMAKE_INSTALL_PREFIX}) - message(FATAL_ERROR \"Install prefix must be absolute when using DESTDIR\") - endif() - set(_current_dir \"\${CMAKE_INSTALL_PREFIX}/${_install_dir_DESTINATION}\") set(_dir_permissions \"${_install_dir_DIRECTORY_PERMISSIONS}\") -- cgit