geary/cmake/FindIntltool.cmake
Michael James Gratton 4a2ba1446d Fix cmake warning CMP0040 in cmake/FindDesktopFileValidate.cmake.
* desktop/CMakeLists.txt: Fix name of Elementary Contractor desktop file
  and disable Desktop file validation for it since it doesn't actually
  validate.

* cmake/FindDesktopFileValidate.cmake, cmake/FindIntltool.cmake: Don't
  assume XDG Desktop files are named ".desktop" - they aren't for
  Elementary's Contractor. Require callers to pass the full name in, fix
  call sites.
2016-08-11 18:45:24 +10:00

37 lines
1.7 KiB
CMake

# FindIntltool.cmake
#
# Jim Nelson <jim@yorba.org>
# Copyright 2016 Software Freedom Conservancy Inc.
find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge)
if (INTLTOOL_MERGE_EXECUTABLE)
set (INTLTOOL_MERGE_FOUND TRUE)
else (INTLTOOL_MERGE_EXECUTABLE)
set (INTLTOOL_MERGE_FOUND FALSE)
endif (INTLTOOL_MERGE_EXECUTABLE)
if (INTLTOOL_MERGE_FOUND)
macro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
add_custom_target (geary.desktop ALL
${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.in ${desktop_id}
)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
macro (INTLTOOL_MERGE_AUTOSTART_DESKTOP desktop_id po_dir)
add_custom_target (geary-autostart.desktop ALL
${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.in ${desktop_id}
)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary-autostart.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
endmacro (INTLTOOL_MERGE_AUTOSTART_DESKTOP desktop_id po_dir)
macro (INTLTOOL_MERGE_CONTRACT desktop_id po_dir)
add_custom_target (geary-attach.contract ALL
${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.in ${desktop_id}
)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary-attach.contract DESTINATION ${CMAKE_INSTALL_PREFIX}/share/contractor)
endmacro (INTLTOOL_MERGE_CONTRACT desktop_id po_dir)
endif (INTLTOOL_MERGE_FOUND)