[geos-commits] r2893 - in trunk: . include/geos

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Jan 29 12:42:10 EST 2010


Author: mloskot
Date: 2010-01-29 12:42:07 -0500 (Fri, 29 Jan 2010)
New Revision: 2893

Modified:
   trunk/CMakeLists.txt
   trunk/include/geos/platform.h.cmake
Log:
Solved problem with repeated definition of getMachineByteOrder (#317). Added check if alternative platform.h is already present in the include/geos directory and deactivate it renaming to platform.h.disable, before generating CMake-specific platform.h. Tested on Windows with Visual C++ but with -DGEOS_ENABLE_INLINE=OFF otherwise DLL linking fails with many redefined symbols - to be checked.

Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2010-01-29 01:43:22 UTC (rev 2892)
+++ trunk/CMakeLists.txt	2010-01-29 17:42:07 UTC (rev 2893)
@@ -86,18 +86,20 @@
 elseif(MSVC)
     
   # Set pedantic mode by default
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
+  #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
+  string(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  message(STATUS "Z: ${CMAKE_CXX_FLAGS}")
 
   if(MSVC80 OR MSVC90 OR MSVC10)
 
     # Option is to enable the /MP switch for Visual Studio 2005 or later
     option(GEOS_MSVC_ENABLE_MP
-      "Set to ON to build GEOS with the /MP option (Visual Studio 2005 and above)." OFF)
+      "Set to ON to build GEOS with the /MP option (Visual Studio 2005 and above)." ON)
     mark_as_advanced(GEOS_MSVC_ENABLE_MP)
     if(GEOS_MSVC_ENABLE_MP)
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
     endif()
-    message(STATUS "Setting Visual Studio 2005+ option /MP to ${ENABLE_MSVC_MP}")
+    message(STATUS "Setting Visual Studio 2005+ option /MP to ${GEOS_MSVC_ENABLE_MP}")
     
     # Disable C4996: 'function': was declared deprecated
     add_definitions(-D_SCL_SECURE_NO_WARNINGS)
@@ -198,6 +200,12 @@
 
 # TODO: output to CMAKE_CURRENT_BINARY_DIR instead of CMAKE_SOURCE_DIR
 
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/include/geos/platform.h)
+  file(RENAME
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/geos/platform.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/include/geos/platform.h.disabled)
+endif()
+
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/geos/platform.h.cmake 
   ${CMAKE_CURRENT_BINARY_DIR}/include/geos/platform.h)
 

Modified: trunk/include/geos/platform.h.cmake
===================================================================
--- trunk/include/geos/platform.h.cmake	2010-01-29 01:43:22 UTC (rev 2892)
+++ trunk/include/geos/platform.h.cmake	2010-01-29 17:42:07 UTC (rev 2893)
@@ -20,6 +20,9 @@
 #ifndef GEOS_PLATFORM_H_INCLUDED
 #define GEOS_PLATFORM_H_INCLUDED
 
+/* Disable inclusion of platform.h not generated by CMake */
+#define GEOS_PLATFORM_H 1
+
 /* Set to 1 if you have stdint.h */
 #cmakedefine HAVE_STDINT_H 1
 



More information about the geos-commits mailing list