Commit 47ba544a authored by Patrick Storz's avatar Patrick Storz 🦄

Use share/inkscape subfolder on Windows

First part of #82
parent a5ae1a33
Pipeline #65127631 passed with stages
in 6 minutes and 30 seconds
......@@ -187,11 +187,22 @@ if(GMOCK_PRESENT)
enable_testing()
set(CMAKE_CTEST_COMMAND ctest -V)
if(WIN32)
set(CMAKE_CTEST_ENV INKSCAPE_DATADIR=${CMAKE_CURRENT_SOURCE_DIR}/share)
set(CMAKE_CTEST_ENV INKSCAPE_DATADIR=${CMAKE_BINARY_DIR}/inkscape_datadir)
endif()
add_subdirectory(testfiles EXCLUDE_FROM_ALL)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS tests)
add_dependencies(check inkscape)
if(WIN32)
# create symlink "inkscape_datadir" to use as INKSCAPE_DATADIR
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/share inkscape_share)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/inkscape_datadir
COMMAND mkdir inkscape_datadir
COMMAND mklink /D inkscape_datadir\\inkscape ${inkscape_share}
)
add_custom_target(inkscape_datadir_symlink DEPENDS ${CMAKE_BINARY_DIR}/inkscape_datadir)
add_dependencies(check inkscape_datadir_symlink)
endif()
endif()
# -----------------------------------------------------------------------------
......
......@@ -7,24 +7,15 @@ if(WIN32)
endif()
set(INKSCAPE_DATADIR "") # can be set via the environment variable INKSCAPE_DATADIR at runtime
set(PACKAGE_LOCALE_DIR "share/locale")
set(SHARE_INSTALL "share" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
set(INKSCAPE_SHARE_INSTALL "${SHARE_INSTALL}") # share/inkscape goes directly into /share on Windows
mark_as_advanced(SHARE_INSTALL)
else()
set(INKSCAPE_DATADIR "${CMAKE_INSTALL_PREFIX}/share")
endif()
if(NOT PACKAGE_LOCALE_DIR)
set(PACKAGE_LOCALE_DIR "share/locale") # packagers might overwrite this
endif(NOT PACKAGE_LOCALE_DIR)
if(NOT SHARE_INSTALL)
set(SHARE_INSTALL "share" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
endif(NOT SHARE_INSTALL)
set(INKSCAPE_SHARE_INSTALL "${SHARE_INSTALL}/inkscape")
if(NOT PACKAGE_LOCALE_DIR)
set(PACKAGE_LOCALE_DIR "share/locale") # packagers might overwrite this
endif(NOT PACKAGE_LOCALE_DIR)
mark_as_advanced(SHARE_INSTALL)
endif()
if(NOT SHARE_INSTALL)
set(SHARE_INSTALL "share" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
endif(NOT SHARE_INSTALL)
set(INKSCAPE_SHARE_INSTALL "${SHARE_INSTALL}/inkscape")
......@@ -78,8 +78,9 @@ PATH= inkscape/inkscape.exe -V >/dev/null || error "installed executable won't r
err=$(PATH= inkscape/inkscape.exe -V 2>&1 >/dev/null)
if [ -n "$err" ]; then warning "installed executable produces output on stderr:"; echo "$err"; fi
# check if the uninstalled executable works
INKSCAPE_DATADIR=../share bin/inkscape.exe -V >/dev/null || error "uninstalled executable won't run"
err=$(INKSCAPE_DATADIR=../share bin/inkscape.exe -V 2>&1 >/dev/null)
ninja inkscape_datadir_symlink
INKSCAPE_DATADIR=inkscape_datadir bin/inkscape.exe -V >/dev/null || error "uninstalled executable won't run"
err=$(INKSCAPE_DATADIR=inkscape_datadir bin/inkscape.exe -V 2>&1 >/dev/null)
if [ -n "$err" ]; then warning "uninstalled executable produces output on stderr:"; echo "$err"; fi
# run tests
ninja check || error "tests failed"
......
......@@ -28,7 +28,8 @@
#include "prefix.h"
#ifdef ENABLE_BINRELOC
#ifdef ENABLE_BINRELOC // TODO: Should we drop binreloc in favor of OS-specific relocation code
// in append_inkscape_datadir() like we already do for win32?
/* The way that we're building now is with a shared library between Inkscape
and Inkview, and the code will find the path to the library then. But we
don't really want that. This prefix then pulls things out of the lib directory
......@@ -58,33 +59,7 @@
# define CREATE_GRADIENTSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/create/gradients/gimp" )
# define CREATE_PALETTESDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/create/swatches" )
# define CREATE_PATTERNSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/create/patterns/vector" )
#else
# ifdef _WIN32
# define INKSCAPE_DATADIR_REAL append_inkscape_datadir()
# define INKSCAPE_ATTRRELDIR append_inkscape_datadir("attributes")
# define INKSCAPE_DOCDIR append_inkscape_datadir("doc")
# define INKSCAPE_EXAMPLESDIR append_inkscape_datadir("examples")
# define INKSCAPE_EXTENSIONDIR append_inkscape_datadir("extensions")
# define INKSCAPE_FILTERDIR append_inkscape_datadir("filters")
# define INKSCAPE_FONTSDIR append_inkscape_datadir("fonts")
# define INKSCAPE_GRADIENTSDIR append_inkscape_datadir("gradients")
# define INKSCAPE_KEYSDIR append_inkscape_datadir("keys")
# define INKSCAPE_ICONSDIR append_inkscape_datadir("icons")
# define INKSCAPE_PIXMAPSDIR append_inkscape_datadir("pixmaps")
# define INKSCAPE_MARKERSDIR append_inkscape_datadir("markers")
# define INKSCAPE_PALETTESDIR append_inkscape_datadir("palettes")
# define INKSCAPE_PATTERNSDIR append_inkscape_datadir("patterns")
# define INKSCAPE_SCREENSDIR append_inkscape_datadir("screens")
# define INKSCAPE_SYMBOLSDIR append_inkscape_datadir("symbols")
# define INKSCAPE_THEMEDIR append_inkscape_datadir("themes")
# define INKSCAPE_TUTORIALSDIR append_inkscape_datadir("tutorials")
# define INKSCAPE_TEMPLATESDIR append_inkscape_datadir("templates")
# define INKSCAPE_UIDIR append_inkscape_datadir("ui")
//CREATE V0.1 WIN32 support
# define CREATE_GRADIENTSDIR append_inkscape_datadir("create\\gradients\\gimp")
# define CREATE_PALETTESDIR append_inkscape_datadir("create\\swatches")
# define CREATE_PATTERNSDIR append_inkscape_datadir("create\\patterns\\vector")
# elif defined ENABLE_OSX_APP_LOCATIONS // TODO: Is ENABLE_OSX_APP_LOCATIONS still in use?
#elif defined ENABLE_OSX_APP_LOCATIONS // TODO: Is ENABLE_OSX_APP_LOCATIONS still in use?
# define INKSCAPE_DATADIR_REAL "Contents/Resources/share"
# define INKSCAPE_ATTRRELDIR "Contents/Resources/share/inkscape/attributes"
# define INKSCAPE_DOCDIR "Contents/Resources/share/inkscape/doc"
......@@ -109,7 +84,7 @@
# define CREATE_GRADIENTSDIR "/Library/Application Support/create/gradients/gimp"
# define CREATE_PALETTESDIR "/Library/Application Support/create/swatches"
# define CREATE_PATTERNSDIR "/Library/Application Support/create/patterns/vector"
# else
#else
# define INKSCAPE_DATADIR_REAL append_inkscape_datadir()
# define INKSCAPE_ATTRRELDIR append_inkscape_datadir("inkscape/attributes")
# define INKSCAPE_BINDDIR append_inkscape_datadir("inkscape/bind")
......@@ -135,7 +110,6 @@
# define CREATE_GRADIENTSDIR append_inkscape_datadir("create/gradients/gimp")
# define CREATE_PALETTESDIR append_inkscape_datadir("create/swatches")
# define CREATE_PATTERNSDIR append_inkscape_datadir("create/patterns/vector")
# endif
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment