[Pkg-privacy-commits] [irssi-plugin-otr] 08/267: make install now determines the install dir. Previously it was determined during the configure process whether to install into the system or the user's directory.
    Ximin Luo 
    infinity0 at moszumanska.debian.org
       
    Sat Aug 22 12:41:21 UTC 2015
    
    
  
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.
commit 3ffd51298f6a536dfca8bea9b7048458920a97d7
Author: Uli Meis <a.sporto+bee at gmail.com>
Date:   Wed Jun 4 02:15:01 2008 +0200
    make install now determines the install dir. Previously it was determined during
    the configure process whether to install into the system or the user's
    directory.
---
 CMakeLists.txt                       | 12 ++----------
 cmake-extensions/InstallAsUser.cmake |  8 ++++++++
 2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69c7eae..898b471 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,16 +104,8 @@ TARGET_LINK_LIBRARIES(otr ${GLIB_LIBRARIES} ${LIBOTR_LIBRARIES})
 
 # Install
 
-EXECUTE_PROCESS(COMMAND "whoami" OUTPUT_VARIABLE WHOAMI)
-IF(WHOAMI STREQUAL "root\n")
-  SET(IRSSIOTR_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/irssi/modules/")
-  MESSAGE(STATUS "Install will be into ${IRSSIOTR_INSTALL_DIR}")
-ELSE(WHOAMI STREQUAL "root\n")
-  SET(IRSSIOTR_INSTALL_DIR "$ENV{HOME}/.irssi/modules/")
-  MESSAGE(STATUS "You're not root. Install will be into ${IRSSIOTR_INSTALL_DIR}")
-ENDIF(WHOAMI STREQUAL "root\n")
-
-INSTALL(TARGETS otr DESTINATION ${IRSSIOTR_INSTALL_DIR})
+INSTALL(SCRIPT cmake-extensions/InstallAsUser.cmake)
+INSTALL(TARGETS otr DESTINATION modules/)
 
 # cscope
 
diff --git a/cmake-extensions/InstallAsUser.cmake b/cmake-extensions/InstallAsUser.cmake
new file mode 100644
index 0000000..e33573d
--- /dev/null
+++ b/cmake-extensions/InstallAsUser.cmake
@@ -0,0 +1,8 @@
+EXECUTE_PROCESS(COMMAND "whoami" OUTPUT_VARIABLE WHOAMI)
+IF(WHOAMI STREQUAL "root\n")
+  SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/lib/irssi)
+ELSE(WHOAMI STREQUAL "root\n")
+  SET(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.irssi")
+  MESSAGE(STATUS "You're not root. Installing into irssi user dir.")
+ENDIF(WHOAMI STREQUAL "root\n")
+MESSAGE(STATUS "Install will be into ${CMAKE_INSTALL_PREFIX}/modules")
-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git
    
    
More information about the Pkg-privacy-commits
mailing list