[Liblas-commits] hg: 5 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Oct 26 23:28:37 EDT 2010


changeset 7541133fc93c in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=7541133fc93c
summary: some work on the macros for generating osgeo4w packages

changeset 9a887c705c1d in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=9a887c705c1d
summary: more osgeo4w stuff

changeset ed8e0dca79ee in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=ed8e0dca79ee
summary: add batch files for osgeo4w init and startup

changeset f918c95eb523 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=f918c95eb523
summary: BUILD_TYPE stuff

changeset 4e981203ec39 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=4e981203ec39
summary: merge

diffstat:

 .hgignore                        |   3 +-
 CMakeLists.txt                   |  17 ++++++++++++---
 apps/lasindex_test.cpp           |  28 +++++++++++---------------
 apps/laskernel.cpp               |   8 +++---
 apps/laskernel.hpp               |   6 ++--
 apps/oci_util.cpp                |   1 -
 apps/oci_util.hpp                |   2 +-
 cmake/modules/BuildOSGeo4W.cmake |  41 +++++++++++++++++++++++++++++----------
 hobu-config.bat                  |   4 +-
 include/liblas/lasbounds.hpp     |   6 +++-
 include/liblas/lasindex.hpp      |   1 -
 liblas-osgeo4w-init.bat          |   3 ++
 src/CMakeLists.txt               |  28 ++++++++++++++------------
 src/detail/writer/point.cpp      |   9 ++-----
 src/lasdimension.cpp             |  28 ++++++++++++--------------
 src/lasheader.cpp                |   7 +++--
 src/lasschema.cpp                |   5 +++-
 test/unit/lasbounds_test.cpp     |  19 ++++++++---------
 test/unit/tut/tut_assert.hpp     |   2 +-
 19 files changed, 123 insertions(+), 95 deletions(-)

diffs (truncated from 552 to 300 lines):

diff -r db448f962223 -r 4e981203ec39 .hgignore
--- a/.hgignore	Tue Oct 26 14:37:53 2010 -0500
+++ b/.hgignore	Tue Oct 26 21:28:13 2010 -0600
@@ -1,6 +1,7 @@
 syntax: glob
 *~
-\#*
+\#*\#
+.\#*
 *.bak
 *.dll
 *.dll.manifest
diff -r db448f962223 -r 4e981203ec39 CMakeLists.txt
--- a/CMakeLists.txt	Tue Oct 26 14:37:53 2010 -0500
+++ b/CMakeLists.txt	Tue Oct 26 21:28:13 2010 -0600
@@ -102,8 +102,13 @@
   endif()
 else()
   if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+
+	# Recommended C++ compilation flags
+	# -Weffc++
+	set(LIBLAS_GCC_CXX_FLAGS
+	  "-pedantic -ansi -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long")
     
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-long-long -ansi")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${LIBLAS_GCC_CXX_FLAGS}")
     if (CMAKE_COMPILER_IS_GNUCXX)
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
     endif()
@@ -295,14 +300,12 @@
   endif()
 endif()
 
-#if (WIN32)
-#    include(BuildOSGeo4W)
-#endif(WIN32)
 
 # Version information
 SET(CPACK_PACKAGE_VERSION_MAJOR "1")
 SET(CPACK_PACKAGE_VERSION_MINOR "6")
 SET(CPACK_PACKAGE_VERSION_PATCH "0b1")
+SET(OSGEO4W_UPSTREAM_RELEASE "1")
 
 SET(CPACK_SOURCE_GENERATOR "TGZ;ZIP;TBZ2")
 SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
@@ -326,6 +329,12 @@
 list(APPEND CPACK_SOURCE_IGNORE_FILES "schemas")
 list(APPEND CPACK_SOURCE_IGNORE_FILES "hobu-config.bat")
 
+list(APPEND CPACK_SOURCE_IGNORE_FILES "liblas-osgeo4w-init.bat")
+list(APPEND CPACK_SOURCE_IGNORE_FILES "liblas-osgeo4w-start.bat.tmpl")
 include(CPack)
 
 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
