summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Grunder <michael.grunder@gmail.com>2019-12-05 17:06:44 -0800
committerGitHub <noreply@github.com>2019-12-05 17:06:44 -0800
commitb2d1ad64d03ea237e18f26fc294af87180b70d63 (patch)
tree00f4eb924ea656f5926374dc3b40adb67890e0f0
parentf2ef5f0c985a16c07ef610205f92864ac30c34dd (diff)
parentf052fd1adde4a106a2e06955a2b5886e9de501eb (diff)
Merge pull request #727 from pbotros/botros/disable-tests-cmake
Adding an option to DISABLE_TESTS
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e78894..fcd8d4b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,7 @@ INCLUDE(GNUInstallDirs)
PROJECT(hiredis)
OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF)
+OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF)
MACRO(getVersionBit name)
SET(VERSION_REGEX "^#define ${name} (.+)$")
@@ -76,7 +77,7 @@ IF(ENABLE_SSL)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
ENDIF()
-IF(NOT (WIN32 OR MINGW))
+IF(NOT (DISABLE_TESTS OR (WIN32 OR MINGW)))
ENABLE_TESTING()
ADD_EXECUTABLE(hiredis-test test.c)
TARGET_LINK_LIBRARIES(hiredis-test hiredis)