From 79855a74504e5e5a0bc8a09e95e64ee1be281948 Mon Sep 17 00:00:00 2001 From: Dilawar Singh <dilawars@ncbs.res.in> Date: Tue, 27 Jun 2017 11:31:46 +0530 Subject: [PATCH] Squashed 'moose-core/' changes from a13dbd9..95fe1a7 95fe1a7 Force --install-layout=deb when on debian/ubuntu. git-subtree-dir: moose-core git-subtree-split: 95fe1a7b8f24b50d600d5e7c3a1d0171a809b9aa --- CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12874339..13c902e1 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 -- GitLab