diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d0455d..c0252a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,11 +34,13 @@ endif () # Options # ]==============================================================================================] +include(CMakeDependentOption) + option(JSON_VALIDATOR_INSTALL "JsonValidator: Install targets" ${PROJECT_IS_TOP_LEVEL}) option(JSON_VALIDATOR_BUILD_TESTS "JsonValidator: Build tests" ${PROJECT_IS_TOP_LEVEL}) option(JSON_VALIDATOR_BUILD_EXAMPLES "JsonValidator: Build examples" ${PROJECT_IS_TOP_LEVEL}) option(JSON_VALIDATOR_SHARED_LIBS "JsonValidator: Build as shared library" ${PROJECT_IS_TOP_LEVEL}) -option(JSON_VALIDATOR_TEST_COVERAGE "JsonValidator: Build with test coverage" OFF) +cmake_dependent_option(JSON_VALIDATOR_TEST_COVERAGE "JsonValidator: Build with test coverage" OFF "JSON_VALIDATOR_BUILD_TESTS" OFF) mark_as_advanced(JSON_VALIDATOR_TEST_COVERAGE) # Get a default JSON_FETCH_VERSION from environment variables to workaround the CI if (DEFINED ENV{NLOHMANN_JSON_VERSION})