diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2016-04-12 09:10:40 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2016-04-12 09:10:40 +0000 |
| commit | 5d542ba036017af885913a6dd1f35b91daba047f (patch) | |
| tree | e78d874a6873ed1c42988cdbf147f12f1ef43509 | |
| parent | fix undo clip rendering bug (diff) | |
| download | inkscape-5d542ba036017af885913a6dd1f35b91daba047f.tar.gz inkscape-5d542ba036017af885913a6dd1f35b91daba047f.zip | |
regenerates inkscape-version when revno changes ; Translates inkscape.desktop file (CMake build)
Fixed bugs:
- https://launchpad.net/bugs/1543304
- https://launchpad.net/bugs/1514588
(bzr r14785)
| -rw-r--r-- | CMakeLists.txt | 5 | ||||
| -rw-r--r-- | CMakeScripts/inkscape-desktop.cmake | 9 | ||||
| -rw-r--r-- | CMakeScripts/inkscape-version.cmake | 18 | ||||
| -rw-r--r-- | inkscape.desktop.template | 21 | ||||
| -rw-r--r-- | po/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/inkscape-version.cpp.in | 7 |
7 files changed, 48 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fa0fd24df..e0eb0e5cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,11 +129,6 @@ configure_file( "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/inkscape.desktop.in" - "${CMAKE_BINARY_DIR}/inkscape.desktop" - IMMEDIATE @ONLY) - add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") diff --git a/CMakeScripts/inkscape-desktop.cmake b/CMakeScripts/inkscape-desktop.cmake new file mode 100644 index 000000000..bf3b2b7b7 --- /dev/null +++ b/CMakeScripts/inkscape-desktop.cmake @@ -0,0 +1,9 @@ +# This is called by cmake as an extermal process from +# ./po/CMakeLists.txt and creates inkscape.desktop +# +# These variables are defined by the caller, matching the CMake equivilents. +# - ${INKSCAPE_SOURCE_DIR} +# - ${INKSCAPE_BINARY_DIR} +message("building inkscape.desktop") +set(INKSCAPE_MIMETYPE "image/svg+xml;image/svg+xml-compressed;application/vnd.corel-draw;application/pdf;application/postscript;image/x-eps;application/illustrator;image/cgm;image/x-wmf;application/x-xccx;application/x-xcgm;application/x-xcdt;application/x-xsk1;application/x-xcmx;image/x-xcdr;application/visio;application/x-visio;application/vnd.visio;application/visio.drawing;application/vsd;application/x-vsd;image/x-vsd;") +configure_file(${INKSCAPE_BINARY_DIR}/inkscape.desktop.template.in ${INKSCAPE_BINARY_DIR}/inkscape.desktop) diff --git a/CMakeScripts/inkscape-version.cmake b/CMakeScripts/inkscape-version.cmake index cf6cadbc4..adfb3ddd8 100644 --- a/CMakeScripts/inkscape-version.cmake +++ b/CMakeScripts/inkscape-version.cmake @@ -15,20 +15,6 @@ if(EXISTS ${INKSCAPE_SOURCE_DIR}/.bzr/) OUTPUT_VARIABLE INKSCAPE_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE) endif() +message("revision is " ${INKSCAPE_REVISION}) -file(WRITE - ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp.txt - # unlike autoconf, include config.h - "#ifdef HAVE_CONFIG_H\n" - "# include <config.h>\n" - "#endif\n" - "\n" - "namespace Inkscape {\n" - " char const *version_string = VERSION \" \" \"${INKSCAPE_REVISION}\";\n" - "}\n") - -# Copy the file to the final header only if the version changes -# and avoid needless rebuilds -execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp.txt - ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp) +configure_file(${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp.in ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp) diff --git a/inkscape.desktop.template b/inkscape.desktop.template new file mode 100644 index 000000000..ff95af282 --- /dev/null +++ b/inkscape.desktop.template @@ -0,0 +1,21 @@ +[Desktop Entry] +Version=1.0 +Name=Inkscape +GenericName=Vector Graphics Editor +X-GNOME-FullName=Inkscape Vector Graphics Editor +Comment=Create and edit Scalable Vector Graphics images +Keywords=image;editor;vector;drawing; +Type=Application +Categories=Graphics;VectorGraphics;GTK; +MimeType=${INKSCAPE_MIMETYPE} +Exec=inkscape %F +TryExec=inkscape +Terminal=false +StartupNotify=true +Icon=inkscape +X-Ayatana-Desktop-Shortcuts=Drawing + +[Drawing Shortcut Group] +Name=New Drawing +Exec=inkscape +TargetEnvironment=Unity diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 8633c484d..9261765c6 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -5,3 +5,12 @@ foreach(language ${LANGUAGES}) set(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${language}.po) GETTEXT_PROCESS_PO_FILES(${language} ALL INSTALL_DESTINATION "share/locale/" PO_FILES ${pofile}) endforeach(language) + + +#translates inkscape.desktop +add_custom_target(inkscape_desktop DEPENDS ${CMAKE_BINARY_DIR}/inkscape.desktop) +add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/inkscape.desktop +DEPENDS ${LANGUAGES} +COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --desktop --template ${CMAKE_SOURCE_DIR}/inkscape.desktop.template -d ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_BINARY_DIR}/inkscape.desktop.template.in --keyword=Name --keyword=GenericName --keyword=X-GNOME-FullName --keyword=Comment --keyword=Keywords +COMMAND ${CMAKE_COMMAND} -DINKSCAPE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DINKSCAPE_BINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-desktop.cmake) +add_dependencies(inkscape inkscape_desktop) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 30af55925..5c436cefb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -443,11 +443,6 @@ endif() # a custom target that is always built add_custom_target( inkscape_version ALL - DEPENDS ${CMAKE_BINARY_DIR}/src/inkscape-version.cpp) - -# creates inkscape-version.cpp using cmake script -add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/src/inkscape-version.cpp COMMAND ${CMAKE_COMMAND} -DINKSCAPE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DINKSCAPE_BINARY_DIR=${CMAKE_BINARY_DIR} diff --git a/src/inkscape-version.cpp.in b/src/inkscape-version.cpp.in new file mode 100644 index 000000000..b4ea5028d --- /dev/null +++ b/src/inkscape-version.cpp.in @@ -0,0 +1,7 @@ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +namespace Inkscape { + char const *version_string = VERSION " " "${INKSCAPE_REVISION}"; +} |
