Skip to content

Commit 0d00923

Browse files
committed
add generate uninstall
1 parent 32adf14 commit 0d00923

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

CMakeLists.txt

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ if (${NEED_DOWNLOAD_C_DRIVER})
7272
include(FetchContent)
7373
include(ExternalProject)
7474

75-
set(ENABLE_UNINSTALL OFF)
76-
7775
# Declare mongo-c-driver as a dependency
7876
FetchContent_Declare(
7977
mongo-c-driver
@@ -142,7 +140,7 @@ option(BUILD_SHARED_LIBS_WITH_STATIC_MONGOC
142140
OFF
143141
)
144142

145-
option (ENABLE_UNINSTALL "Enable creation of uninstall script and associated uninstall build target." OFF)
143+
option (ENABLE_UNINSTALL "Enable creation of uninstall script and associated uninstall build target." ON)
146144

147145
# Allow the user to enable code coverage
148146
option (ENABLE_CODE_COVERAGE "Enable code coverage." OFF)
@@ -411,20 +409,20 @@ if(NOT (TARGET bson_shared OR TARGET mongoc_shared))
411409
)
412410
endif()
413411

414-
# if(ENABLE_UNINSTALL AND NOT (TARGET bson_shared OR TARGET mongoc_shared))
415-
# if(WIN32)
416-
# set(UNINSTALL_PROG "uninstall.cmd")
417-
# else()
418-
# set(UNINSTALL_PROG "uninstall.sh")
419-
# endif()
420-
# set(UNINSTALL_PROG_DIR "${CMAKE_INSTALL_DATADIR}/mongo-cxx-driver")
421-
#
422-
# # Create uninstall program and associated uninstall target
423-
# #
424-
# # This needs to be last (after all other add_subdirectory calls) to ensure
425-
# # that the generated uninstall program is complete and correct
426-
# add_subdirectory(generate_uninstall)
427-
# endif()
412+
if(ENABLE_UNINSTALL AND NOT (TARGET bson_shared OR TARGET mongoc_shared))
413+
if(WIN32)
414+
set(UNINSTALL_PROG "uninstall.cmd")
415+
else()
416+
set(UNINSTALL_PROG "uninstall.sh")
417+
endif()
418+
set(UNINSTALL_PROG_DIR "${CMAKE_INSTALL_DATADIR}/mongo-cxx-driver")
419+
420+
# Create uninstall program and associated uninstall target
421+
#
422+
# This needs to be last (after all other add_subdirectory calls) to ensure
423+
# that the generated uninstall program is complete and correct
424+
add_subdirectory(generate_uninstall)
425+
endif()
428426

429427
# Spit out some information regarding the generated build system
430428
message (STATUS "Build files generated for:")

0 commit comments

Comments
 (0)