Always touch variable controlling build of the module
authorAndrey Kamaev <andrey.kamaev@itseez.com>
Thu, 10 Jan 2013 15:05:39 +0000 (19:05 +0400)
committerAndrey Kamaev <andrey.kamaev@itseez.com>
Thu, 10 Jan 2013 15:05:39 +0000 (19:05 +0400)
This suppresses "unused variable" CMake warning when user explicilty disables
module unavailable in selected configuration

cmake/OpenCVModule.cmake

index 91b65f59aad65504ac4f9c9444431f0f480067b2..9d5ce074b6e44db21b35d8bc17a9d001c6be5106 100644 (file)
@@ -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()