Skip to content

Commit ff7a064

Browse files
yann-morin-1998michael-grunder
authored andcommitted
CMakeList: add option to not install NuGet packaging
The NuGet hiredis.target packaging description file is of no use on systems that are not using NuGet, like Linux systems, and the spurious presence of that file is not "clean". Add a cmake option to allow users to disable installation of that file. As some people may have relied on that file to be installed, continue to install it by default. Signed-off-by: Yann E. MORIN <[email protected]>
1 parent 94d931d commit ff7a064

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF)
66
OPTION(ENABLE_SSL_TESTS "Should we test SSL connections" OFF)
77
OPTION(ENABLE_EXAMPLES "Enable building hiredis examples" OFF)
88
OPTION(ENABLE_ASYNC_TESTS "Should we run all asynchronous API tests" OFF)
9+
# Historically, the NuGet file was always install; default
10+
# to ON for those who rely on that historical behaviour.
11+
OPTION(ENABLE_NUGET "Install NuGET packaging details" ON)
912

1013
MACRO(getVersionBit name)
1114
SET(VERSION_REGEX "^#define ${name} (.+)$")
@@ -105,9 +108,11 @@ if (MSVC AND BUILD_SHARED_LIBS)
105108
CONFIGURATIONS Debug RelWithDebInfo)
106109
endif()
107110

108-
# For NuGet packages
109-
INSTALL(FILES hiredis.targets
110-
DESTINATION build/native)
111+
if (ENABLE_NUGET)
112+
# For NuGet packages
113+
INSTALL(FILES hiredis.targets
114+
DESTINATION build/native)
115+
endif()
111116

112117
INSTALL(FILES hiredis.h read.h sds.h async.h alloc.h sockcompat.h
113118
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)

0 commit comments

Comments
 (0)