From cf8deac2b2882954f94aaeaca7638cead4500769 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Thu, 10 Jan 2013 19:05:39 +0400 Subject: [PATCH] Always touch variable controlling build of the module This suppresses "unused variable" CMake warning when user explicilty disables module unavailable in selected configuration --- cmake/OpenCVModule.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 91b65f59a..9d5ce074b 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -164,6 +164,9 @@ macro(ocv_module_disable module) set(HAVE_${__modname} OFF CACHE INTERNAL "Module ${__modname} can not be built in current configuration") set(OPENCV_MODULE_${__modname}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${__modname} module sources") set(OPENCV_MODULES_DISABLED_FORCE "${OPENCV_MODULES_DISABLED_FORCE}" CACHE INTERNAL "List of OpenCV modules which can not be build in current configuration") + if(BUILD_${__modname}) + # touch variable controlling build of the module to suppress "unused variable" CMake warning + endif() unset(__modname) return() # leave the current folder endmacro()