[osmium-tool] 96/97: New FindOsmium CMake script from libosmium repos.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Tue Jul 21 20:15:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to tag v1.0.0
in repository osmium-tool.

commit 4ef5dd5afcc7a064e6ab555b25d5d5d89d1c709c
Author: Jochen Topf <jochen at topf.org>
Date:   Fri Mar 6 15:04:19 2015 +0100

    New FindOsmium CMake script from libosmium repos.
---
 cmake/FindOsmium.cmake | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/cmake/FindOsmium.cmake b/cmake/FindOsmium.cmake
index 4c33708..1de41a0 100644
--- a/cmake/FindOsmium.cmake
+++ b/cmake/FindOsmium.cmake
@@ -226,7 +226,6 @@ if(Osmium_USE_SPARSEHASH)
     if(SPARSEHASH_INCLUDE_DIR)
         # Find size of sparsetable::size_type. This does not work on older
         # CMake versions because they can do this check only in C, not in C++.
-        # Until we find a better way, we'll live with that.
         include(CheckTypeSize)
         set(CMAKE_REQUIRED_INCLUDES ${SPARSEHASH_INCLUDE_DIR})
         set(CMAKE_EXTRA_INCLUDE_FILES "google/sparsetable")
@@ -234,14 +233,19 @@ if(Osmium_USE_SPARSEHASH)
         set(CMAKE_EXTRA_INCLUDE_FILES)
         set(CMAKE_REQUIRED_INCLUDES)
 
+        # Falling back to checking size_t if google::sparsetable<int>::size_type
+        # could not be checked.
+        if(SPARSETABLE_SIZE_TYPE STREQUAL "")
+            check_type_size("void*" VOID_PTR_SIZE)
+            set(SPARSETABLE_SIZE_TYPE ${VOID_PTR_SIZE})
+        endif()
+
         # Sparsetable::size_type must be at least 8 bytes (64bit), otherwise
         # OSM object IDs will not fit.
         if(SPARSETABLE_SIZE_TYPE GREATER 7)
             set(SPARSEHASH_FOUND 1)
             add_definitions(-DOSMIUM_WITH_SPARSEHASH=${SPARSEHASH_FOUND})
             list(APPEND OSMIUM_INCLUDE_DIRS ${SPARSEHASH_INCLUDE_DIR})
-        elseif(SPARSETABLE_SIZE_TYPE STREQUAL "")
-            message(WARNING "Osmium: Disabled Google SparseHash library because we can't detect whether we are on a 64bit system.")
         else()
             message(WARNING "Osmium: Disabled Google SparseHash library on 32bit system (size_type=${SPARSETABLE_SIZE_TYPE}).")
         endif()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osmium-tool.git



More information about the Pkg-grass-devel mailing list