File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1010
1111list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
1212
13+ # Do not create install targets when run as a subproject.
14+ # Currently used by Nominatim which cannot yet rely on installed versions
15+ # of osm2pgsql.
16+ if (${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
17+ set (ENABLE_INSTALL ON )
18+ else ()
19+ set (ENABLE_INSTALL OFF )
20+ endif ()
21+
1322if (WIN32 )
1423 set (DEFAULT_STYLE "default.style" CACHE STRING "Default style used unless one is given on the command line" )
1524else ()
@@ -324,5 +333,7 @@ add_subdirectory(docs)
324333# Install
325334#############################################################
326335
327- install (TARGETS osm2pgsql DESTINATION bin)
328- install (FILES default.style empty.style DESTINATION share/osm2pgsql)
336+ if (ENABLE_INSTALL)
337+ install (TARGETS osm2pgsql DESTINATION bin)
338+ install (FILES default.style empty.style DESTINATION share/osm2pgsql)
339+ endif ()
Original file line number Diff line number Diff line change 2727 message (STATUS " Manual page can not be built" )
2828endif ()
2929
30- install (FILES osm2pgsql.1 DESTINATION share/man/man1)
31-
30+ if (ENABLE_INSTALL)
31+ install (FILES osm2pgsql.1 DESTINATION share/man/man1)
32+ endif ()
You can’t perform that action at this time.
0 commit comments