Closes #5168 Post-install steps are now optional

This commit is contained in:
Eric Gregory 2012-05-01 17:18:43 -07:00
parent c74af1ece7
commit ebcfa96faa
3 changed files with 72 additions and 11 deletions

View file

@ -18,6 +18,18 @@ set(RELEASE_NAME "Lightweight email client for GNOME.")
set(VERSION "0.0.0+trunk")
set(VERSION_INFO "Release")
option(ICON_UPDATE "Run gtk-update-icon-cache after the install." ON)
option(DESKTOP_UPDATE "Run update-desktop-database after the install." ON)
if (ICON_UPDATE)
message(STATUS "Icon cache will be updated")
endif ()
if (DESKTOP_UPDATE)
message(STATUS "Desktop database will be updated")
endif ()
add_subdirectory(src)
add_subdirectory(icons)
add_subdirectory(sql)
@ -33,12 +45,6 @@ install(
DESTINATION
share/applications
)
install(
CODE
"execute_process (COMMAND update-desktop-database)"
CODE
"execute_process (COMMAND gtk-update-icon-cache -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)"
)
#
# Uninstall target
@ -55,9 +61,23 @@ add_custom_target(
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
COMMAND
${glib_schema_compiler} ${GSETTINGS_DIR}
COMMAND
update-desktop-database
COMMAND
gtk-update-icon-cache -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
)
# Optional: run update-desktop-database at install time.
if (DESKTOP_UPDATE)
install(
CODE
"execute_process (COMMAND update-desktop-database)"
CODE
"message (STATUS \"Updating desktop database\")"
)
add_custom_target(
uninstall-desktop-update
DEPENDS
uninstall
COMMAND
update-desktop-database
)
endif ()

24
configure vendored
View file

@ -20,6 +20,15 @@ configure_help() {
printf "\t--prefix=PREFIX\t\tPrepend PREFIX to program installation paths.\n"
printf "\t\t\t\t[%s]\n" $DEFAULT_PREFIX
printf "\t--disable-schemas-compile\n"
printf "\t\t\t\tDisable compiling the GSettings schema.\n"
printf "\t--disable-desktop-update\n"
printf "\t\t\t\tDisable desktop database update.\n"
printf "\t--disable-icon-update\n"
printf "\t\t\t\tDisable icon cache update.\n"
printf "\n"
}
@ -47,7 +56,20 @@ do
abort $1
fi
CMDLINE="${CMDLINE}-DCMAKE_INSTALL_PREFIX=${value} "
CMDLINE="${CMDLINE} -DCMAKE_INSTALL_PREFIX=${value}"
;;
--disable-schemas-compile)
CMDLINE="${CMDLINE} -DGSETTINGS_COMPILE=OFF"
CMDLINE="${CMDLINE} -DGSETTINGS_COMPILE_IN_PLACE=OFF"
;;
--disable-icon-update)
CMDLINE="${CMDLINE} -DICON_UPDATE=OFF"
;;
--disable-desktop-update)
CMDLINE="${CMDLINE} -DDESKTOP_UPDATE=OFF"
;;
*) abort $option

View file

@ -16,3 +16,22 @@ set(ICON_FILES
install(FILES ${ICON_FILES} DESTINATION ${ICONS_DEST})
install(FILES geary.png DESTINATION share/icons/hicolor/scalable/apps)
# Optional: update icon cache at install time.
if (ICON_UPDATE)
install(
CODE
"execute_process (COMMAND gtk-update-icon-cache -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)"
CODE
"message (STATUS \"Updating icon cache\")"
)
add_custom_target(
uninstall-icon-cache
DEPENDS
uninstall
COMMAND
gtk-update-icon-cache -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
)
endif ()