summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Faubel <sebastian@semiodesk.com>2016-07-26 21:31:41 +0000
committerSebastian Faubel <sebastian@semiodesk.com>2016-07-26 21:31:41 +0000
commite025d5e0ef78ecb969027f520140e389980bece5 (patch)
tree56afe5de404c431fff2124f4789fd6e1655c0963
parentOrder some headers (diff)
downloadinkscape-e025d5e0ef78ecb969027f520140e389980bece5.tar.gz
inkscape-e025d5e0ef78ecb969027f520140e389980bece5.zip
CMake on Windows produces same output as btool.
Added inkscape.com and icon to inkview.exe Added msysenv.sh to support compiling using MSYS. (bzr r15023.1.1)
-rw-r--r--CMakeScripts/Install.cmake10
-rwxr-xr-xmingwenv.bat2
-rw-r--r--mingwenv.cmake28
-rw-r--r--msysenv.sh34
-rw-r--r--src/CMakeLists.txt27
5 files changed, 86 insertions, 15 deletions
diff --git a/CMakeScripts/Install.cmake b/CMakeScripts/Install.cmake
index aee0444de..ff6784fa7 100644
--- a/CMakeScripts/Install.cmake
+++ b/CMakeScripts/Install.cmake
@@ -11,10 +11,15 @@ if(WIN32)
${EXECUTABLE_OUTPUT_PATH}/inkview.exe
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
+
+ install(PROGRAMS
+ ${EXECUTABLE_OUTPUT_PATH}/inkscape_com.exe
+ DESTINATION ${CMAKE_INSTALL_PREFIX}
+ RENAME inkscape.com
+ )
install(FILES
${LIBRARY_OUTPUT_PATH}/libinkscape_base.dll
- ${LIBRARY_OUTPUT_PATH}/libgrid2.dll
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
@@ -25,6 +30,9 @@ if(WIN32)
NEWS
README
TRANSLATORS
+ GPL2.txt
+ GPL3.txt
+ LGPL2.1.txt
DESTINATION ${CMAKE_INSTALL_PREFIX})
# There are differences in the devlibs for 64-Bit and 32-Bit build environments.
diff --git a/mingwenv.bat b/mingwenv.bat
index 054e5dcc6..255920668 100755
--- a/mingwenv.bat
+++ b/mingwenv.bat
@@ -2,7 +2,7 @@
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 the Windows built-in command line.
REM -----------------------------------------------------------------------------
REM Directory containing the precompiled Inkscape libraries. Usually c:\devlibs or c:\devlibs64
diff --git a/mingwenv.cmake b/mingwenv.cmake
index ab96541d8..df6131a16 100644
--- a/mingwenv.cmake
+++ b/mingwenv.cmake
@@ -159,6 +159,34 @@ if(HAVE_MINGW64)
endif()
# -----------------------------------------------------------------------------
+# MSYS CHECKS
+# -----------------------------------------------------------------------------
+
+# Somehow the MSYS variable does not work as documented..
+if("${CMAKE_GENERATOR}" STREQUAL "MSYS Makefiles")
+ set(HAVE_MSYS ON)
+else()
+ set(HAVE_MSYS OFF)
+endif()
+
+# Set the path to the 'ar' utility for the MSYS shell as it fails to detect it properly.
+if(HAVE_MSYS)
+ message(STATUS "Configuring MSYS environment:")
+
+ if(NOT EXISTS ${CMAKE_AR})
+ set(MINGW_AR ${MINGW_BIN}/ar.exe)
+
+ if(EXISTS ${MINGW_AR})
+ set(CMAKE_AR ${MINGW_AR} CACHE FILEPATH "Archive Utility")
+ else()
+ message(FATAL_ERROR "ar.exe not found.")
+ endif()
+
+ message(STATUS " Setting path to ar.exe: ${CMAKE_AR}")
+ endif()
+endif()
+
+# -----------------------------------------------------------------------------
# GHOSTSCRIPT CHECKS
# -----------------------------------------------------------------------------
diff --git a/msysenv.sh b/msysenv.sh
new file mode 100644
index 000000000..88252a919
--- /dev/null
+++ b/msysenv.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# The paths in this file are used if you want to build Inkscape from the
+# the MSYS command line for Windows.
+# -----------------------------------------------------------------------------
+
+# Directory containing the precompiled Inkscape libraries. Usually /c/devlibs or /c/devlibs64
+if [ -z $DEVLIBS_PATH ]; then
+ export DEVLIBS_PATH="/c/devlibs64";
+fi
+
+# Directory containing the MinGW instance used for compilation. Usually /c/mingw or /c/mingw64
+# Note: Make sure there are no whitespaces in the path. MinGW doesn't like that.. :)
+if [ -z $MINGW_PATH ]; then
+ export MINGW_PATH="/c/mingw64";
+fi
+# Directory containing the (optional) Ghostscript installation.
+
+if [ -z $GS_PATH ]; then
+ export GS_PATH="/c/latex/gs/gs8.61";
+fi
+
+# -----------------------------------------------------------------------------
+echo Setting environment variables for MSYS build of Inkscape:
+echo
+echo "DEVLIBS_PATH: "$DEVLIBS_PATH
+echo "MINGW_PATH: "$MINGW_PATH
+echo "GS_PATH: "$GS_PATH
+
+# Include the MinGW environment in the path to prevent error messages during CMake configure.
+export PATH=$DEVLIBS_PATH/bin:$DEVLIBS_PATH/python:$MINGW_PATH/bin:$PATH:$GS_PATH/bin
+
+# Also set the pkgconfig path to prevent error messages during CMake configure.
+export PKG_CONFIG_PATH=$DEVLIBS_PATH/lib/pkgconfig
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d4ba9b1f0..ef855d950 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -418,7 +418,7 @@ set(inkscape_SRC
verbs.h
version.h
)
-
+
# -----------------------------------------------------------------------------
# Generate version file
# -----------------------------------------------------------------------------
@@ -484,35 +484,33 @@ set(inkscape_SRC
# -----------------------------------------------------------------------------
# Setup the executable
# -----------------------------------------------------------------------------
-#add_inkscape_lib(sp_LIB "${sp_SRC}")
-#add_inkscape_lib(inkscape_LIB "${inkscape_SRC}")
+set(main_SRC main.cpp)
+set(view_SRC inkview.cpp)
-if(WIN32)
+if(WIN32)
# Sources for the inkscape executable on Windows.
- set(main_SRC
+ list(APPEND main_SRC
registrytool.h
registrytool.cpp
- main.cpp
winmain.cpp
- #winconsole.cpp
)
# Add the platform specific resource files (enabling the app icon).
if(${HAVE_MINGW64})
list(APPEND main_SRC inkscape-x64.rc)
+ list(APPEND view_SRC inkscape-x64.rc)
else()
list(APPEND main_SRC inkscape.rc)
+ list(APPEND view_SRC inkscape.rc)
endif()
-else()
- set(main_SRC main.cpp)
+
+ # Build the windows MS-DOS console executable.
+ add_executable(inkscape_com winconsole.cpp)
endif()
-# Build everything except main and inkview.c in a shared library.
-add_library(inkscape_base SHARED ${inkscape_SRC} ${sp_SRC})
-
# make executables for inkscape and inkview
add_executable(inkscape ${main_SRC})
-add_executable(inkview inkview.cpp)
+add_executable(inkview ${view_SRC})
add_dependencies(inkscape inkscape_version)
@@ -545,6 +543,9 @@ if (NOT "${WITH_EXT_GDL}")
list (INSERT INKSCAPE_TARGET_LIBS 0 "gdl_LIB")
endif()
+# Build everything except main and inkview.c in a shared library.
+add_library(inkscape_base SHARED ${inkscape_SRC} ${sp_SRC})
+
# Link the inkscape_base library against all external dependencies
target_link_libraries(inkscape_base ${INKSCAPE_TARGET_LIBS})