+
+#if (WIN32)
+#    include(BuildOSGeo4W)
+#endif(WIN32)
diff -r db448f962223 -r 4e981203ec39 apps/lasindex_test.cpp
--- a/apps/lasindex_test.cpp	Tue Oct 26 14:37:53 2010 -0500
+++ b/apps/lasindex_test.cpp	Tue Oct 26 21:28:13 2010 -0600
@@ -559,13 +559,11 @@
 										if (FilterResult.size())
 										{
 											// do something with the list of points
-											#ifdef VISUAL_8
-											fprintf(debugger, "Points within filter area %d of %d, %s\n", FilterResult.size(), 
-												index.GetPointRecordsCount(), "User-defined filter bounds");
-											#else // VISUAL_8
-											fprintf(debugger, "Points within filter area %zu of %d, %s\n", FilterResult.size(), 
-												index.GetPointRecordsCount(), "User-defined filter bounds");
-											#endif // VISUAL_8
+											std::ostringstream oss;
+											oss << "Points within filter area " << FilterResult.size() 
+												<< " of " << index.GetPointRecordsCount()
+												<< ",\nUser-defined filter bounds" << std::endl;
+											fprintf(debugger, "%s", oss.str().c_str());
 										}
 										else
 											IndexFilterNoPoints(debugger);
@@ -660,13 +658,11 @@
 											if (FilterResult.size())
 											{
 												// do something with the list of points
-												#ifdef VISUAL_8
-												fprintf(debugger, "Points within filter area %d of %d, %s\n", FilterResult.size(), 
-													index.GetPointRecordsCount(), CovgStr);
-												#else // VISUAL_8
-												fprintf(debugger, "Points within filter area %zu of %d, %s\n", FilterResult.size(), 
-													index.GetPointRecordsCount(), CovgStr);
-												#endif // VISUAL_8
+												std::ostringstream oss;
+												oss << "Points within filter area " << FilterResult.size() 
+													<< " of " << index.GetPointRecordsCount() 
+													<< ", " << CovgStr << std::endl;
+												fprintf(debugger, "%s", oss.str().c_str());
 											}
 											else
 												IndexFilterNoPoints(debugger);
@@ -693,8 +689,8 @@
 					if (static_cast<std::ifstream&>(*idxstrm))
 						static_cast<std::ifstream&>(*idxstrm).close();
 				} // if
-				if (idxreader)
-					delete idxreader;
+
+				delete idxreader;
 				delete reader;
 			} // if reader
 		
diff -r db448f962223 -r 4e981203ec39 apps/laskernel.cpp
--- a/apps/laskernel.cpp	Tue Oct 26 14:37:53 2010 -0500
+++ b/apps/laskernel.cpp	Tue Oct 26 21:28:13 2010 -0600
@@ -1,7 +1,7 @@
 
 #include "laskernel.hpp"
 
