------------------------------------------------------------------------
r1709 | domseichter | 2016-04-21 22:19:17 +0200 (jue, 21 abr 2016) | 6 lines

CMake compatibility fixes.
Policies explicitly set to NEW to avoid warnings during build and also fixed policy violations.

Please test on several platform to ensure that this does not break build!



Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 1708)
+++ CMakeLists.txt	(revision 1709)
#@@ -26,6 +26,15 @@
@@ -26,6 +26,13 @@
 INCLUDE(TestBigEndian)
 INCLUDE(CheckTypeSize)
 
+#
+# Setup CMake Policies
+#
+
+# Prefer files in CMAKE_MODULE_PATH over shipped ones in module directory
+CMAKE_POLICY(SET CMP0017 NEW) # https://cmake.org/cmake/help/v3.0/policy/CMP0017.html
#+# Do not use export_library_dependencies() anymore
#+CMAKE_POLICY(SET CMP0033 NEW) # https://cmake.org/cmake/help/v3.0/policy/CMP0033.html
+
 # Load modules from our source tree too
 SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
 
@@ -531,6 +540,10 @@
 # To use these dependencies set PODOFO_DIR to the podofo BUILD directory in
 # your build (eg -DPODOFO_DIR=/path/to/podofo when running cmake to configure
 # the app that'll use podofo). See: FIND_PACKAGE(...) in the cmake docs.
-EXPORT_LIBRARY_DEPENDENCIES(
-	"${CMAKE_CURRENT_BINARY_DIR}/PoDoFoConfig.cmake"
-	APPEND)
+IF(PODOFO_BUILD_SHARED)
+  EXPORT(TARGETS podofo_shared FILE "${CMAKE_CURRENT_BINARY_DIR}/PoDoFoConfig.cmake")
+ENDIF(PODOFO_BUILD_SHARED)
+IF(PODOFO_BUILD_STATIC)
+  EXPORT(TARGETS podofo_static FILE "${CMAKE_CURRENT_BINARY_DIR}/PoDoFoConfig.cmake")
+ENDIF(PODOFO_BUILD_STATIC)
+
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt	(revision 1708)
+++ src/CMakeLists.txt	(revision 1709)
@@ -1,4 +1,5 @@
-cmake_minimum_required(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
 IF(NOT PODOFO_MAIN_CMAKELISTS_READ)
   MESSAGE(FATAL_ERROR "Run cmake on the CMakeLists.txt in the project root, not the one in the 'src' directory. You will need to delete CMakeCache.txt from the current directory.")
 ENDIF(NOT PODOFO_MAIN_CMAKELISTS_READ)
Index: test/FilterTest/FilterTest.cpp
===================================================================
--- test/FilterTest/FilterTest.cpp	(revision 1708)
+++ test/FilterTest/FilterTest.cpp	(revision 1709)
@@ -1,3 +1,5 @@
+
+
 /***************************************************************************
  *   Copyright (C) 2006 by Dominik Seichter                                *
  *   domseichter@web.de                                                    *
@@ -33,11 +35,16 @@
 const pdf_long lTestLength1 = strlen(pTestBuffer1);
 
 const char pTestBuffer2[]  = { 
-    0x01, 0x64, 0x65, 0xFE, 0x6B, 0x80, 0x45, 0x32, 0x88, 0x12, 0x71, 0xEA, 0x01,
-    0x01, 0x64, 0x65, 0xFE, 0x6B, 0x80, 0x45, 0x32, 0x88, 0x12, 0x71, 0xEA, 0x03,
-    0x01, 0x64, 0x65, 0xFE, 0x6B, 0x80, 0x45, 0x32, 0x88, 0x12, 0x71, 0xEA, 0x02,
-    0x01, 0x64, 0x65, 0xFE, 0x6B, 0x80, 0x45, 0x32, 0x88, 0x12, 0x71, 0xEA, 0x00,
-    0x01, 0x64, 0x65, 0xFE, 0x6B, 0x80, 0x45, 0x32, 0x88, 0x12, 0x71, 0xEA, 0x00,
+    0x01, 0x64, 0x65, static_cast<char>(0xFE), 0x6B, static_cast<char>(0x80), 0x45, 0x32,
+    static_cast<char>(0x88), 0x12, static_cast<char>(0x71), static_cast<char>(0xEA), 0x01,
+    0x01, 0x64, 0x65, static_cast<char>(0xFE), 0x6B, static_cast<char>(0x80), 0x45, 0x32,
+    static_cast<char>(0x88), 0x12, static_cast<char>(0x71), static_cast<char>(0xEA), 0x03,
+    0x01, 0x64, 0x65, static_cast<char>(0xFE), 0x6B, static_cast<char>(0x80), 0x45, 0x32,
+    static_cast<char>(0x88), 0x12, static_cast<char>(0x71), static_cast<char>(0xEA), 0x02,
+    0x01, 0x64, 0x65, static_cast<char>(0xFE), 0x6B, static_cast<char>(0x80), 0x45, 0x32,
+    static_cast<char>(0x88), 0x12, static_cast<char>(0x71), static_cast<char>(0xEA), 0x00,
+    0x01, 0x64, 0x65, static_cast<char>(0xFE), 0x6B, static_cast<char>(0x80), 0x45, 0x32,
+    static_cast<char>(0x88), 0x12, static_cast<char>(0x71), static_cast<char>(0xEA), 0x00,
     0x00, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 

------------------------------------------------------------------------
