Skip to content

Commit 52beeb8

Browse files
committed
Use new FindOsmium.cmake from libosmium
1 parent 084af55 commit 52beeb8

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

cmake/FindOsmium.cmake

-53
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
# io - include libraries needed for any type of input/output
3333
# geos - include if you want to use any of the GEOS functions
3434
# gdal - include if you want to use any of the OGR functions
35-
# proj - include if you want to use any of the Proj.4 functions
36-
# sparsehash - include if you use the sparsehash index (deprecated!)
3735
# lz4 - include support for LZ4 compression of PBF files
3836
#
3937
# You can check for success with something like this:
@@ -205,57 +203,6 @@ if(Osmium_USE_GDAL)
205203
endif()
206204
endif()
207205

208-
#----------------------------------------------------------------------
209-
# Component 'proj'
210-
if(Osmium_USE_PROJ)
211-
find_path(PROJ_INCLUDE_DIR proj_api.h)
212-
find_library(PROJ_LIBRARY NAMES proj)
213-
214-
list(APPEND OSMIUM_EXTRA_FIND_VARS PROJ_INCLUDE_DIR PROJ_LIBRARY)
215-
if(PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
216-
set(PROJ_FOUND 1)
217-
list(APPEND OSMIUM_LIBRARIES ${PROJ_LIBRARY})
218-
list(APPEND OSMIUM_INCLUDE_DIRS ${PROJ_INCLUDE_DIR})
219-
else()
220-
message(WARNING "Osmium: PROJ.4 library is required but not found, please install it or configure the paths.")
221-
endif()
222-
endif()
223-
224-
#----------------------------------------------------------------------
225-
# Component 'sparsehash'
226-
if(Osmium_USE_SPARSEHASH)
227-
message(WARNING "Osmium: Use of Google SparseHash is deprecated. Please switch to a different index type.")
228-
find_path(SPARSEHASH_INCLUDE_DIR google/sparsetable)
229-
230-
list(APPEND OSMIUM_EXTRA_FIND_VARS SPARSEHASH_INCLUDE_DIR)
231-
if(SPARSEHASH_INCLUDE_DIR)
232-
# Find size of sparsetable::size_type. This does not work on older
233-
# CMake versions because they can do this check only in C, not in C++.
234-
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
235-
include(CheckTypeSize)
236-
set(CMAKE_REQUIRED_INCLUDES ${SPARSEHASH_INCLUDE_DIR})
237-
set(CMAKE_EXTRA_INCLUDE_FILES "google/sparsetable")
238-
check_type_size("google::sparsetable<int>::size_type" SPARSETABLE_SIZE_TYPE LANGUAGE CXX)
239-
set(CMAKE_EXTRA_INCLUDE_FILES)
240-
set(CMAKE_REQUIRED_INCLUDES)
241-
else()
242-
set(SPARSETABLE_SIZE_TYPE ${CMAKE_SIZEOF_VOID_P})
243-
endif()
244-
245-
# Sparsetable::size_type must be at least 8 bytes (64bit), otherwise
246-
# OSM object IDs will not fit.
247-
if(SPARSETABLE_SIZE_TYPE GREATER 7)
248-
set(SPARSEHASH_FOUND 1)
249-
add_definitions(-DOSMIUM_WITH_SPARSEHASH=${SPARSEHASH_FOUND})
250-
list(APPEND OSMIUM_INCLUDE_DIRS ${SPARSEHASH_INCLUDE_DIR})
251-
else()
252-
message(WARNING "Osmium: Disabled Google SparseHash library on 32bit system (size_type=${SPARSETABLE_SIZE_TYPE}).")
253-
endif()
254-
else()
255-
message(WARNING "Osmium: Google SparseHash library is required but not found, please install it or configure the paths.")
256-
endif()
257-
endif()
258-
259206
#----------------------------------------------------------------------
260207

261208
list(REMOVE_DUPLICATES OSMIUM_INCLUDE_DIRS)

0 commit comments

Comments
 (0)