[cmake] Install .desktop & menu entries
authorMyhailo Danylenko <isbear@ukrpost.net>
Thu, 19 Jul 2012 12:13:16 +0300
changeset 32 b257e55b48fc
parent 31 e02c22bf6115
child 33 ce47dc7fc6c0
[cmake] Install .desktop & menu entries
add-cmake
--- a/add-cmake	Thu Jul 19 10:07:43 2012 +0300
+++ b/add-cmake	Thu Jul 19 12:13:16 2012 +0300
@@ -4,7 +4,7 @@
 
 diff -r e2ba0b74584c .hgignore
 --- a/.hgignore	Thu Jul 19 08:06:20 2012 +0300
-+++ b/.hgignore	Thu Jul 19 10:06:52 2012 +0300
++++ b/.hgignore	Thu Jul 19 12:09:29 2012 +0300
 @@ -34,3 +34,5 @@
  tags
  mcabber/ptodo
@@ -13,8 +13,8 @@
 +mcabber/build
 diff -r e2ba0b74584c mcabber/CMakeLists.txt
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/mcabber/CMakeLists.txt	Thu Jul 19 10:06:52 2012 +0300
-@@ -0,0 +1,290 @@
++++ b/mcabber/CMakeLists.txt	Thu Jul 19 12:09:29 2012 +0300
+@@ -0,0 +1,296 @@
 +## Copyright 2010-2012 Myhailo Danylenko
 +# This file is part of mcabber.
 +#
@@ -279,11 +279,15 @@
 +set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
 +include(CPack)
 +
-+## Pkg-config stuff
-+# build time variables (cflags)
-+configure_file ( mcabber.pc.in.in mcabber.pc.in @ONLY )
-+# install time variables (paths)
-+install ( CODE "configure_file ( ${mcabber_BINARY_DIR}/mcabber.pc.in ${mcabber_BINARY_DIR}/mcabber.pc )" )
++## Preinstallation stuff
++if ( MODULES_ENABLE )
++	# build time variables (cflags)
++	configure_file ( mcabber.pc.in.in mcabber.pc.in @ONLY )
++	# install time variables (paths)
++	install ( CODE "configure_file ( ${mcabber_BINARY_DIR}/mcabber.pc.in ${mcabber_BINARY_DIR}/mcabber.pc )" )
++endif ()
++# full executable path in menu entry
++install ( CODE "configure_file ( ${mcabber_SOURCE_DIR}/mcabber.menu.in ${mcabber_BINARY_DIR}/mcabber.menu )" )
 +
 +## Set up installer
 +install ( TARGETS mcabber                                                 DESTINATION bin )
@@ -294,6 +298,8 @@
 +endif ()
 +install ( DIRECTORY doc/help                                              DESTINATION share/mcabber    FILES_MATCHING PATTERN "*.txt" )
 +install ( FILES doc/mcabber.1                                             DESTINATION share/man/man1 )
++install ( FILES mcabber.desktop                                           DESTINATION share/applications )
++install ( FILES ${mcabber_BINARY_DIR}/mcabber.menu                        DESTINATION share/menu                      RENAME mcabber )
 +install ( FILES mcabberrc.example                                         DESTINATION share/doc/${CPACK_PACKAGE_NAME}/examples )
 +install ( FILES ChangeLog                                                 DESTINATION share/doc/${CPACK_PACKAGE_NAME} RENAME changelog )
 +install ( FILES COPYING                                                   DESTINATION share/doc/${CPACK_PACKAGE_NAME} RENAME copyright )
@@ -307,7 +313,7 @@
 +## The End ## vim: se ts=4 sw=4: ##
 diff -r e2ba0b74584c mcabber/config.h.in
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/mcabber/config.h.in	Thu Jul 19 10:06:52 2012 +0300
++++ b/mcabber/config.h.in	Thu Jul 19 12:09:29 2012 +0300
 @@ -0,0 +1,49 @@
 +/* help @help.c */
 +#define DATA_DIR                      "@DATA_DIR@"
@@ -360,7 +366,7 @@
 +/* end */
 diff -r e2ba0b74584c mcabber/configure.ac
 --- a/mcabber/configure.ac	Thu Jul 19 08:06:20 2012 +0300
-+++ b/mcabber/configure.ac	Thu Jul 19 10:06:52 2012 +0300
++++ b/mcabber/configure.ac	Thu Jul 19 12:09:29 2012 +0300
 @@ -36,9 +36,8 @@
  
  # Checks for header files.
@@ -388,14 +394,20 @@
  AC_CHECK_DECLS([strptime],,,
 diff -r e2ba0b74584c mcabber/hgcset.h.in
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/mcabber/hgcset.h.in	Thu Jul 19 10:06:52 2012 +0300
++++ b/mcabber/hgcset.h.in	Thu Jul 19 12:09:29 2012 +0300
 @@ -0,0 +1,3 @@
 +/* this can go to config.h */
 +#define HGCSET "@HGCSET@"
 +/* end */
+diff -r e2ba0b74584c mcabber/mcabber.menu.in
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/mcabber/mcabber.menu.in	Thu Jul 19 12:09:29 2012 +0300
+@@ -0,0 +1,2 @@
++?package(mcabber):needs="text" section="Applications/Network/Communication"\
++  title="mcabber" command="@CMAKE_INSTALL_PREFIX@/bin/mcabber"
 diff -r e2ba0b74584c mcabber/mcabber.pc.in.in
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/mcabber/mcabber.pc.in.in	Thu Jul 19 10:06:52 2012 +0300
++++ b/mcabber/mcabber.pc.in.in	Thu Jul 19 12:09:29 2012 +0300
 @@ -0,0 +1,14 @@
 +prefix=${CMAKE_INSTALL_PREFIX}
 +exec_prefix=$${EMPTY}{prefix}