File r1696-Use-cmake-commands-properly.patch of Package podofo.23799
------------------------------------------------------------------------
r1696 | aja_ | 2015-11-29 19:22:17 +0100 (dom, 29 nov 2015) | 2 lines
ADDED: Patch by Matthew Brincke: Correct some Win32-related cross-build issues
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 1695)
+++ CMakeLists.txt (revision 1696)
@@ -241,7 +241,7 @@
ENDIF(PODOFO_BUILD_SHARED AND PODOFO_BUILD_STATIC)
# We must explicitly link to the core win32 libraries, and we need winsock2
# to get some byte-order conversion routines too.
- SET(PLATFORM_SYSTEM_LIBRARIES kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid WS2_32)
+ SET(PLATFORM_SYSTEM_LIBRARIES kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32)
# Microsoft deprecate certain POSIX functions that we use.
# for now, turn off these warnings.
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
@@ -285,22 +285,16 @@
SET(PODOFO_USE_VISIBILITY ${PODOFO_HAVE_GCC4})
ENDIF(NOT DEFINED PODOFO_USE_VISIBILITY)
#- ADD_DEFINITIONS(-std=c++98)
- # We can't request C++98 compliance on win32, because mingw
- # will hide _tzset() and _timezone, which we need for PdfDate.
- # At least until that code is replaced with something better,
- # just don't enable it on win32.
- IF(NOT WIN32)
- ADD_DEFINITIONS(-std=c++98)
- ENDIF(NOT WIN32)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
- ADD_DEFINITIONS(
- -Wall
- -Woverloaded-virtual
- -Wswitch-enum
- -Wcast-qual
- -Wwrite-strings
- -Wredundant-decls
- -Wreorder
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
+ -Wall \
+ -Woverloaded-virtual \
+ -Wswitch-enum \
+ -Wcast-qual \
+ -Wwrite-strings \
+ -Wredundant-decls \
+ -Wreorder"
#-Wold-style-cast
)
#
#Index: src/base/PdfDefines.h
#===================================================================
#--- src/base/PdfDefines.h (revision 1695)
#+++ src/base/PdfDefines.h (revision 1696)
#@@ -60,8 +60,11 @@
# /**
# * PoDoFo version represented as a string literal, eg '0.7.99'
# */
#-#define PODOFO_MAKE_VERSION_STR_REAL(M,m,p) ("\"" #M "." #m "." #p "\"")
#-#define PODOFO_MAKE_VERSION_STR(M,m,p) PODOFO_MAKE_VERSION_STR_REAL(M,m,p)
#+// The \0 is from Win32 example resources and the other values in PoDoFo's one
#+#define PODOFO_MAKE_VERSION_STR_REAL(M,m,p) M ## . ## m ## . ## p
#+#define PODOFO_STR(x) #x "\0"
#+#define PODOFO_XSTR(x) PODOFO_STR(x)
#+#define PODOFO_MAKE_VERSION_STR(M,m,p) PODOFO_XSTR(PODOFO_MAKE_VERSION_STR_REAL(M,m,p))
# #define PODOFO_VERSION_STR PODOFO_MAKE_VERSION_STR(PODOFO_VERSION_MAJOR, PODOFO_VERSION_MINOR, PODOFO_VERSION_PATCH)
#
# #ifndef PODOFO_COMPILE_RC
#Index: src/doc/podofo-doc.rc
#===================================================================
#--- src/doc/podofo-doc.rc (revision 1695)
#+++ src/doc/podofo-doc.rc (revision 1696)
#@@ -3,7 +3,7 @@
# #include "base/podofoapi.h"
# #include "base/PdfDefines.h"
# #include "base/PdfVersion.h"
#-#include "WinResrc.h"
#+#include "winresrc.h"
#
# #undef PODOFO_COMPILE_RC
#
#@@ -50,8 +50,8 @@
# BEGIN
# BLOCK "040904E4"
# BEGIN
#- VALUE "FileVersion", VER_FILEVERSION
#- VALUE "ProductVersion", VER_PRODUCTVERSION
#+ VALUE "FileVersion", VER_FILEVERSION_STR
#+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR
# VALUE "Comments", "PoDoFo Doc PDF Library\0"
# VALUE "CompanyName", "PoDoFo\0"
# VALUE "InternalName", "podofo\0"
#
------------------------------------------------------------------------