Skip to content

Commit a22977e

Browse files
authored
Restrict the build of gmt_update to Windows only. (#9120)
Apply the patch use in the Debion build (see #9116)
1 parent 23cf733 commit a22977e

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

‎src/CMakeLists.txt‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -603,16 +603,19 @@ target_link_libraries (gshhg_version ${NETCDF_LIBRARIES})
603603
# script2verbatim for removing comments, replacing -ps from example scripts
604604
add_executable (script2verbatim script2verbatim.c)
605605

606-
# gmt_update — standalone binary updater. Deliberately does NOT link against
607-
# libgmt/pslib so that those DLLs are NOT held open by this process and can be
608-
# replaced on Windows. Uses only libcurl + an embedded public-domain SHA-256.
609-
add_executable (gmt_update gmt_update.c sha256.c)
610-
target_include_directories (gmt_update PRIVATE ${CURL_INCLUDE_DIRS})
611-
target_link_libraries (gmt_update ${CURL_LIBRARIES})
612-
if (WIN32)
613-
target_link_libraries (gmt_update rstrtmgr)
614-
endif (WIN32)
615-
install (TARGETS gmt_update RUNTIME DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
606+
option(WITH_GMT_UPDATE "Build and install gmt_update executable" ON)
607+
if (WITH_GMT_UPDATE)
608+
# gmt_update — standalone binary updater. Deliberately does NOT link against
609+
# libgmt/pslib so that those DLLs are NOT held open by this process and can be
610+
# replaced on Windows. Uses only libcurl + an embedded public-domain SHA-256.
611+
add_executable (gmt_update gmt_update.c sha256.c)
612+
target_include_directories (gmt_update PRIVATE ${CURL_INCLUDE_DIRS})
613+
target_link_libraries (gmt_update ${CURL_LIBRARIES})
614+
if (WIN32)
615+
target_link_libraries (gmt_update rstrtmgr)
616+
endif (WIN32)
617+
install (TARGETS gmt_update RUNTIME DESTINATION ${GMT_BINDIR} COMPONENT Runtime)
618+
endif()
616619

617620

618621
##

0 commit comments

Comments
 (0)