Browse Source

ENH: fail with error if trying to create a RPM stating that rpmbuild can't
handle spaces

Alex

Alexander Neundorf 18 năm trước cách đây
mục cha
commit
483a147136
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      Modules/CPackRPM.cmake

+ 4 - 0
Modules/CPackRPM.cmake

@@ -17,6 +17,10 @@ IF(NOT RPMBUILD_EXECUTABLE)
   MESSAGE(FATAL_ERROR "RPM package requires rpmbuild executable")
 ENDIF(NOT RPMBUILD_EXECUTABLE)
 
+IF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
+  MESSAGE(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
+ENDIF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
+
 # If rpmbuild is found 
 # we try to discover alien since we may be on non RPM distro like Debian.
 # In this case we may try to to use more advanced features