Merge pull request #3721 from nitsch:fix-cmake-current-list-dir

This commit is contained in:
Alexander Smorkalov 2015-02-21 16:49:36 +00:00
commit dcc569ee5c

View File

@ -46,6 +46,13 @@ if(NOT DEFINED OpenCV_MODULES_SUFFIX)
endif()
if(NOT TARGET opencv_core)
# Extract directory name from full path of the file currently being processed.
# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it
# for older versions of CMake to support these as well.
if(CMAKE_VERSION VERSION_LESS "2.8.3")
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake)
endif()