Skip to content

Commit

Permalink
Refs #4754. Ensure CMAKE_SET_DESTDIR doesn't interfere with prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Feb 7, 2012
1 parent a16cbcc commit a8dea67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Code/Mantid/Build/CMake/CPackLinuxSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ if ( ${UNIX_DIST} MATCHES "RedHatEnterprise" OR ${UNIX_DIST} MATCHES "Fedora")
set ( CPACK_RPM_PACKAGE_RELEASE "${CPACK_RPM_PACKAGE_RELEASE}.fc16" )
endif ( ${UNIX_CODENAME} MATCHES "Tikanga" )

# If CMAKE_SET_DESTDIR is ON then the Prefix doesn't get put in the spec file
if ( CMAKE_SET_DESTDIR )
set( CPACK_RPM_SPEC_MORE_DEFINE "Prefix: ${CPACK_PACKAGING_INSTALL_PREFIX}" )
endif()

# according to rpm.org: name-version-release.architecture.rpm
set ( CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE}" )
set( CPACK_RPM_SPEC_MORE_DEFINE "Prefix: ${CPACK_PACKAGING_INSTALL_PREFIX}" )
endif ( RPMBUILD_CMD)
endif ( ${UNIX_DIST} MATCHES "RedHatEnterprise" OR ${UNIX_DIST} MATCHES "Fedora")
2 changes: 1 addition & 1 deletion Code/Mantid/Build/CMake/LinuxSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_remove_links.sh "#!/bin/sh\n"
)

file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_remove_empty_install.sh "#!/bin/sh\n"
"if [ ! -z \"${RPM_INSTALL_PREFIX0}\" ]; then\n"
"if [ ! -z \"$RPM_INSTALL_PREFIX0\" ]; then\n"
" find $RPM_INSTALL_PREFIX0 -mindepth 1 -type d -empty -delete\n"
" rmdir --ignore-fail-on-non-empty -p $RPM_INSTALL_PREFIX0\n"
"fi\n"
Expand Down

0 comments on commit a8dea67

Please sign in to comment.