[chrome-gnome-shell/feature/distutils] distutils: properly pass root and prefix variables



commit 4f87eb6c029256bfe9f10463e4344478c0035344
Author: Yuri Konotopov <ykonotopov gmail com>
Date:   Sun Aug 7 23:44:05 2016 +0300

    distutils: properly pass root and prefix variables

 CMakeLists.txt |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86fbc86..3763583 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,7 +91,17 @@ if(BUILD_CONNECTOR)
        configure_file("${CMAKE_CURRENT_SOURCE_DIR}/connector/org.gnome.chrome_gnome_shell.json"
                        "${CMAKE_BINARY_DIR}/")
 
-       install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CONNECTOR_SETUP} install --root 
${CMAKE_INSTALL_PREFIX})")
+       install(CODE "
+               if(DEFINED ENV{DESTDIR})
+                       set(DESTDIR \"\$ENV{DESTDIR}\")
+               else(DEFINED ENV{DESTDIR})
+                       set(DESTDIR \"/\")
+               endif(DEFINED ENV{DESTDIR})
+
+               execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CONNECTOR_SETUP}
+                                       install
+                                               --root \"\${DESTDIR}\"
+                                               --prefix \"${CMAKE_INSTALL_PREFIX}\")")
        install(FILES "${CMAKE_BINARY_DIR}/io.github.ne0sight.gs_chrome_connector.json" DESTINATION 
"/etc/chromium/native-messaging-hosts/")
        install(FILES "${CMAKE_BINARY_DIR}/io.github.ne0sight.gs_chrome_connector.json" DESTINATION 
"/etc/opt/chrome/native-messaging-hosts/")
        install(FILES "${CMAKE_BINARY_DIR}/org.gnome.chrome_gnome_shell.json" DESTINATION 
"/etc/chromium/native-messaging-hosts/")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]