summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Faubel <sebastian@semiodesk.com>2016-07-05 10:39:38 +0000
committerSebastian Faubel <sebastian@semiodesk.com>2016-07-05 10:39:38 +0000
commit8155c4690b6a74d704eaee3b19fef32c62fd38a4 (patch)
tree7f45a1da02bd43a36e79da2209e9f05108bdd84e
parentFixed locales. (diff)
downloadinkscape-8155c4690b6a74d704eaee3b19fef32c62fd38a4.tar.gz
inkscape-8155c4690b6a74d704eaee3b19fef32c62fd38a4.zip
Refactored the path settings and install scripts.
Fixed build for 32-Bit devlibs. (bzr r15002.1.3)
-rw-r--r--CMakeLists.txt294
-rw-r--r--CMakeScripts/ConfigPaths.cmake173
-rwxr-xr-xmingwenv.bat34
3 files changed, 66 insertions, 435 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 489346ca2..86ea1ecea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,58 +6,7 @@ message("------------------------------")
message("Source Dir: ${CMAKE_CURRENT_SOURCE_DIR}")
message("Binary Dir: ${CMAKE_CURRENT_BINARY_DIR}")
-# -----------------------------------------------------------------------------
-# Set platform defaults (originally copied from darktable)
-# -----------------------------------------------------------------------------
-include(CMakeScripts/ConfigPaths.cmake)
-
-if(WIN32)
- message("-- Windows build detected, setting default features")
-
- list(INSERT CMAKE_SYSTEM_INCLUDE_PATH 0 ${DEVLIBS_PATH})
- list(INSERT CMAKE_SYSTEM_LIBRARY_PATH 0 ${DEVLIBS_PATH})
-
- set(CMAKE_C_COMPILER "${MINGW_BIN}/gcc.exe")
- set(CMAKE_C_LINK_EXECUTABLE "${MINGW_BIN}/gcc.exe")
- set(CMAKE_CXX_COMPILER "${MINGW_BIN}/g++.exe")
- set(CMAKE_CXX_LINK_EXECUTABLE "${MINGW_BIN}/g++.exe")
- set(CMAKE_CXX_STANDARD 11)
-
- # Setup Windows resource files compiler.
- set(CMAKE_RC_COMPILER "${MINGW_BIN}/windres.exe")
- set(CMAKE_RC_COMPILER_INIT windres)
- enable_language(RC)
- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -i <SOURCE> -o <OBJECT>")
-
- # These options are required for having i18n support on Windows.
- option(ENABLE_NLS "Compile with Native Language Support (using gettext)" ON)
- option(HAVE_BIND_TEXTDOMAIN_CODESET "Compile with 'bind_textdomain_codeset' function" ON)
-
- # Does not compile on Windows with these options.
- option(BR_PTHREADS "Use binreloc thread support" OFF)
- option(ENABLE_BINRELOC "Use AutoPackage" OFF)
-endif(WIN32)
-
-if(APPLE)
- message("-- Mac OS X build detected, setting default features")
-
- # prefer macports and/or user-installed libraries over system ones
- #LIST(APPEND CMAKE_PREFIX_PATH /opt/local /usr/local)
- set(CMAKE_FIND_FRAMEWORK "LAST")
-
- # test and display relevant env variables
- if(DEFINED ENV{CMAKE_PREFIX_PATH})
- message("CMAKE_PREFIX_PATH: $ENV{CMAKE_PREFIX_PATH}")
- endif()
-
- if(DEFINED ENV{GTKMM_BASEPATH})
- message("GTKMM_BASEPATH: $ENV{GTKMM_BASEPATH}")
- endif()
-
- # detect current GTK+ backend
- pkg_check_variable(gtk+-2.0 target)
- message("GTK2 backend: ${GTK+_2.0_TARGET}")
-endif(APPLE)
+include(CMakeScripts/ConfigEnv.cmake)
# -----------------------------------------------------------------------------
# CMake Configuration
@@ -80,7 +29,6 @@ else()
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/inkscape")
endif()
-
cmake_policy(SET CMP0003 NEW) # don't be prolific with library paths
cmake_policy(SET CMP0005 NEW) # proper define quoting
cmake_policy(SET CMP0009 NEW) # don't follow symbolic links when using GLOB
@@ -178,232 +126,48 @@ add_custom_target(uninstall
# Subdirs (on only 1 atm), but a lot happens here
# -----------------------------------------------------------------------------
add_subdirectory(src)
+
if(ENABLE_NLS)
add_subdirectory(po)
endif(ENABLE_NLS)
-
# -----------------------------------------------------------------------------
# Man pages
# -----------------------------------------------------------------------------
-include("CMakeScripts/Pod2man.cmake")
-
-# Load AUTHORS file contents into $INKSCAPE_AUTHORS
-file(READ ${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS content)
-string(REGEX REPLACE "^([^\n#]+)\n" "\\1;\n" content_list "${content}")
-join(INKSCAPE_AUTHORS "," "${content_list}")
-
-foreach(podfile
- man/inkscape.pod
- man/inkscape.de.pod
- man/inkscape.el.pod
- man/inkscape.fr.pod
- man/inkscape.ja.pod
- man/inkscape.sk.pod
- man/inkscape.zh_TW.pod
- man/inkview.pod)
- set(POD_IN ${CMAKE_CURRENT_SOURCE_DIR}/${podfile}.in)
- set(POD_OUT ${CMAKE_CURRENT_BINARY_DIR}/${podfile})
- configure_file(${POD_IN} ${POD_OUT})
- pod2man(${POD_OUT} ${INKSCAPE_VERSION} 1 "Inkscape Commands Manual")
-endforeach()
-
-# -----------------------------------------------------------------------------
-# Installation
-# -----------------------------------------------------------------------------
-if(UNIX)
- #Define the installation
- install(
- TARGETS inkscape_base inkscape inkview
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib/inkscape
- ARCHIVE DESTINATION lib/inkscape
- )
-
- #The install directive for the binaries and libraries are found in src/CMakeList.txt
- install(
- FILES ${CMAKE_BINARY_DIR}/inkscape.desktop
- DESTINATION ${CMAKE_INSTALL_PREFIX}/${SHARE_INSTALL}/applications
- )
-
- # this should probably be done no matter what the platform is, just set SHARE_INSTALL first
- add_subdirectory(share)
-elseif(WIN32)
- set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/inkscape)
-
- install(PROGRAMS
- ${EXECUTABLE_OUTPUT_PATH}/inkscape.exe
- ${EXECUTABLE_OUTPUT_PATH}/inkview.exe
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- )
-
- install(FILES
- ${LIBRARY_OUTPUT_PATH}/libinkscape_base.dll
- ${LIBRARY_OUTPUT_PATH}/libgrid2.dll
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- )
-
- # devlibs and mingw dlls
- install(FILES
- AUTHORS
- COPYING
- NEWS
- README
- TRANSLATORS
- ${DEVLIBS_BIN}/libatkmm-1.6-1.dll
- ${DEVLIBS_BIN}/libglibmm-2.4-1.dll
- ${DEVLIBS_BIN}/libgiomm-2.4-1.dll
- ${DEVLIBS_BIN}/libgtkmm-2.4-1.dll
- ${DEVLIBS_BIN}/libgdkmm-2.4-1.dll
- ${DEVLIBS_BIN}/libpangomm-1.4-1.dll
- ${DEVLIBS_BIN}/libcairomm-1.0-1.dll
- ${DEVLIBS_BIN}/libsigc-2.0-0.dll
- ${DEVLIBS_BIN}/libfreetype-6.dll
- ${DEVLIBS_BIN}/libffi-6.dll
- ${DEVLIBS_BIN}/libgc-1.dll
- ${DEVLIBS_BIN}/libgsl-19.dll
- ${DEVLIBS_BIN}/libgslcblas-0.dll
- ${DEVLIBS_BIN}/libharfbuzz-0.dll
- ${DEVLIBS_BIN}/liblzma-5.dll
- ${DEVLIBS_BIN}/libaspell-15.dll
- ${DEVLIBS_BIN}/libatk-1.0-0.dll
- ${DEVLIBS_BIN}/libgdk-win32-2.0-0.dll
- ${DEVLIBS_BIN}/libgdk_pixbuf-2.0-0.dll
- ${DEVLIBS_BIN}/libglib-2.0-0.dll
- ${DEVLIBS_BIN}/libgmodule-2.0-0.dll
- ${DEVLIBS_BIN}/libgobject-2.0-0.dll
- ${DEVLIBS_BIN}/libgtk-win32-2.0-0.dll
- ${DEVLIBS_BIN}/libgthread-2.0-0.dll
- ${DEVLIBS_BIN}/libgio-2.0-0.dll
- ${DEVLIBS_BIN}/libcairo-2.dll
- ${DEVLIBS_BIN}/libpixman-1-0.dll
- ${DEVLIBS_BIN}/libpoppler-58.dll
- ${DEVLIBS_BIN}/libpoppler-glib-8.dll
- ${DEVLIBS_BIN}/libpangocairo-1.0-0.dll
- ${DEVLIBS_BIN}/libpango-1.0-0.dll
- ${DEVLIBS_BIN}/libpangoft2-1.0-0.dll
- ${DEVLIBS_BIN}/libpangowin32-1.0-0.dll
- ${DEVLIBS_BIN}/libfontconfig-1.dll
- ${DEVLIBS_BIN}/libxml2-2.dll
- ${DEVLIBS_BIN}/libxslt-1.dll
- ${DEVLIBS_BIN}/libexslt-0.dll
- ${DEVLIBS_BIN}/libexpat-1.dll
- ${DEVLIBS_BIN}/librevenge-0.0.dll
- ${DEVLIBS_BIN}/librevenge-stream-0.0.dll
- ${DEVLIBS_BIN}/libwpg-0.3.dll
- ${DEVLIBS_BIN}/libwpd-0.10.dll
- ${DEVLIBS_BIN}/libvisio-0.1.dll
- ${DEVLIBS_BIN}/libcdr-0.1.dll
- ${DEVLIBS_BIN}/icuin56.dll
- ${DEVLIBS_BIN}/icudt56.dll
- ${DEVLIBS_BIN}/icuuc56.dll
- ${DEVLIBS_BIN}/libjpeg-9.dll
- ${DEVLIBS_BIN}/libpng16-16.dll
- ${DEVLIBS_BIN}/libtiff-5.dll
- ${DEVLIBS_BIN}/libexif-12.dll
- ${DEVLIBS_BIN}/libcurl-4.dll
- ${DEVLIBS_BIN}/zlib1.dll
- ${DEVLIBS_BIN}/bz2-1.dll
- ${DEVLIBS_BIN}/libiconv-2.dll
- ${DEVLIBS_BIN}/libpopt-0.dll
- ${DEVLIBS_BIN}/liblcms2-2.dll
- ${DEVLIBS_BIN}/libMagick++-6.Q16-6.dll
- ${DEVLIBS_BIN}/libMagickCore-6.Q16-2.dll
- ${DEVLIBS_BIN}/libMagickWand-6.Q16-2.dll
- ${DEVLIBS_BIN}/libintl-8.dll
- ${DEVLIBS_BIN}/libpotrace-0.dll
- ${MINGW_BIN}/libstdc++-6.dll
- ${MINGW_BIN}/libwinpthread-1.dll
- ${MINGW_BIN}/libgcc_s_seh-1.dll
- ${MINGW_BIN}/libgomp-1.dll
- DESTINATION ${CMAKE_INSTALL_PREFIX})
-
- # Setup application data directories, poppler files, locales, icons and themes
- file(MAKE_DIRECTORY
- data
- doc
- modules
- plugins)
-
- install(DIRECTORY
- data
- doc
- modules
- plugins
- share
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- PATTERN Adwaita EXCLUDE # NOTE: The theme is not used on Windows.
- PATTERN hicolor/index.theme EXCLUDE # NOTE: Empty index.theme in hicolor icon theme causes SIGSEGV.
- PATTERN CMakeLists.txt EXCLUDE
- PATTERN *.am EXCLUDE)
-
- install(DIRECTORY ${DEVLIBS_PATH}/share/themes
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share)
-
- install(DIRECTORY ${DEVLIBS_PATH}/share/poppler
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share)
-
- install(DIRECTORY ${DEVLIBS_PATH}/etc/fonts
- DESTINATION ${CMAKE_INSTALL_PREFIX}/etc)
+if(NOT WIN32)
+ include("CMakeScripts/Pod2man.cmake")
- install(DIRECTORY ${DEVLIBS_PATH}/share/locale
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share)
-
- install(DIRECTORY ${DEVLIBS_PATH}/etc/gtk-2.0
- DESTINATION ${CMAKE_INSTALL_PREFIX}/etc)
-
- # GTK 2.0
- install(DIRECTORY ${DEVLIBS_LIB}/gtk-2.0
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
- FILES_MATCHING
- PATTERN "*.dll"
- PATTERN "*.cache")
+ # Load AUTHORS file contents into $INKSCAPE_AUTHORS
+ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS content)
+ string(REGEX REPLACE "^([^\n#]+)\n" "\\1;\n" content_list "${content}")
- install(DIRECTORY ${DEVLIBS_LIB}/gdk-pixbuf-2.0
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
- FILES_MATCHING
- PATTERN "*.dll"
- PATTERN "*.cache")
+ join(INKSCAPE_AUTHORS "," "${content_list}")
+
+ foreach(podfile
+ man/inkscape.pod
+ man/inkscape.de.pod
+ man/inkscape.el.pod
+ man/inkscape.fr.pod
+ man/inkscape.ja.pod
+ man/inkscape.sk.pod
+ man/inkscape.zh_TW.pod
+ man/inkview.pod)
+
+ set(POD_IN ${CMAKE_CURRENT_SOURCE_DIR}/${podfile}.in)
+ set(POD_OUT ${CMAKE_CURRENT_BINARY_DIR}/${podfile})
- # Aspell dictionaries
- install(DIRECTORY ${DEVLIBS_LIB}/aspell-0.60
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
-
- # Necessary to run extensions on windows if it is not in the path
- if (CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64")
- install(FILES
- ${DEVLIBS_BIN}/gspawn-win64-helper.exe
- ${DEVLIBS_BIN}/gspawn-win64-helper-console.exe
- DESTINATION ${CMAKE_INSTALL_PREFIX})
- else()
- install(FILES
- ${DEVLIBS_BIN}/gspawn-win32-helper.exe
- ${DEVLIBS_BIN}/gspawn-win32-helper-console.exe
- DESTINATION ${CMAKE_INSTALL_PREFIX})
- endif()
-
- # Perl
- install(FILES
- ${DEVLIBS_PATH}/perl/bin/perl58.dll
- DESTINATION ${CMAKE_INSTALL_PREFIX})
-
- # Python
- install(FILES
- ${DEVLIBS_PATH}/python/python.exe
- ${DEVLIBS_PATH}/python/pythonw.exe
- ${DEVLIBS_PATH}/python/python27.dll
- DESTINATION ${CMAKE_INSTALL_PREFIX}/python)
+ configure_file(${POD_IN} ${POD_OUT})
- install(DIRECTORY ${DEVLIBS_PATH}/python/lib
- DESTINATION ${CMAKE_INSTALL_PREFIX}/python)
-
- install(DIRECTORY ${DEVLIBS_PATH}/python/dlls
- DESTINATION ${CMAKE_INSTALL_PREFIX}/python)
-elseif(APPLE)
- # TODO
+ pod2man(${POD_OUT} ${INKSCAPE_VERSION} 1 "Inkscape Commands Manual")
+ endforeach()
endif()
# -----------------------------------------------------------------------------
+# Installation
+# -----------------------------------------------------------------------------
+include(CMakeScripts/Install.cmake)
+
+# -----------------------------------------------------------------------------
# Clean
# -----------------------------------------------------------------------------
add_custom_target(clean-cmake-files
diff --git a/CMakeScripts/ConfigPaths.cmake b/CMakeScripts/ConfigPaths.cmake
index 6ce849206..cfe6c66b6 100644
--- a/CMakeScripts/ConfigPaths.cmake
+++ b/CMakeScripts/ConfigPaths.cmake
@@ -1,166 +1,17 @@
message(STATUS "Creating build files in: ${CMAKE_CURRENT_BINARY_DIR}")
if(WIN32)
-# Directory containing the precompiled Inkscape libraries. Usually c:\devlibs or c:\devlibs64
- set(DEVLIBS_PATH C:/devlibs64)
-
- # Directory containing the MinGW instance used for compilation. Usually c:\mingw or c:\mingw64
- set(MINGW_PATH C:/mingw64)
-
- # Directory containing the Ghostscript installation.
- set(GS_PATH C:/latex/gs/gs8.61)
-
- # Normalize directory separator slashes.
- string(REGEX REPLACE "\\\\" "/" DEVLIBS_PATH ${DEVLIBS_PATH})
- string(REGEX REPLACE "\\\\" "/" MINGW_PATH ${MINGW_PATH})
- string(REGEX REPLACE "\\\\" "/" GS_PATH ${GS_PATH})
-
- # =============== DEVLIBS CHECKS ===============
-
- # Directory containing the compile time .dll.a and .a files.
- set(DEVLIBS_LIB "${DEVLIBS_PATH}/lib")
-
- if(NOT EXISTS "${DEVLIBS_LIB}")
- message(FATAL_ERROR "Inkscape development libraries directory does not exist: ${DEVLIBS_LIB}")
- endif()
-
- # Add devlibs libraries to linker path.
- link_directories(${DEVLIBS_LIB})
-
- set(DEVLIBS_INCLUDE ${DEVLIBS_PATH}/include)
-
- if(NOT EXISTS ${DEVLIBS_INCLUDE})
- message(FATAL_ERROR "Inkscape development libraries directory does not exist: ${DEVLIBS_INCLUDE}")
- endif()
-
- # Add general MinGW headers to compiler include path.
- #include_directories(${DEVLIBS_INCLUDE})
-
- # Directory containing the precompiled .dll files.
- set(DEVLIBS_BIN ${DEVLIBS_PATH}/bin)
-
- if(NOT EXISTS ${DEVLIBS_BIN})
- message(FATAL_ERROR "Inkscape development binaries directory does not exist: ${DEVLIBS_BIN}")
- endif()
-
- # Directory containing the pkgconfig .pc files.
- set(PKG_CONFIG_PATH "${DEVLIBS_PATH}/lib/pkgconfig")
-
- if(NOT EXISTS "${PKG_CONFIG_PATH}")
- message(FATAL_ERROR "pkgconfig directory does not exist: ${PKG_CONFIG_PATH}")
- endif()
-
- # Add the devlibs directories to the paths used to find libraries and programs.
- list(APPEND CMAKE_PREFIX_PATH ${DEVLIBS_PATH})
-
- # Eliminate error messages when not having mingw in the environment path variable.
- list(APPEND CMAKE_PROGRAM_PATH ${DEVLIBS_BIN})
-
- # =============== MINGW CHECKS ===============
-
- # We are in a MinGW environment.
- set(HAVE_MINGW ON)
-
- # Try to determine the MinGW processor architecture.
- if(EXISTS ${MINGW_PATH}/mingw32)
- set(HAVE_MINGW64 OFF)
- set(MINGW_ARCH mingw32)
- elseif(EXISTS ${MINGW_PATH}/x86_64-w64-mingw32)
- set(HAVE_MINGW64 ON)
- set(MINGW_ARCH x86_64-w64-mingw32)
- else()
- message(FATAL_ERROR "Unable to determine MinGW processor architecture. Are you using an unsupported MinGW version?")
- endif()
-
- # Path to processor architecture specific binaries and libs.
- set(MINGW_ARCH_PATH ${MINGW_PATH}/${MINGW_ARCH})
-
- set(MINGW_BIN ${MINGW_PATH}/bin)
-
- if(NOT EXISTS ${MINGW_BIN})
- message(FATAL_ERROR "MinGW binary directory does not exist: ${MINGW_BIN}")
- endif()
-
- # Eliminate error messages when not having mingw in the environment path variable.
- list(APPEND CMAKE_PROGRAM_PATH ${MINGW_BIN})
-
- set(MINGW_LIB ${MINGW_PATH}/lib)
-
- if(NOT EXISTS ${MINGW_LIB})
- message(FATAL_ERROR "MinGW library directory does not exist: ${MINGW_LIB}")
- endif()
-
- # Add MinGW libraries to linker path.
- link_directories(${MINGW_LIB})
-
- set(MINGW_INCLUDE ${MINGW_PATH}/include)
-
- if(NOT EXISTS ${MINGW_INCLUDE})
- message(FATAL_ERROR "MinGW include directory does not exist: ${MINGW_INCLUDE}")
- endif()
-
- # Add general MinGW headers to compiler include path.
- include_directories(${MINGW_INCLUDE})
-
- if(HAVE_MINGW64)
- set(MINGW64_LIB ${MINGW_ARCH_PATH}/lib)
-
- if(NOT EXISTS ${MINGW64_LIB})
- message(FATAL_ERROR "MinGW 64-Bit libraries directory does not exist: ${MINGW64_LIB}")
- endif()
-
- # Add 64-Bit libraries to linker path.
- link_directories(${MINGW64_LIB})
-
- set(MINGW64_INCLUDE ${MINGW_ARCH_PATH}/include)
-
- if(NOT EXISTS ${MINGW64_INCLUDE})
- message(FATAL_ERROR "MinGW 64-Bit include directory does not exist: ${MINGW64_INCLUDE}")
- endif()
-
- set(MINGW64_INCLUDE_SDL ${MINGW64_INCLUDE}/c++)
-
- if(NOT EXISTS ${MINGW64_INCLUDE_SDL})
- message(FATAL_ERROR "MinGW 64-Bit SDL include directory does not exist: ${MINGW64_INCLUDE_SDL}")
- endif()
-
- # Add 64-Bit MinGW headers to compiler include path.
- include_directories(${MINGW64_INCLUDE})
- #include_directories(${MINGW64_INCLUDE_SDL})
- endif()
-
- # =============== GHOSTSCRIPT CHECKS ===============
-
- # Check for Ghostscript.
- set(GS_BIN "${GS_PATH}/bin")
-
- if(EXISTS "${GS_BIN}")
- set(HAVE_GS_BIN ON)
- else()
- set(HAVE_GS_BIN OFF)
- endif()
-
- # =============== LIBRARY AND LINKER ===============
-
- # Tweak CMake into using Unix-style library names.
- set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
- set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".dll")
-
- if(NOT HAVE_MINGW64)
- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".a")
- endif()
-
- # Directory containing the current locale (translations).
- set(PACKAGE_LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/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.")
-else(WIN32)
- # TODO: check and change this to correct value:
- if(NOT PACKAGE_LOCALE_DIR)
set(PACKAGE_LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/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)
- mark_as_advanced(SHARE_INSTALL)
-endif(WIN32)
+else()
+ # TODO: check and change this to correct value:
+ if(NOT PACKAGE_LOCALE_DIR)
+ set(PACKAGE_LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/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)
+
+ mark_as_advanced(SHARE_INSTALL)
+endif() \ No newline at end of file
diff --git a/mingwenv.bat b/mingwenv.bat
index 3765b73b5..02068b72c 100755
--- a/mingwenv.bat
+++ b/mingwenv.bat
@@ -1,9 +1,25 @@
-@echo Setting environment variables for MinGw build of Inkscape
-IF "%DEVLIBS_PATH%"=="" set DEVLIBS_PATH=c:\devlibs64
-IF "%MINGW_PATH%"=="" set MINGW_PATH=c:\mingw64
-set MINGW_BIN=%MINGW_PATH%\bin
-set PKG_CONFIG_PATH=%DEVLIBS_PATH%\lib\pkgconfig
-set GS_BIN=C:\latex\gs\gs8.61\bin
-set PATH=%DEVLIBS_PATH%\bin;%DEVLIBS_PATH%\python;%MINGW_BIN%;%PATH%;%GS_BIN%
-set CMAKE_PREFIX_PATH=%DEVLIBS_PATH%
-set GTKMM_BASEPATH=%DEVLIBS_PATH%
+@echo off
+
+REM -----------------------------------------------------------------------------
+REM The paths in this file are used if you want to build Inkscape from the
+REM the Windows built-in command line (i.e. MSYS).
+REM -----------------------------------------------------------------------------
+
+REM Directory containing the precompiled Inkscape libraries. Usually c:\devlibs or c:\devlibs64
+if "%DEVLIBS_PATH%"=="" set DEVLIBS_PATH=c:\devlibs
+
+REM Directory containing the MinGW instance used for compilation. Usually c:\mingw or c:\mingw64
+REM Note: Make sure there are no whitespaces in the path. MinGW doesn't like that.. ;)
+if "%MINGW_PATH%"=="" set MINGW_PATH=c:\mingw
+
+REM Directory containing the (optional) Ghostscript installation.
+if "%GS_PATH%"=="" set GS_PATH=C:\latex\gs\gs8.61
+
+REM -----------------------------------------------------------------------------
+@echo Setting environment variables for MinGW build of Inkscape..
+
+REM Include the MinGW environment in the path to prevent error messages during CMake configure.
+set PATH=%DEVLIBS_PATH%\bin;%DEVLIBS_PATH%\python;%MINGW_PATH%\bin;%PATH%;%GS_PATH%\bin
+
+REM Also set the pkgconfig path to prevent error messages during CMake configure.
+set PKG_CONFIG_PATH=%DEVLIBS_PATH%\lib\pkgconfig \ No newline at end of file