-std::istream* OpenInput(std::string filename, bool bEnd) 
+std::istream* OpenInput(std::string const& filename, bool bEnd) 
 {
     std::ios::openmode mode = std::ios::in | std::ios::binary;
     if (bEnd == true) {
@@ -30,10 +30,10 @@
     std::vector<char> data = TryReadRawFileData(filename);
 
     // FIXME: What is this construction supposed to grab? --mloskot
-    return std::string((const char*)data.front(), data.size());
+    return std::string(&data[0], data.size());
 }
 
-std::vector<char> TryReadRawFileData(std::string filename)
+std::vector<char> TryReadRawFileData(std::string const& filename)
 {
     std::istream* infile = OpenInput(filename.c_str(), true);
     std::ifstream::pos_type size;
@@ -63,7 +63,7 @@
     static int lastTick = -1;
     int tick = static_cast<int>(complete * 40.0);
 
-    tick = std::min(40, std::max(0, tick));
+    tick = (std::min)(40, std::max(0, tick));
 
     // Have we started a new progress run?  
     if (tick < lastTick && lastTick >= 39)
diff -r db448f962223 -r 4e981203ec39 apps/laskernel.hpp
--- a/apps/laskernel.hpp	Tue Oct 26 14:37:53 2010 -0500
+++ b/apps/laskernel.hpp	Tue Oct 26 21:28:13 2010 -0600
@@ -92,9 +92,9 @@
 #define compare_no_case(a,b,n)  strncasecmp( (a), (b), (n) )
 #endif
 
-std::istream* OpenInput(std::string filename, bool bEnd);
-std::string TryReadFileData(std::string filename);
-std::vector<char> TryReadRawFileData(std::string filename);
+// std::istream* OpenInput(std::string const& filename, bool bEnd);
+std::string TryReadFileData(std::string const& filename);
+std::vector<char> TryReadRawFileData(std::string const& filename);
 bool term_progress(std::ostream& os, double complete);
 void SetStreamPrecision(std::ostream& os, double scale);
 
diff -r db448f962223 -r 4e981203ec39 apps/oci_util.cpp
--- a/apps/oci_util.cpp	Tue Oct 26 14:37:53 2010 -0500
+++ b/apps/oci_util.cpp	Tue Oct 26 21:28:13 2010 -0600
@@ -1,7 +1,6 @@
 #include "oci_util.hpp"
 
 
-
 std::string ReadSQLData(std::string filename)
 {
     std::istream* infile = OpenInput(filename.c_str(), true);
diff -r db448f962223 -r 4e981203ec39 apps/oci_util.hpp
--- a/apps/oci_util.hpp	Tue Oct 26 14:37:53 2010 -0500
+++ b/apps/oci_util.hpp	Tue Oct 26 21:28:13 2010 -0600
@@ -33,7 +33,7 @@
                     std::string cloudColumnName);
 std::string to_upper(const std::string&);
 std::string ReadSQLData(std::string filename);
-std::istream* OpenInput(std::string filename, bool bEnd) ;
+std::istream* OpenInput(std::string const& filename, bool bEnd) ;
 
 #ifdef _WIN32
 #define compare_no_case(a,b,n)  _strnicmp( (a), (b), (n) )
diff -r db448f962223 -r 4e981203ec39 cmake/modules/BuildOSGeo4W.cmake
--- a/cmake/modules/BuildOSGeo4W.cmake	Tue Oct 26 14:37:53 2010 -0500
+++ b/cmake/modules/BuildOSGeo4W.cmake	Tue Oct 26 21:28:13 2010 -0600
@@ -7,7 +7,10 @@
 MESSAGE(STATUS "Building osgeo4w binaries")
 set(OSGEO4W_DIR osgeo4w)
 set(OSGEO4W_LIB_DIR ${OSGEO4W_DIR}/lib)
+set(OSGEO4W_ETC_DIR ${OSGEO4W_DIR}/etc)
+set(OSGEO4W_ETC_INI_DIR ${OSGEO4W_DIR}/etc/ini)
 set(OSGEO4W_LIB_BIN_DIR ${OSGEO4W_DIR}/lib/bin)
+set(OSGEO4W_BIN_DIR ${OSGEO4W_DIR}/bin)
 set(OSGEO4W_DEVEL_DIR ${OSGEO4W_DIR}/devel)
 set(OSGEO4W_DEVEL_INCLUDE_DIR ${OSGEO4W_DEVEL_DIR}/include)
 set(OSGEO4W_DEVEL_INCLUDE_LIBLAS_DIR ${OSGEO4W_DEVEL_INCLUDE_DIR}/liblas)
@@ -20,6 +23,8 @@
 
 set(OSGEO4W_DIRECTORIES
     ${OSGEO4W_DIR}
+    ${OSGEO4W_ETC_DIR}
+    ${OSGEO4W_ETC_INI_DIR}
     ${OSGEO4W_LIB_DIR}
     ${OSGEO4W_LIB_BIN_DIR}
     ${OSGEO4W_DEVEL_DIR}
@@ -28,7 +33,8 @@
     ${OSGEO4W_DEVEL_LIB_DIR}
     ${OSGEO4W_PYTHON_DIR}
     ${OSGEO4W_DEVEL_BIN_DIR}
-    ${OSGEO4W_PACKAGES})
+    ${OSGEO4W_PACKAGES}
+    ${OSGEO4W_BIN_DIR})
 
 
 
@@ -78,34 +84,47 @@
 endmacro(copy_files)
 
 
+macro(copy_directory SOURCE DESTINATION  )
+    
+    MESSAGE(STATUS "   Copying ${SOURCE} to ${DESTINATION}")
+        add_custom_command(
+            TARGET copy
+            COMMAND ${CMAKE_COMMAND} -E copy_directory ${SOURCE} ${DESTINATION}
+        )
+endmacro(copy_directory)
+
+
 add_custom_target(tar
   COMMAND ${CMAKE_COMMAND} -E echo "Tarring OSGeo4W install")
 add_dependencies( tar copy  )
 
-macro (tar_directories source destination base_path)
+macro (tar_directories source destination base_paths)
 
     MESSAGE(STATUS "   Tarring ${source} to ${destination}")
+    
     add_custom_command(
         TARGET tar
-        COMMAND ${CMAKE_COMMAND} -E chdir ${source} cmake -E tar czf  ${destination} ${base_path}/
+        COMMAND ${CMAKE_COMMAND} -E chdir ${source} cmake -E tar czf  ${destination} ${base_paths}
     )
 
 
 endmacro(tar_directories)
 
 make_directories()
-copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/las* ${OSGEO4W_DEVEL_BIN_DIR}/  )
-copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/*[.${SO_EXT}] ${OSGEO4W_DEVEL_BIN_DIR}/  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/*.exe ${OSGEO4W_BIN_DIR}/  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/liblas_c.dll ${OSGEO4W_BIN_DIR}/  )
+copy_files(${libLAS_SOURCE_DIR}/liblas-osgeo4w-init.bat ${OSGEO4W_ETC_INI_DIR}/liblas.bat )
 
-copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/*.lib ${OSGEO4W_DEVEL_LIB_DIR}/  )
-copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/*.a ${OSGEO4W_DEVEL_LIB_DIR}/  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/liblas.lib ${OSGEO4W_DEVEL_LIB_DIR}/  )
+copy_files(${LIBLAS_BUILD_OUTPUT_DIRECTORY}/liblas_c.lib ${OSGEO4W_DEVEL_LIB_DIR}/  )
 
-copy_files(./include/liblas/* ${OSGEO4W_DEVEL_INCLUDE_LIBLAS_DIR}/  )
+
+copy_directory(./include/liblas/ ${OSGEO4W_DEVEL_INCLUDE_LIBLAS_DIR}/  )
 copy_files(./python/liblas/*.py ${OSGEO4W_PYTHON_DIR}/  )
 
-tar_directories(${OSGEO4W_DEVEL_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.tar.gz bin)
-tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-python-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.tar.gz apps)
-tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-devel-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.tar.gz devel)
+tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${OSGEO4W_UPSTREAM_RELEASE}.tar.gz "bin/;etc/")
+tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-python-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${OSGEO4W_UPSTREAM_RELEASE}.tar.gz apps)
+tar_directories(${OSGEO4W_DIR} ${libLAS_SOURCE_DIR}/${OSGEO4W_PACKAGES}/liblas-devel-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${OSGEO4W_UPSTREAM_RELEASE}.tar.gz devel)
 
 
 add_custom_target(osgeo4w
diff -r db448f962223 -r 4e981203ec39 hobu-config.bat
--- a/hobu-config.bat	Tue Oct 26 14:37:53 2010 -0500
+++ b/hobu-config.bat	Tue Oct 26 21:28:13 2010 -0600
@@ -6,8 +6,8 @@
 set BOOST=D:\boost\boost_1_44
 set ORACLE_HOME=%OSGEO4W%
 # set BUILD_TYPE=RelWithDebInfo
-set BUILD_TYPE=Debug
-# set BUILD_TYPE=Release
+#set BUILD_TYPE=Debug
+set BUILD_TYPE=Release
 
 set PATH=%OSGEO4W%\apps\gdal-dev\bin;%OSGEO4W%\bin;%PATH%
 
diff -r db448f962223 -r 4e981203ec39 include/liblas/lasbounds.hpp
--- a/include/liblas/lasbounds.hpp	Tue Oct 26 14:37:53 2010 -0500
+++ b/include/liblas/lasbounds.hpp	Tue Oct 26 21:28:13 2010 -0600
@@ -67,7 +67,9 @@
 public:
     T min;
     T max;
-    
+
+	typedef T value_type;
+


More information about the Liblas-commits mailing list