From 7360e6c5dfbb469d21a856edaf16e56716497768 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Tue, 16 Feb 2021 11:06:14 +0100 Subject: [PATCH] use file copy on older cmake to install osm2pgsql Fixes #2170. --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 691c9adc..5f8e4611 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ # #----------------------------------------------------------------------------- -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") @@ -238,7 +238,14 @@ if (BUILD_IMPORTER) endif() if (BUILD_OSM2PGSQL) - install(TARGETS osm2pgsql RUNTIME DESTINATION ${NOMINATIM_LIBDIR}) + if (${CMAKE_VERSION} VERSION_LESS 3.13) + # Installation of subdirectory targets was only introduced in 3.13. + # So just copy the osm2pgsql file for older versions. + install(PROGRAMS ${PROJECT_BINARY_DIR}/osm2pgsql/osm2pgsql + DESTINATION ${NOMINATIM_LIBDIR}) + else() + install(TARGETS osm2pgsql RUNTIME DESTINATION ${NOMINATIM_LIBDIR}) + endif() endif() if (BUILD_MODULE) -- 2.45.1