Blob Blame History Raw
diff -rupN libkml-1.3.0/CMakeLists.txt libkml-1.3.0-new/CMakeLists.txt
--- libkml-1.3.0/CMakeLists.txt	2015-12-21 18:23:05.000000000 +0100
+++ libkml-1.3.0-new/CMakeLists.txt	2017-10-30 11:59:20.966195631 +0100
@@ -47,9 +47,7 @@ endif(NOT DEFINED LIB_INSTALL_DIR)
 if(NOT DEFINED DATA_INSTALL_DIR)
   set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
 endif(NOT DEFINED DATA_INSTALL_DIR)
-if(NOT DEFINED INCLUDE_INSTALL_DIR)
-  set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/kml")
-endif(NOT DEFINED INCLUDE_INSTALL_DIR)
+set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/kml")
 if(NOT DEFINED MAN_INSTALL_DIR)
   set(MAN_INSTALL_DIR "${DATA_INSTALL_DIR}/man")
 endif(NOT DEFINED MAN_INSTALL_DIR)
@@ -69,12 +67,7 @@ if(NOT DEFINED PKGCONFIG_INSTALL_DIR)
   set(PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig")
 endif(NOT DEFINED PKGCONFIG_INSTALL_DIR)
 
-if(WIN32 AND NOT CYGWIN)
-  set(DEF_INSTALL_CMAKE_DIR cmake)
-else()
-  set(DEF_INSTALL_CMAKE_DIR lib/cmake/libkml)
-endif()
-set(CMAKE_INSTALL_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
+set(CMAKE_INSTALL_DIR lib/cmake/libkml)
 
 set(INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE "install directory " PATH)
 
@@ -215,4 +208,4 @@ install(FILES
   DESTINATION "${CMAKE_INSTALL_DIR}" )
  
 # Install the export set for use with the install-tree
-install(EXPORT LibKMLTargets DESTINATION "${CMAKE_INSTALL_DIR}")
\ No newline at end of file
+install(EXPORT LibKMLTargets DESTINATION "${CMAKE_INSTALL_DIR}")
diff -rupN libkml-1.3.0/src/kml/base/file_win32.cc libkml-1.3.0-new/src/kml/base/file_win32.cc
--- libkml-1.3.0/src/kml/base/file_win32.cc	2015-12-21 18:23:05.000000000 +0100
+++ libkml-1.3.0-new/src/kml/base/file_win32.cc	2017-10-30 11:45:08.434800533 +0100
@@ -34,7 +34,6 @@
 #include "kml/base/file.h"
 #include <windows.h>
 #include <tchar.h>
-#include <xstring>
 #include <algorithm>
 
 namespace kmlbase {
@@ -42,7 +41,7 @@ namespace kmlbase {
 // Internal to the win32 file class. We need a conversion from string to
 // LPCWSTR.
 static std::wstring Str2Wstr(const string& str) {
-  std::wstring wstr(str.length(), L'');
+  std::wstring wstr(str.length(), '\0');
   std::copy(str.begin(), str.end(), wstr.begin());
   return wstr;
 }
@@ -62,7 +61,7 @@ bool File::Exists(const string& full_pat
     return false;
   }
   std::wstring wstr = Str2Wstr(full_path);
-  DWORD attrs = ::GetFileAttributes(wstr.c_str());
+  DWORD attrs = ::GetFileAttributesW(wstr.c_str());
   return (attrs != INVALID_FILE_ATTRIBUTES) &&
     ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0);
 }
@@ -72,7 +71,7 @@ bool File::Delete(const string& filepath
     return false;
   }
   std::wstring wstr = Str2Wstr(filepath);
-  return ::DeleteFile(wstr.c_str()) ? true : false;
+  return ::DeleteFileW(wstr.c_str()) ? true : false;
 }
 
 static const unsigned int BUFSIZE = 1024;
@@ -97,7 +96,7 @@ bool File::CreateNewTempFile(string* pat
   if (uRetVal == 0) {
     return false;
   }
-  string str = Wstr2Str(szTempName);
+  string str = szTempName;
   path->assign(str.c_str(), strlen(str.c_str()));
   return true;
 }