From 4af62c84eb677d910248de104a35d022ca525603 Mon Sep 17 00:00:00 2001 From: Jacker Date: Sun, 20 Oct 2019 22:38:58 +0300 Subject: [PATCH] force BUNDLED values off if the feature is off --- CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ec7a27d..defbca61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,25 @@ set(LIBS_DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/downloads) #CMAKE_DEBUG_POSTFIX +# Force the BUNDLED_ to OFF if the FEATURE_ is OFF. No more unwanted stuff being built. +get_cmake_property(_variableNames VARIABLES) +list (SORT _variableNames) +foreach (_variableName ${_variableNames}) + string(REGEX MATCH "^FEATURE_.*" _featureName "${_variableName}") + string(LENGTH "${_featureName}" _variableLen) + # message(STATUS "${_variableName}=${${_variableName}}") + if(${_variableLen}) + if(NOT (${_variableName})) + string(FIND ${_variableName} "_" wsloc) + string(SUBSTRING ${_variableName} ${wsloc} -1 _featureName) + string(PREPEND _featureName "BUNDLED") + if((${_featureName})) + set(${_featureName} OFF) + endif() + endif() + endif() +endforeach() + if(WIN32) # moved for now until linux BUNDLED_OPENSSL is done