diff --git a/CMakeLists.txt b/CMakeLists.txt index 128743396ace18dd14648f837608d71b97991035..13c902e1f7f5f919e527adcaf83c5e4988591dbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,13 +418,16 @@ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/moose # always override debian default installation directory. It will be installed in # site-packages instead of dist-packages. # See https://bugs.launchpad.net/ubuntu/+source/python2.6/+bug/362570 -# HACK: Some trickery is involved. Don't pass --prefix if CMAKE_INSTALL_PREFIX is -# just /usr. This fixes debian builds. +# HACK: Get platform information from python and use it to fix the layout. +execute_process( + COMMAND ${PYTHON_EXECUTABLE} -mplatform OUTPUT_VARIABLE _platform_desc + ) +message( STATUS "Platform ${_platform_desc}" ) + if(WITH_PYTHON) - if( "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" ) - set(EXTRA_ARGS "" ) - else() - set(EXTRA_ARGS "--prefix ${CMAKE_INSTALL_PREFIX}") + set(EXTRA_ARGS "--prefix ${CMAKE_INSTALL_PREFIX}") + if( ${_platform_desc} MATCHES ".*(Ubuntu|Debian).*" ) + list( APPEND EXTRA_ARGS "--install-layout=deb" ) endif( ) install(CODE