diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-06-06 22:31:13 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-06-06 23:20:42 +0000 |
| commit | 47ba544abac1dc54a73a44b2b8eec45d92cb83a1 (patch) | |
| tree | 3d6b999d853917e60cc6b1d842d9a534b0aa3e82 | |
| parent | Fix build (loading icon). (diff) | |
| download | inkscape-47ba544abac1dc54a73a44b2b8eec45d92cb83a1.tar.gz inkscape-47ba544abac1dc54a73a44b2b8eec45d92cb83a1.zip | |
Use share/inkscape subfolder on Windows
First part of https://gitlab.com/inkscape/inkscape/issues/82
| -rw-r--r-- | CMakeLists.txt | 13 | ||||
| -rw-r--r-- | CMakeScripts/ConfigPaths.cmake | 25 | ||||
| -rw-r--r-- | buildtools/appveyor.sh | 5 | ||||
| -rw-r--r-- | src/path-prefix.h | 34 |
4 files changed, 27 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 231f71039..a359dc8ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() # ----------------------------------------------------------------------------- diff --git a/CMakeScripts/ConfigPaths.cmake b/CMakeScripts/ConfigPaths.cmake index 46b48cb75..41811b013 100644 --- a/CMakeScripts/ConfigPaths.cmake +++ b/CMakeScripts/ConfigPaths.cmake @@ -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") diff --git a/buildtools/appveyor.sh b/buildtools/appveyor.sh index 18a90bfbb..cfd289886 100644 --- a/buildtools/appveyor.sh +++ b/buildtools/appveyor.sh @@ -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" diff --git a/src/path-prefix.h b/src/path-prefix.h index 245d65505..93af933d1 100644 --- a/src/path-prefix.h +++ b/src/path-prefix.h @@ -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 |
