diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 4b28eb924..bb361e701 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -78,6 +78,7 @@ jobs: run: | test -d $PREFIX/bin test -e $PREFIX/bin/osm2pgsql + test -e $PREFIX/bin/osm2pgsql-expire test -e $PREFIX/bin/osm2pgsql-replication test -d $PREFIX/share/man/man1 test -f $PREFIX/share/man/man1/osm2pgsql.1 diff --git a/CMakeLists.txt b/CMakeLists.txt index ea277eeb2..587489508 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,15 +7,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -# Do not create install targets when run as a subproject. -# Currently used by Nominatim which cannot yet rely on installed versions -# of osm2pgsql. -if (${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME}) - set(ENABLE_INSTALL ON) -else() - set(ENABLE_INSTALL OFF) -endif() - if (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8) message(FATAL_ERROR "osm2pgsql needs a 64 bit architecture") endif() @@ -245,7 +236,7 @@ endif() message(STATUS "Libraries used to build: ${LIBS}") ############################################################# -# Build the library and executable file +# Build the library and executable files ############################################################# add_subdirectory(src) @@ -328,12 +319,10 @@ add_subdirectory(man) include(GNUInstallDirs) -if (ENABLE_INSTALL) - install(TARGETS osm2pgsql DESTINATION bin) - install(TARGETS osm2pgsql-expire DESTINATION bin) - install(FILES default.style empty.style DESTINATION share/osm2pgsql) - install(PROGRAMS scripts/osm2pgsql-replication DESTINATION bin) - if (BUILD_GEN) - install(TARGETS osm2pgsql-gen DESTINATION bin) - endif() +install(TARGETS osm2pgsql DESTINATION bin) +install(TARGETS osm2pgsql-expire DESTINATION bin) +install(FILES default.style empty.style DESTINATION share/osm2pgsql) +install(PROGRAMS scripts/osm2pgsql-replication DESTINATION bin) +if (BUILD_GEN) + install(TARGETS osm2pgsql-gen DESTINATION bin) endif() diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 8f2356e49..d57687682 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -69,10 +69,8 @@ if(MANPAGE_TARGETS) add_custom_target(man DEPENDS ${MANPAGE_TARGETS} VERBATIM) endif() -if(ENABLE_INSTALL) - install(FILES osm2pgsql.1 DESTINATION share/man/man1) - install(FILES osm2pgsql-replication.1 DESTINATION share/man/man1) - if (BUILD_GEN) - install(FILES osm2pgsql-gen.1 DESTINATION share/man/man1) - endif() +install(FILES osm2pgsql.1 DESTINATION share/man/man1) +install(FILES osm2pgsql-replication.1 DESTINATION share/man/man1) +if (BUILD_GEN) + install(FILES osm2pgsql-gen.1 DESTINATION share/man/man1) endif() diff --git a/src/geom-from-osm.cpp b/src/geom-from-osm.cpp index 339148300..7e6b5b081 100644 --- a/src/geom-from-osm.cpp +++ b/src/geom-from-osm.cpp @@ -135,7 +135,7 @@ geometry_t create_polygon(osmium::Way const &way, void create_multipoint(geometry_t *geom, osmium::memory::Buffer const &buffer) { - auto nodes = buffer.select(); + auto const nodes = buffer.select(); if (nodes.size() == 1) { auto const location = nodes.cbegin()->location(); if (location.valid()) { @@ -176,7 +176,7 @@ void create_multilinestring(geometry_t *geom, osmium::memory::Buffer const &buffer, bool force_multi) { - auto ways = buffer.select(); + auto const ways = buffer.select(); if (ways.size() == 1 && !force_multi) { auto &line = geom->set(); auto const &way = *ways.cbegin();