[geary] Fix cmake warning CMP0040 in cmake/FindDesktopFileValidate.cmake.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Fix cmake warning CMP0040 in cmake/FindDesktopFileValidate.cmake.
- Date: Thu, 11 Aug 2016 08:58:41 +0000 (UTC)
commit 4a2ba1446d2f0e5bcb84bd313d34aaaccb3e3686
Author: Michael James Gratton <mike vee net>
Date: Thu Aug 11 18:27:01 2016 +1000
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.
cmake/FindDesktopFileValidate.cmake | 4 ++--
cmake/FindIntltool.cmake | 6 +++---
desktop/CMakeLists.txt | 31 ++++++++++++++++++-------------
3 files changed, 23 insertions(+), 18 deletions(-)
---
diff --git a/cmake/FindDesktopFileValidate.cmake b/cmake/FindDesktopFileValidate.cmake
index 250c838..0672d61 100644
--- a/cmake/FindDesktopFileValidate.cmake
+++ b/cmake/FindDesktopFileValidate.cmake
@@ -13,8 +13,8 @@ endif (DESKTOP_FILE_VALIDATE_EXECUTABLE)
if (DESKTOP_FILE_VALIDATE_FOUND)
macro (VALIDATE_DESKTOP_FILE desktop_id)
- add_custom_command (TARGET ${desktop_id}.desktop POST_BUILD
- COMMAND ${DESKTOP_FILE_VALIDATE_EXECUTABLE} ${desktop_id}.desktop
+ add_custom_command (TARGET ${desktop_id} POST_BUILD
+ COMMAND ${DESKTOP_FILE_VALIDATE_EXECUTABLE} ${desktop_id}
)
endmacro (VALIDATE_DESKTOP_FILE desktop_id)
endif (DESKTOP_FILE_VALIDATE_FOUND)
diff --git a/cmake/FindIntltool.cmake b/cmake/FindIntltool.cmake
index 067b360..44c3c92 100644
--- a/cmake/FindIntltool.cmake
+++ b/cmake/FindIntltool.cmake
@@ -15,21 +15,21 @@ 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}.desktop.in ${desktop_id}.desktop
+ ${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}.desktop.in ${desktop_id}.desktop
+ ${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}.contract.in ${desktop_id}.contract
+ ${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)
diff --git a/desktop/CMakeLists.txt b/desktop/CMakeLists.txt
index 127911f..f61e912 100644
--- a/desktop/CMakeLists.txt
+++ b/desktop/CMakeLists.txt
@@ -7,13 +7,13 @@ install(FILES geary.appdata.xml DESTINATION share/appdata)
include (FindIntltool)
include (FindDesktopFileValidate)
if (INTLTOOL_MERGE_FOUND)
- INTLTOOL_MERGE_DESKTOP (geary po)
- INTLTOOL_MERGE_AUTOSTART_DESKTOP (geary-autostart po)
+ INTLTOOL_MERGE_DESKTOP (geary.desktop po)
+ INTLTOOL_MERGE_AUTOSTART_DESKTOP (geary-autostart.desktop po)
if (DESKTOP_VALIDATE)
if (DESKTOP_FILE_VALIDATE_FOUND)
- VALIDATE_DESKTOP_FILE (geary)
- VALIDATE_DESKTOP_FILE (geary-autostart)
+ VALIDATE_DESKTOP_FILE (geary.desktop)
+ VALIDATE_DESKTOP_FILE (geary-autostart.desktop)
else (DESKTOP_FILE_VALIDATE_FOUND)
message (FATAL_ERROR "desktop-file-validate must be installed to validate generated .desktop
file")
endif (DESKTOP_FILE_VALIDATE_FOUND)
@@ -50,15 +50,20 @@ if (DISABLE_CONTRACT)
else (DISABLE_CONTRACT)
message (STATUS "Install Contractor contract: ON")
if (INTLTOOL_MERGE_FOUND)
- INTLTOOL_MERGE_CONTRACT (geary-attach po)
-
- if (DESKTOP_VALIDATE)
- if (DESKTOP_FILE_VALIDATE_FOUND)
- VALIDATE_DESKTOP_FILE (geary-attach)
- else (DESKTOP_FILE_VALIDATE_FOUND)
- message (FATAL_ERROR "desktop-file-validate must be installed to validate generated .desktop
file")
- endif (DESKTOP_FILE_VALIDATE_FOUND)
- endif (DESKTOP_VALIDATE)
+ INTLTOOL_MERGE_CONTRACT (geary-attach.contract po)
+
+# Can't validate Contractor file since it isn't a valid Desktop
+# file according to desktop-file-validate from desktop-file-utils 0.22:
+# - geary-attach.contract: error: first group is not "Desktop Entry"
+# - geary-attach.contract: error: file contains group "Contractor Entry",
+# but groups extending the format should start with "X-"
+# - geary-attach.contract: error: filename does not have a .desktop extension
+#
+# if (DESKTOP_VALIDATE)
+# if (DESKTOP_FILE_VALIDATE_FOUND)
+# VALIDATE_DESKTOP_FILE (geary-attach.contract)
+# endif (DESKTOP_FILE_VALIDATE_FOUND)
+# endif (DESKTOP_VALIDATE)
endif (INTLTOOL_MERGE_FOUND)
install (PROGRAMS geary-attach DESTINATION bin)
endif (DISABLE_CONTRACT)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]