@@ -72,8 +72,6 @@ if (${NEED_DOWNLOAD_C_DRIVER})
72
72
include (FetchContent )
73
73
include (ExternalProject )
74
74
75
- set (ENABLE_UNINSTALL OFF )
76
-
77
75
# Declare mongo-c-driver as a dependency
78
76
FetchContent_Declare (
79
77
mongo-c-driver
@@ -142,7 +140,7 @@ option(BUILD_SHARED_LIBS_WITH_STATIC_MONGOC
142
140
OFF
143
141
)
144
142
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 )
146
144
147
145
# Allow the user to enable code coverage
148
146
option (ENABLE_CODE_COVERAGE "Enable code coverage." OFF )
@@ -411,20 +409,20 @@ if(NOT (TARGET bson_shared OR TARGET mongoc_shared))
411
409
)
412
410
endif ()
413
411
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 ()
428
426
429
427
# Spit out some information regarding the generated build system
430
428
message (STATUS "Build files generated for:" )
0 commit comments