Install .desktop file and icon. Also add an "uninstall" target.

Fixes issue #52
This commit is contained in:
David Sansome 2010-03-04 16:41:14 +00:00
parent 534d7f0fb6
commit 35a306b9a7
3 changed files with 43 additions and 1 deletions

View File

@ -82,3 +82,12 @@ add_subdirectory(3rdparty/qxt)
add_subdirectory(src)
add_subdirectory(tests)
# Uninstall support
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

23
cmake_uninstall.cmake.in Normal file
View File

@ -0,0 +1,23 @@
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling \"${file}\"")
IF(EXISTS "${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF("${rm_retval}" STREQUAL 0)
ELSE("${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"")
ENDIF("${rm_retval}" STREQUAL 0)
ELSE(EXISTS "${file}")
MESSAGE(STATUS "File \"${file}\" does not exist.")
ENDIF(EXISTS "${file}")
ENDFOREACH(file)

View File

@ -229,4 +229,14 @@ set_target_properties(clementine PROPERTIES
install(TARGETS clementine
BUNDLE DESTINATION bin
RUNTIME DESTINATION bin)
RUNTIME DESTINATION bin
)
install(FILES ../dist/clementine_64.png
DESTINATION share/icons/hicolor/64x64/apps/
RENAME application-x-clementine.png
)
install(FILES ../dist/clementine.desktop
DESTINATION share/applications
)