Commit 2e10bf9a authored by Bas Couwenberg's avatar Bas Couwenberg

Imported Upstream version 2.1.1

parent a3160fa0
......@@ -13,6 +13,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
## [2.1.1] - 2015-08-31
### Changed
- Use newest libosmium release.
## [2.1.0] - 2015-08-18
### Added
......@@ -32,7 +39,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added man pages
[unreleased]: https://github.com/osmcode/osmium-tool/compare/v2.1.0...HEAD
[unreleased]: https://github.com/osmcode/osmium-tool/compare/v2.1.1...HEAD
[2.1.1]: https://github.com/osmcode/osmium-tool/compare/v2.1.0...v2.1.1
[2.1.0]: https://github.com/osmcode/osmium-tool/compare/v2.0.1...v2.1.0
[2.0.1]: https://github.com/osmcode/osmium-tool/compare/v2.0.0...v2.0.1
......@@ -22,7 +22,7 @@ project(osmcoastline)
set(OSMCOASTLINE_VERSION_MAJOR 2)
set(OSMCOASTLINE_VERSION_MINOR 1)
set(OSMCOASTLINE_VERSION_PATCH 0)
set(OSMCOASTLINE_VERSION_PATCH 1)
set(OSMCOASTLINE_VERSION
${OSMCOASTLINE_VERSION_MAJOR}.${OSMCOASTLINE_VERSION_MINOR}.${OSMCOASTLINE_VERSION_PATCH})
......@@ -37,7 +37,7 @@ set(AUTHOR "Jochen Topf <jochen@topf.org>")
#-----------------------------------------------------------------------------
find_package(Osmium COMPONENTS io gdal)
include_directories(${OSMIUM_INCLUDE_DIRS})
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
if(MSVC)
find_path(GETOPT_INCLUDE_DIR getopt.h)
......
......@@ -19,7 +19,7 @@
# Then add the following in your CMakeLists.txt:
#
# find_package(Osmium REQUIRED COMPONENTS <XXX>)
# include_directories(${OSMIUM_INCLUDE_DIRS})
# include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
#
# For the <XXX> substitute a space separated list of one or more of the
# following components:
......@@ -56,32 +56,12 @@ find_path(OSMIUM_INCLUDE_DIR osmium/osm.hpp
PATH_SUFFIXES include
PATHS
../libosmium
../../libosmium
libosmium
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr/
/opt/local # DarwinPorts
/opt
)
# Handle the QUIETLY and REQUIRED arguments and set OSMIUM_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OSMIUM REQUIRED_VARS OSMIUM_INCLUDE_DIR)
# Copy the results to the output variables.
if(OSMIUM_FOUND)
set(OSMIUM_INCLUDE_DIRS ${OSMIUM_INCLUDE_DIR})
else()
set(OSMIUM_INCLUDE_DIRS "")
endif()
if(Osmium_FIND_REQUIRED AND NOT OSMIUM_FOUND)
message(FATAL_ERROR "Can not find libosmium headers, please install them or configure the paths")
endif()
#----------------------------------------------------------------------
#
# Check for optional components
......@@ -113,6 +93,7 @@ if(Osmium_USE_PBF)
find_package(ZLIB)
find_package(Threads)
list(APPEND OSMIUM_EXTRA_FIND_VARS ZLIB_FOUND Threads_FOUND)
if(ZLIB_FOUND AND Threads_FOUND)
list(APPEND OSMIUM_PBF_LIBRARIES
${ZLIB_LIBRARIES}
......@@ -125,7 +106,6 @@ if(Osmium_USE_PBF)
${ZLIB_INCLUDE_DIR}
)
else()
set(_missing_libraries 1)
message(WARNING "Osmium: Can not find some libraries for PBF input/output, please install them or configure the paths.")
endif()
endif()
......@@ -138,6 +118,7 @@ if(Osmium_USE_XML)
find_package(ZLIB)
find_package(Threads)
list(APPEND OSMIUM_EXTRA_FIND_VARS EXPAT_FOUND BZIP2_FOUND ZLIB_FOUND Threads_FOUND)
if(EXPAT_FOUND AND BZIP2_FOUND AND ZLIB_FOUND AND Threads_FOUND)
list(APPEND OSMIUM_XML_LIBRARIES
${EXPAT_LIBRARIES}
......@@ -151,7 +132,6 @@ if(Osmium_USE_XML)
${ZLIB_INCLUDE_DIR}
)
else()
set(_missing_libraries 1)
message(WARNING "Osmium: Can not find some libraries for XML input/output, please install them or configure the paths.")
endif()
endif()
......@@ -172,12 +152,12 @@ if(Osmium_USE_GEOS)
find_path(GEOS_INCLUDE_DIR geos/geom.h)
find_library(GEOS_LIBRARY NAMES geos)
list(APPEND OSMIUM_EXTRA_FIND_VARS GEOS_INCLUDE_DIR GEOS_LIBRARY)
if(GEOS_INCLUDE_DIR AND GEOS_LIBRARY)
SET(GEOS_FOUND 1)
list(APPEND OSMIUM_LIBRARIES ${GEOS_LIBRARY})
list(APPEND OSMIUM_INCLUDE_DIRS ${GEOS_INCLUDE_DIR})
else()
set(_missing_libraries 1)
message(WARNING "Osmium: GEOS library is required but not found, please install it or configure the paths.")
endif()
endif()
......@@ -187,11 +167,11 @@ endif()
if(Osmium_USE_GDAL)
find_package(GDAL)
list(APPEND OSMIUM_EXTRA_FIND_VARS GDAL_FOUND)
if(GDAL_FOUND)
list(APPEND OSMIUM_LIBRARIES ${GDAL_LIBRARIES})
list(APPEND OSMIUM_INCLUDE_DIRS ${GDAL_INCLUDE_DIRS})
else()
set(_missing_libraries 1)
message(WARNING "Osmium: GDAL library is required but not found, please install it or configure the paths.")
endif()
endif()
......@@ -202,12 +182,12 @@ if(Osmium_USE_PROJ)
find_path(PROJ_INCLUDE_DIR proj_api.h)
find_library(PROJ_LIBRARY NAMES proj)
list(APPEND OSMIUM_EXTRA_FIND_VARS PROJ_INCLUDE_DIR PROJ_LIBRARY)
if(PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
set(PROJ_FOUND 1)
list(APPEND OSMIUM_LIBRARIES ${PROJ_LIBRARY})
list(APPEND OSMIUM_INCLUDE_DIRS ${PROJ_INCLUDE_DIR})
else()
set(_missing_libraries 1)
message(WARNING "Osmium: PROJ.4 library is required but not found, please install it or configure the paths.")
endif()
endif()
......@@ -217,21 +197,19 @@ endif()
if(Osmium_USE_SPARSEHASH)
find_path(SPARSEHASH_INCLUDE_DIR google/sparsetable)
list(APPEND OSMIUM_EXTRA_FIND_VARS SPARSEHASH_INCLUDE_DIR)
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++.
include(CheckTypeSize)
set(CMAKE_REQUIRED_INCLUDES ${SPARSEHASH_INCLUDE_DIR})
set(CMAKE_EXTRA_INCLUDE_FILES "google/sparsetable")
check_type_size("google::sparsetable<int>::size_type" SPARSETABLE_SIZE_TYPE LANGUAGE CXX)
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})
if (NOT CMAKE_VERSION VERSION_LESS 3.0)
include(CheckTypeSize)
set(CMAKE_REQUIRED_INCLUDES ${SPARSEHASH_INCLUDE_DIR})
set(CMAKE_EXTRA_INCLUDE_FILES "google/sparsetable")
check_type_size("google::sparsetable<int>::size_type" SPARSETABLE_SIZE_TYPE LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_INCLUDES)
else()
set(SPARSETABLE_SIZE_TYPE ${CMAKE_SIZEOF_VOID_P})
endif()
# Sparsetable::size_type must be at least 8 bytes (64bit), otherwise
......@@ -244,7 +222,6 @@ if(Osmium_USE_SPARSEHASH)
message(WARNING "Osmium: Disabled Google SparseHash library on 32bit system (size_type=${SPARSETABLE_SIZE_TYPE}).")
endif()
else()
set(_missing_libraries 1)
message(WARNING "Osmium: Google SparseHash library is required but not found, please install it or configure the paths.")
endif()
endif()
......@@ -274,8 +251,18 @@ endif()
# Check that all required libraries are available
#
#----------------------------------------------------------------------
if(Osmium_FIND_REQUIRED AND _missing_libraries)
message(FATAL_ERROR "Required library or libraries missing. Aborting.")
list(REMOVE_DUPLICATES OSMIUM_EXTRA_FIND_VARS)
# Handle the QUIETLY and REQUIRED arguments and set OSMIUM_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Osmium REQUIRED_VARS OSMIUM_INCLUDE_DIR ${OSMIUM_EXTRA_FIND_VARS})
unset(OSMIUM_EXTRA_FIND_VARS)
# Copy the results to the output variables.
if(OSMIUM_FOUND)
set(OSMIUM_INCLUDE_DIRS ${OSMIUM_INCLUDE_DIR} ${OSMIUM_INCLUDE_DIRS})
else()
set(OSMIUM_INCLUDE_DIRS "")
endif()
#----------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment