Skip to content
Permalink
Browse files

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

Fixes issue #52
  • Loading branch information...
davidsansome committed Mar 4, 2010
1 parent 534d7f0 commit 35a306b9a711db25aaaca39f5fb538db9b7e8667
Showing with 43 additions and 1 deletion.
  1. +9 −0 CMakeLists.txt
  2. +23 −0 cmake_uninstall.cmake.in
  3. +11 −1 src/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")
@@ -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)

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

0 comments on commit 35a306b

Please sign in to comment.
You can’t perform that action at this time.