diff --git a/.travis.yml b/.travis.yml index 94e6a315..80fb52c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ jobs: - ../configure - make - rm -rf * - - cmake .. + - cmake -DWITH_TESTS=NO .. - make - name: "CMake Build" diff --git a/CMakeLists.txt b/CMakeLists.txt index d3dc4487..36c02560 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,8 @@ option(WITH_GNUTLS "Whether to use GnuTLS (default is auto detect)" ON) # option(WITH_MBEDTLS "Enable using MBedTLS (default is disabled)" ON) +option(WITH_TESTS "Whether to build and run the testsuite (default is ON)" ON) + # Need at least one of these if (WITH_GNUTLS) if (NOT GNUTLS_AUTO) @@ -51,9 +53,6 @@ if (WITH_OPENSSL) pkg_check_modules(OPENSSL openssl>=1.1.0 ${OPENSSL_REQUIRED}) endif() -# Tests and coverage depend on this, but optional -pkg_check_modules(CHECK check>=0.9.10 IMPORTED_TARGET) - add_library(jwt SHARED) add_library(jwt_static STATIC) set_target_properties(jwt_static PROPERTIES OUTPUT_NAME jwt) @@ -183,6 +182,11 @@ endif() option(ENABLE_COVERAGE "Enable code coverage rules" OFF) +# Tests and coverage depend on this, but optional +if (WITH_TESTS) + pkg_check_modules(CHECK check>=0.9.10 IMPORTED_TARGET) +endif() + if (CHECK_FOUND) include(CTest)