Browse Source

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

Fixes issue #52
release-1.0
David Sansome 12 years ago
parent
commit
35a306b9a7
  1. 9
      CMakeLists.txt
  2. 23
      cmake_uninstall.cmake.in
  3. 12
      src/CMakeLists.txt

9
CMakeLists.txt

@ -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

@ -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)

12
src/CMakeLists.txt

@ -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
)
Loading…
Cancel
Save