return when OpenCV is found
authorVincent Rabaud <vrabaud@aldebaran-robotics.com>
Wed, 13 Nov 2013 13:20:09 +0000 (14:20 +0100)
committerVincent Rabaud <vrabaud@aldebaran-robotics.com>
Wed, 13 Nov 2013 13:20:09 +0000 (14:20 +0100)
cmake/templates/OpenCVConfig.cmake.in

index 094cbd4..5d56351 100644 (file)
 #
 # ===================================================================================
 
+if(OpenCV_FOUND)
+  return()
+endif()
+set(OpenCV_FOUND TRUE)
+
 set(modules_file_suffix "")
 if(ANDROID)
   string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}")
 endif()
 
-if(NOT OpenCV_FOUND)
-  include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
-  set(OpenCV_FOUND TRUE)
-endif()
+include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
 
 # TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)