From fd32708f5fea36e5c4e5ff0491e7eb81b7b026f0 Mon Sep 17 00:00:00 2001
From: Guilherme Amadio <amadio@cern.ch>
Date: Thu, 20 Jun 2019 15:42:33 +0200
Subject: [PATCH] Do not disable tmva when -Dmlp=OFF, but fail to configure

CMake options specified on the command line should not change their
value during configuration. Only default values are allowed to change
(i.e. ${option}_defvalue not ${option}). See ROOT-9385 for more info.
---
 cmake/modules/SearchInstalledSoftware.cmake | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
index 018e49f3eeb..8a40e1266c9 100644
--- a/cmake/modules/SearchInstalledSoftware.cmake
+++ b/cmake/modules/SearchInstalledSoftware.cmake
@@ -1384,8 +1384,7 @@ endif()
 
 #---TMVA and its dependencies------------------------------------------------------------
 if (tmva AND NOT mlp)
-  message(STATUS "TMVA is enabled while MLP is not: disabling TMVA")
-  set(tmva OFF CACHE BOOL "Disabled because mlp was not activated" FORCE)
+  message(FATAL_ERROR "The 'tmva' option requires 'mlp', please enable mlp with -Dmlp=ON")
 endif()
 
 if(tmva)
-- 
GitLab