Install .desktop file and icon. Also add an "uninstall" target.
Fixes issue #52
This commit is contained in:
parent
534d7f0fb6
commit
35a306b9a7
|
@ -82,3 +82,12 @@ add_subdirectory(3rdparty/qxt)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
add_subdirectory(tests)
|
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
|
install(TARGETS clementine
|
||||||
BUNDLE DESTINATION bin
|
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…
Reference in New Issue