cmake scripts are updated to prefer includes from the OpenCV source tree

pull/13383/head
Andrey Kamaev 13 years ago
parent aeaae8b057
commit 18dbe6b3e5
  1. 3
      3rdparty/CMakeLists.txt
  2. 26
      3rdparty/ffmpeg/CMakeLists.txt
  3. 2
      3rdparty/libjasper/CMakeLists.txt
  4. 2
      3rdparty/libjpeg/CMakeLists.txt
  5. 3
      3rdparty/libpng/CMakeLists.txt
  6. 4
      3rdparty/libtiff/CMakeLists.txt
  7. 8
      3rdparty/tbb/CMakeLists.txt
  8. 2
      3rdparty/zlib/CMakeLists.txt
  9. 13
      CMakeLists.txt
  10. 2
      apps/haartraining/CMakeLists.txt
  11. 2
      apps/traincascade/CMakeLists.txt
  12. 7
      cmake/OpenCVDetectAndroidSDK.cmake
  13. 9
      cmake/OpenCVDetectPython.cmake
  14. 6
      cmake/OpenCVDetectTBB.cmake
  15. 33
      cmake/OpenCVExtraTargets.cmake
  16. 13
      cmake/OpenCVModule.cmake
  17. 14
      cmake/OpenCVUtils.cmake
  18. 4
      data/CMakeLists.txt
  19. 122
      doc/CMakeLists.txt
  20. 2
      modules/androidcamera/CMakeLists.txt
  21. 2
      modules/androidcamera/camera_wrapper/CMakeLists.txt
  22. 2
      modules/core/CMakeLists.txt
  23. 2
      modules/gpu/CMakeLists.txt
  24. 51
      modules/highgui/CMakeLists.txt
  25. 4
      modules/java/CMakeLists.txt
  26. 4
      modules/python/CMakeLists.txt
  27. 7
      samples/android/CMakeLists.txt
  28. 4
      samples/cpp/CMakeLists.txt
  29. 4
      samples/gpu/CMakeLists.txt

@ -1,3 +0,0 @@
if(WIN32)
add_subdirectory(ffmpeg)
endif()

@ -1,26 +0,0 @@
project(opencv_ffmpeg)
if(MSVC64 OR MINGW64)
set(FFMPEG_SUFFIX _64)
endif()
set(module_bare_name "opencv_ffmpeg${FFMPEG_SUFFIX}.dll")
set(module_name "${CMAKE_CURRENT_SOURCE_DIR}/${module_bare_name}")
message(STATUS "ffmpeg output dir: ${EXECUTABLE_OUTPUT_PATH}")
if(CMAKE_VERSION VERSION_GREATER "2.8.2")
add_custom_target(opencv_ffmpeg ALL
COMMAND ${CMAKE_COMMAND} -E copy "${module_name}" "${EXECUTABLE_OUTPUT_PATH}/$<CONFIGURATION>/${module_bare_name}"
COMMENT "Copying ${module_name} to the output directory")
elseif(MSVC)
add_custom_target(opencv_ffmpeg ALL
COMMAND ${CMAKE_COMMAND} -E copy "${module_name}" "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/${module_bare_name}"
COMMENT "Copying ${module_name} to the output directory")
else()
add_custom_target(opencv_ffmpeg ALL
COMMAND ${CMAKE_COMMAND} -E copy "${module_name}" "${EXECUTABLE_OUTPUT_PATH}/${module_bare_name}"
COMMENT "Copying ${module_name} to the output directory")
endif()
install(FILES ${module_name} DESTINATION bin COMPONENT main)

@ -8,7 +8,7 @@ project(${JASPER_LIBRARY})
add_definitions(-DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT) add_definitions(-DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT)
# List of C++ files: # List of C++ files:
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# The .cpp files: # The .cpp files:
file(GLOB lib_srcs *.c) file(GLOB lib_srcs *.c)

@ -6,7 +6,7 @@ project(${JPEG_LIBRARY})
# List of C++ files: # List of C++ files:
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# The .cpp files: # The .cpp files:
file(GLOB lib_srcs *.c) file(GLOB lib_srcs *.c)

@ -6,8 +6,7 @@ project(${PNG_LIBRARY})
# List of C++ files: # List of C++ files:
include_directories("${CMAKE_CURRENT_SOURCE_DIR}") ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIR})
include_directories(${ZLIB_INCLUDE_DIR})
file(GLOB lib_srcs *.c) file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h) file(GLOB lib_hdrs *.h)

@ -24,7 +24,7 @@ endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmakein" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmakein"
"${CMAKE_CURRENT_BINARY_DIR}/tif_config.h" @ONLY) "${CMAKE_CURRENT_BINARY_DIR}/tif_config.h" @ONLY)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}") ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" ${ZLIB_INCLUDE_DIR})
# List of C++ files: # List of C++ files:
set(lib_srcs set(lib_srcs
@ -101,8 +101,6 @@ if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif() endif()
include_directories(${ZLIB_INCLUDE_DIR})
add_library(${TIFF_LIBRARY} STATIC ${lib_srcs}) add_library(${TIFF_LIBRARY} STATIC ${lib_srcs})
target_link_libraries(${TIFF_LIBRARY} ${ZLIB_LIBRARIES}) target_link_libraries(${TIFF_LIBRARY} ${ZLIB_LIBRARIES})

@ -81,10 +81,10 @@ endif()
set(TBB_INCLUDE_DIRS "${tbb_src_dir}/include" PARENT_SCOPE) set(TBB_INCLUDE_DIRS "${tbb_src_dir}/include" PARENT_SCOPE)
include_directories("${tbb_src_dir}/include" ocv_include_directories("${tbb_src_dir}/include"
"${tbb_src_dir}/src/" "${tbb_src_dir}/src/"
"${tbb_src_dir}/src/rml/include" "${tbb_src_dir}/src/rml/include"
"${CMAKE_CURRENT_SOURCE_DIR}") "${CMAKE_CURRENT_SOURCE_DIR}")
file(GLOB lib_srcs "${tbb_src_dir}/src/tbb/*.cpp") file(GLOB lib_srcs "${tbb_src_dir}/src/tbb/*.cpp")
file(GLOB lib_hdrs "${tbb_src_dir}/src/tbb/*.h") file(GLOB lib_hdrs "${tbb_src_dir}/src/tbb/*.h")

@ -38,7 +38,7 @@ endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein"
"${CMAKE_CURRENT_BINARY_DIR}/zconf.h" @ONLY) "${CMAKE_CURRENT_BINARY_DIR}/zconf.h" @ONLY)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}") ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
set(ZLIB_PUBLIC_HDRS set(ZLIB_PUBLIC_HDRS
"${CMAKE_CURRENT_BINARY_DIR}/zconf.h" "${CMAKE_CURRENT_BINARY_DIR}/zconf.h"

@ -247,7 +247,7 @@ endif()
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h") set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h")
add_definitions(-DHAVE_CVCONFIG_H) add_definitions(-DHAVE_CVCONFIG_H)
include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR}) ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
@ -331,7 +331,7 @@ if(UNIX)
if(OPENGL_FOUND) if(OPENGL_FOUND)
set(HAVE_OPENGL 1) set(HAVE_OPENGL 1)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${OPENGL_LIBRARIES}) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${OPENGL_LIBRARIES})
include_directories(${OPENGL_INCLUDE_DIR}) ocv_include_directories(${OPENGL_INCLUDE_DIR})
endif() endif()
endif() endif()
endif() endif()
@ -502,7 +502,7 @@ endif()
if(IPP_FOUND) if(IPP_FOUND)
add_definitions(-DHAVE_IPP) add_definitions(-DHAVE_IPP)
include_directories(${IPP_INCLUDE_DIRS}) ocv_include_directories(${IPP_INCLUDE_DIRS})
link_directories(${IPP_LIBRARY_DIRS}) link_directories(${IPP_LIBRARY_DIRS})
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${IPP_LIBRARIES}) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${IPP_LIBRARIES})
endif() endif()
@ -538,7 +538,7 @@ if(WITH_EIGEN)
"/usr/local/include/eigen3" "/opt/include/eigen3" "/usr/include/eigen3" "/usr/local/include/eigen3" "/opt/include/eigen3" "/usr/include/eigen3"
DOC "The path to Eigen2/Eigen3 headers") DOC "The path to Eigen2/Eigen3 headers")
if(EIGEN_INCLUDE_PATH) if(EIGEN_INCLUDE_PATH)
include_directories(${EIGEN_INCLUDE_PATH}) ocv_include_directories(${EIGEN_INCLUDE_PATH})
set(HAVE_EIGEN 1) set(HAVE_EIGEN 1)
endif() endif()
endif() endif()
@ -569,7 +569,7 @@ if(WIN32)
if(OPENGL_FOUND) if(OPENGL_FOUND)
set(HAVE_OPENGL 1) set(HAVE_OPENGL 1)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${OPENGL_LIBRARIES}) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${OPENGL_LIBRARIES})
include_directories(${OPENGL_INCLUDE_DIR}) ocv_include_directories(${OPENGL_INCLUDE_DIR})
endif() endif()
endif() endif()
endif() endif()
@ -603,9 +603,6 @@ add_subdirectory(doc)
# various data that is used by cv libraries and/or demo applications. # various data that is used by cv libraries and/or demo applications.
add_subdirectory(data) add_subdirectory(data)
# 3rdparty libraries on-board
add_subdirectory(3rdparty)
# extra applications # extra applications
add_subdirectory(apps) add_subdirectory(apps)

@ -11,7 +11,7 @@ endif()
project(haartraining) project(haartraining)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv") ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_HAARTRAINING_DEPS}) ocv_include_modules(${OPENCV_HAARTRAINING_DEPS})
if(WIN32) if(WIN32)

@ -11,7 +11,7 @@ endif()
project(traincascade) project(traincascade)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv") ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${OpenCV_SOURCE_DIR}/include/opencv")
ocv_include_modules(${OPENCV_TRAINCASCADE_DEPS}) ocv_include_modules(${OPENCV_TRAINCASCADE_DEPS})
set(traincascade_files traincascade.cpp set(traincascade_files traincascade.cpp

@ -6,13 +6,14 @@ find_host_program(ANDROID_EXECUTABLE
NAMES android.bat android NAMES android.bat android
PATHS "${ANDROID_SDK_ENV_PATH}/tools/" PATHS "${ANDROID_SDK_ENV_PATH}/tools/"
"${ProgramFiles_ENV_PATH}/Android/android-sdk/tools/" "${ProgramFiles_ENV_PATH}/Android/android-sdk/tools/"
"/opt/android-sdk/tools/" "${ProgramFiles_ENV_PATH}/Android/android-sdk-windows/tools/"
"/opt/android-sdk-linux/tools/"
"/opt/android-sdk-linux_x86/tools/" "/opt/android-sdk-linux_x86/tools/"
"/opt/android-sdk-linux_86/tools/" "/opt/android-sdk-linux_86/tools/"
"/opt/android-sdk-linux/tools/" "/opt/android-sdk-mac/tools/"
"/opt/android-sdk-mac_x86/tools/" "/opt/android-sdk-mac_x86/tools/"
"/opt/android-sdk-mac_86/tools/" "/opt/android-sdk-mac_86/tools/"
"/opt/android-sdk-mac/tools/" "/opt/android-sdk/tools/"
"$ENV{HOME}/NVPACK/android-sdk-linux_x86/tools/" "$ENV{HOME}/NVPACK/android-sdk-linux_x86/tools/"
"$ENV{HOME}/NVPACK/android-sdk-linux_86/tools/" "$ENV{HOME}/NVPACK/android-sdk-linux_86/tools/"
"$ENV{HOME}/NVPACK/android-sdk-linux/tools/" "$ENV{HOME}/NVPACK/android-sdk-linux/tools/"

@ -28,10 +28,12 @@ if(PYTHON_EXECUTABLE)
set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.") set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
endif() endif()
elseif(CMAKE_HOST_WIN32) elseif(CMAKE_HOST_WIN32)
get_filename_component(PYTHON_PATH "${PYTHON_EXECUTABLE}" PATH CACHE) get_filename_component(PYTHON_PATH "${PYTHON_EXECUTABLE}" PATH)
file(TO_CMAKE_PATH "${PYTHON_PATH}" PYTHON_PATH)
if(NOT EXISTS "${PYTHON_PATH}/Lib/site-packages") if(NOT EXISTS "${PYTHON_PATH}/Lib/site-packages")
unset(PYTHON_PATH) unset(PYTHON_PATH)
get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE CACHE) get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE)
file(TO_CMAKE_PATH "${PYTHON_PATH}" PYTHON_PATH)
endif() endif()
set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages") set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages")
endif() endif()
@ -46,7 +48,8 @@ if(PYTHON_EXECUTABLE)
if(PYTHON_NUMPY_PROCESS EQUAL 0) if(PYTHON_NUMPY_PROCESS EQUAL 0)
set(PYTHON_USE_NUMPY 1) set(PYTHON_USE_NUMPY 1)
add_definitions(-DPYTHON_USE_NUMPY=1) add_definitions(-DPYTHON_USE_NUMPY=1)
include_directories(AFTER ${PYTHON_NUMPY_INCLUDE_DIRS}) file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIRS}" PYTHON_NUMPY_INCLUDE_DIRS)
ocv_include_directories(${PYTHON_NUMPY_INCLUDE_DIRS})
message(STATUS " Use NumPy headers from: ${PYTHON_NUMPY_INCLUDE_DIRS}") message(STATUS " Use NumPy headers from: ${PYTHON_NUMPY_INCLUDE_DIRS}")
endif() endif()
endif() endif()

@ -1,6 +1,6 @@
if(ANDROID) if(ANDROID)
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/tbb") add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/tbb")
include_directories(${TBB_INCLUDE_DIRS}) ocv_include_directories(${TBB_INCLUDE_DIRS})
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} tbb) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} tbb)
add_definitions(-DTBB_USE_GCC_BUILTINS=1 -D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1 -D__TBB_USE_GENERIC_DWORD_LOAD_STORE=1) add_definitions(-DTBB_USE_GCC_BUILTINS=1 -D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1 -D__TBB_USE_GENERIC_DWORD_LOAD_STORE=1)
set(HAVE_TBB 1) set(HAVE_TBB 1)
@ -10,7 +10,7 @@ elseif(UNIX AND NOT APPLE)
if(TBB_FOUND) if(TBB_FOUND)
set(HAVE_TBB 1) set(HAVE_TBB 1)
if(NOT ${TBB_INCLUDE_DIRS} STREQUAL "") if(NOT ${TBB_INCLUDE_DIRS} STREQUAL "")
include_directories(${TBB_INCLUDE_DIRS}) ocv_include_directories(${TBB_INCLUDE_DIRS})
endif() endif()
link_directories(${TBB_LIBRARY_DIRS}) link_directories(${TBB_LIBRARY_DIRS})
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${TBB_LIBRARIES}) set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${TBB_LIBRARIES})
@ -63,7 +63,7 @@ if(NOT HAVE_TBB)
set(HAVE_TBB 1) set(HAVE_TBB 1)
if(NOT "${TBB_INCLUDE_DIR}" STREQUAL "") if(NOT "${TBB_INCLUDE_DIR}" STREQUAL "")
include_directories("${TBB_INCLUDE_DIR}") ocv_include_directories("${TBB_INCLUDE_DIR}")
endif() endif()
endif(TBB_INCLUDE_DIR) endif(TBB_INCLUDE_DIR)
endif(NOT HAVE_TBB) endif(NOT HAVE_TBB)

@ -7,7 +7,10 @@ CONFIGURE_FILE(
IMMEDIATE @ONLY) IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(uninstall PROPERTIES FOLDER "CMakeTargets")
endif()
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Source package, for "make package_source" # Source package, for "make package_source"
@ -30,12 +33,15 @@ if(BUILD_PACKAGE)
COMMAND zip -9 -r ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL_NAME}.zip . -x '*/.svn/*' '*.vcproj' '*.pyc' COMMAND zip -9 -r ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL_NAME}.zip . -x '*/.svn/*' '*.vcproj' '*.pyc'
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(package_source PROPERTIES FOLDER "extra")
endif()
endif() endif()
#----------------------------------- # ----------------------------------------------------------------------------
# performance tests, for "make perf" # performance tests, for "make perf"
#----------------------------------- # ----------------------------------------------------------------------------
if(BUILD_PERF_TESTS AND PYTHON_EXECUTABLE) if(BUILD_PERF_TESTS AND PYTHON_EXECUTABLE)
if(CMAKE_VERSION VERSION_GREATER "2.8.2") if(CMAKE_VERSION VERSION_GREATER "2.8.2")
add_custom_target(perf add_custom_target(perf
@ -51,23 +57,32 @@ if(BUILD_PERF_TESTS AND PYTHON_EXECUTABLE)
) )
endif() endif()
if(ENABLE_SOLUTION_FOLDERS) if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(perf PROPERTIES FOLDER "tests performance") set_target_properties(perf PROPERTIES FOLDER "extra")
endif() endif()
endif() endif()
#-----------------------------------
# ----------------------------------------------------------------------------
# spefial targets to build all OpenCV modules
# ----------------------------------------------------------------------------
add_custom_target(opencv_modules)
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(opencv_modules PROPERTIES FOLDER "extra")
endif()
# ----------------------------------------------------------------------------
# spefial targets to build all tests # spefial targets to build all tests
#----------------------------------- # ----------------------------------------------------------------------------
if(BUILD_TESTS) if(BUILD_TESTS)
add_custom_target(opencv_tests) add_custom_target(opencv_tests)
if(ENABLE_SOLUTION_FOLDERS) if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(opencv_tests PROPERTIES FOLDER "tests accuracy") set_target_properties(opencv_tests PROPERTIES FOLDER "extra")
endif() endif()
endif() endif()
if(BUILD_PERF_TESTS) if(BUILD_PERF_TESTS)
add_custom_target(opencv_perf_tests) add_custom_target(opencv_perf_tests)
if(ENABLE_SOLUTION_FOLDERS) if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(opencv_perf_tests PROPERTIES FOLDER "tests performance") set_target_properties(opencv_perf_tests PROPERTIES FOLDER "extra")
endif() endif()
endif() endif()

@ -311,10 +311,10 @@ macro(ocv_include_modules)
foreach(d ${ARGN}) foreach(d ${ARGN})
if(d MATCHES "^opencv_" AND HAVE_${d}) if(d MATCHES "^opencv_" AND HAVE_${d})
if (EXISTS "${OPENCV_MODULE_${d}_LOCATION}/include") if (EXISTS "${OPENCV_MODULE_${d}_LOCATION}/include")
include_directories("${OPENCV_MODULE_${d}_LOCATION}/include") ocv_include_directories("${OPENCV_MODULE_${d}_LOCATION}/include")
endif() endif()
elseif(EXISTS "${d}") elseif(EXISTS "${d}")
include_directories("${d}") ocv_include_directories("${d}")
endif() endif()
endforeach() endforeach()
endmacro() endmacro()
@ -322,10 +322,10 @@ endmacro()
# setup include path for OpenCV headers for specified module # setup include path for OpenCV headers for specified module
# ocv_module_include_directories(<extra include directories/extra include modules>) # ocv_module_include_directories(<extra include directories/extra include modules>)
macro(ocv_module_include_directories) macro(ocv_module_include_directories)
include_directories("${OPENCV_MODULE_${the_module}_LOCATION}/include" ocv_include_directories("${OPENCV_MODULE_${the_module}_LOCATION}/include"
"${OPENCV_MODULE_${the_module}_LOCATION}/src" "${OPENCV_MODULE_${the_module}_LOCATION}/src"
"${CMAKE_CURRENT_BINARY_DIR}"#for precompiled headers "${CMAKE_CURRENT_BINARY_DIR}"#for precompiled headers
) )
ocv_include_modules(${OPENCV_MODULE_${the_module}_DEPS} ${ARGN}) ocv_include_modules(${OPENCV_MODULE_${the_module}_DEPS} ${ARGN})
endmacro() endmacro()
@ -378,6 +378,7 @@ endmacro()
macro(ocv_create_module) macro(ocv_create_module)
add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}) add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES})
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN}) target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
add_dependencies(opencv_modules ${the_module})
if(ENABLE_SOLUTION_FOLDERS) if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_module} PROPERTIES FOLDER "modules") set_target_properties(${the_module} PROPERTIES FOLDER "modules")

@ -11,6 +11,20 @@ if(NOT COMMAND find_host_program)
endmacro() endmacro()
endif() endif()
#added include directories in such way that directories from the OpenCV source tree go first
macro(ocv_include_directories)
set(__add_before "")
foreach(dir ${ARGN})
get_filename_component(__abs_dir "${dir}" ABSOLUTE)
if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")
list(APPEND __add_before "${dir}")
else()
include_directories(AFTER "${dir}")
endif()
endforeach()
include_directories(BEFORE ${__add_before})
endmacro()
# Provides an option that the user can optionally select. # Provides an option that the user can optionally select.
# Can accept condition to control when option is available for user. # Can accept condition to control when option is available for user.

@ -2,6 +2,6 @@ file(GLOB HAAR_CASCADES haarcascades/*.xml)
file(GLOB LBP_CASCADES lbpcascades/*.xml) file(GLOB LBP_CASCADES lbpcascades/*.xml)
if(NOT WIN32) if(NOT WIN32)
install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT main) install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT main)
install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT main) install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT main)
endif() endif()

@ -9,85 +9,51 @@ file(GLOB FILES_TEX_PICS pics/*.png pics/*.jpg)
if(BUILD_DOCS AND HAVE_SPHINX) if(BUILD_DOCS AND HAVE_SPHINX)
project(opencv_docs) project(opencv_docs)
file(GLOB_RECURSE OPENCV_FILES_REF ../modules/*.rst) file(GLOB_RECURSE OPENCV_FILES_REF ../modules/*.rst)
file(GLOB_RECURSE OPENCV_FILES_REF_PICT ../modules/*.png ../modules/*.jpg) file(GLOB_RECURSE OPENCV_FILES_REF_PICT ../modules/*.png ../modules/*.jpg)
file(GLOB_RECURSE OPENCV_FILES_UG user_guide/*.rst) file(GLOB_RECURSE OPENCV_FILES_UG user_guide/*.rst)
file(GLOB_RECURSE OPENCV_FILES_TUT tutorials/*.rst) file(GLOB_RECURSE OPENCV_FILES_TUT tutorials/*.rst)
file(GLOB_RECURSE OPENCV_FILES_TUT_PICT tutorials/*.png tutorials/*.jpg) file(GLOB_RECURSE OPENCV_FILES_TUT_PICT tutorials/*.png tutorials/*.jpg)
set(OPENCV_DOC_DEPS conf.py ${OPENCV_FILES_REF} ${OPENCV_FILES_REF_PICT} set(OPENCV_DOC_DEPS conf.py ${OPENCV_FILES_REF} ${OPENCV_FILES_REF_PICT}
${OPENCV_FILES_UG} ${OPENCV_FILES_TUT} ${OPENCV_FILES_TUT_PICT}) ${OPENCV_FILES_UG} ${OPENCV_FILES_TUT} ${OPENCV_FILES_TUT_PICT})
if (PDFLATEX_COMPILER) if(PDFLATEX_COMPILER)
add_custom_target(docs add_custom_target(docs
${SPHINX_BUILD} COMMAND ${SPHINX_BUILD} -b latex -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. .
-b latex -c ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/pics ${CMAKE_CURRENT_BINARY_DIR}/doc/opencv1/pics
${CMAKE_CURRENT_SOURCE_DIR}/.. . COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2refman.tex
${CMAKE_CURRENT_SOURCE_DIR}/pics ${CMAKE_CURRENT_BINARY_DIR}/doc/opencv1/pics COMMAND ${PDFLATEX_COMPILER} opencv2refman.tex
COMMAND ${CMAKE_COMMAND} -E copy_if_different COMMAND ${PDFLATEX_COMPILER} opencv2refman.tex
${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PDFLATEX_COMPILER} opencv_user.tex
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/patch_refman_latex.py" opencv2refman.tex COMMAND ${PDFLATEX_COMPILER} opencv_user.tex
COMMAND ${PDFLATEX_COMPILER} opencv2refman.tex COMMAND ${PDFLATEX_COMPILER} opencv_tutorials.tex
COMMAND ${PDFLATEX_COMPILER} opencv2refman.tex COMMAND ${PDFLATEX_COMPILER} opencv_tutorials.tex
COMMAND ${PDFLATEX_COMPILER} opencv_user.tex DEPENDS ${OPENCV_DOC_DEPS}
COMMAND ${PDFLATEX_COMPILER} opencv_user.tex WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${PDFLATEX_COMPILER} opencv_tutorials.tex COMMENT "Generating the PDF Manuals"
COMMAND ${PDFLATEX_COMPILER} opencv_tutorials.tex )
DEPENDS ${OPENCV_DOC_DEPS}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} if(ENABLE_SOLUTION_FOLDERS)
COMMENT "Generating the PDF Manuals") set_target_properties(docs PROPERTIES FOLDER "documentation")
endif()
endif() endif()
add_custom_target(html_docs add_custom_target(html_docs
${SPHINX_BUILD} COMMAND ${SPHINX_BUILD} -b html -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ./_html
-b html -c ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/.. ./_html DEPENDS ${OPENCV_DOC_DEPS}
COMMAND ${CMAKE_COMMAND} -E copy WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating Online Documentation"
DEPENDS ${OPENCV_DOC_DEPS} )
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating Online Documentation") if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(html_docs PROPERTIES FOLDER "documentation")
endif()
endif() endif()
install(FILES ${FILES_DOC} DESTINATION "${OPENCV_DOC_INSTALL_PATH}" COMPONENT main) install(FILES ${FILES_DOC} DESTINATION "${OPENCV_DOC_INSTALL_PATH}" COMPONENT main)
install(FILES ${FILES_DOC_VS} DESTINATION "${OPENCV_DOC_INSTALL_PATH}/vidsurv" COMPONENT main) install(FILES ${FILES_DOC_VS} DESTINATION "${OPENCV_DOC_INSTALL_PATH}/vidsurv" COMPONENT main)
########################################### Doxygen Docs #########################################
if(0)
#if(BUILD_DOXYGEN_DOCS AND DOXYGEN_FOUND)
set(DOXYGEN_LANGUAGE "English" CACHE STRING "Language used by doxygen")
mark_as_advanced(DOXYGEN_LANGUAGE)
set(CMAKE_DOXYGEN_IMAGE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pics")
set(module_names core imgproc calib3d features2d objdetect video highgui ml legacy contrib)
set(DOXYGEN_SOURCE_DIR)
set(doxy_html_dep_list)
foreach(m ${module_names})
set(module_hdr_path "${OpenCV_SOURCE_DIR}/modules/${m}/include/opencv2/${m}")
set(DOXYGEN_SOURCE_DIR ${DOXYGEN_SOURCE_DIR} ${module_hdr_path})
file(GLOB module_hdrs "${module_hdr_path}/*.h*")
set(doxy_html_dep_list ${doxy_html_dep_list} ${module_hdrs})
endforeach()
set(DOXYGEN_OUTPUT_DIR html)
string(REGEX REPLACE ";" " " CMAKE_DOXYGEN_INPUT_LIST "${DOXYGEN_SOURCE_DIR}")
configure_file(Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
set(HTML_TARGET "DOXY_HTML" )
add_custom_target(${HTML_TARGET} ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile ${doxy_html_dep_list})
exec_program(mkdir ARGS "-p \"${CMAKE_CURRENT_BINARY_DIR}/html/\"")
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" DESTINATION "${OPENCV_DOC_INSTALL_PATH}/html" COMPONENT main)
endif()

@ -6,7 +6,7 @@ set(the_description "Auxiliary module for Android native camera support")
set(OPENCV_MODULE_TYPE STATIC) set(OPENCV_MODULE_TYPE STATIC)
ocv_define_module(androidcamera INTERNAL log dl) ocv_define_module(androidcamera INTERNAL log dl)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/camera_wrapper") ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/camera_wrapper")
# Android source tree for native camera # Android source tree for native camera
SET (ANDROID_SOURCE_TREE "ANDROID_SOURCE_TREE-NOTFOUND" CACHE PATH SET (ANDROID_SOURCE_TREE "ANDROID_SOURCE_TREE-NOTFOUND" CACHE PATH

@ -4,7 +4,7 @@ project(${the_target})
link_directories("${ANDROID_SOURCE_TREE}/out/target/product/generic/system/lib") link_directories("${ANDROID_SOURCE_TREE}/out/target/product/generic/system/lib")
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(BEFORE
${ANDROID_SOURCE_TREE} ${ANDROID_SOURCE_TREE}
${ANDROID_SOURCE_TREE}/frameworks/base/include/ui ${ANDROID_SOURCE_TREE}/frameworks/base/include/ui
${ANDROID_SOURCE_TREE}/frameworks/base/include/surfaceflinger ${ANDROID_SOURCE_TREE}/frameworks/base/include/surfaceflinger

@ -6,7 +6,7 @@ if(HAVE_CUDA)
file(GLOB lib_cuda "src/cuda/*.cu") file(GLOB lib_cuda "src/cuda/*.cu")
source_group("Cuda" FILES "${lib_cuda}") source_group("Cuda" FILES "${lib_cuda}")
include_directories(${CUDA_INCLUDE_DIRS} "${OpenCV_SOURCE_DIR}/modules/gpu/src" "${OpenCV_SOURCE_DIR}/modules/gpu/src/cuda") ocv_include_directories(${CUDA_INCLUDE_DIRS} "${OpenCV_SOURCE_DIR}/modules/gpu/src" "${OpenCV_SOURCE_DIR}/modules/gpu/src/cuda")
OCV_CUDA_COMPILE(cuda_objs ${lib_cuda}) OCV_CUDA_COMPILE(cuda_objs ${lib_cuda})
set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})

@ -28,7 +28,7 @@ if (HAVE_CUDA)
set(ncv_files ${ncv_srcs} ${ncv_hdrs} ${ncv_cuda}) set(ncv_files ${ncv_srcs} ${ncv_hdrs} ${ncv_cuda})
source_group("Src\\NVidia" FILES ${ncv_files}) source_group("Src\\NVidia" FILES ${ncv_files})
include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS}) ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS})
#set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-keep") #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-keep")
#set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;") #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;")

@ -10,38 +10,38 @@ ocv_add_module(highgui opencv_imgproc OPTIONAL opencv_androidcamera)
set(GRFMT_LIBS "") set(GRFMT_LIBS "")
if(WITH_PNG OR WITH_TIFF OR WITH_OPENEXR) if(WITH_PNG OR WITH_TIFF OR WITH_OPENEXR)
include_directories(${ZLIB_INCLUDE_DIR}) ocv_include_directories(${ZLIB_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${ZLIB_LIBRARIES}) set(GRFMT_LIBS ${GRFMT_LIBS} ${ZLIB_LIBRARIES})
endif() endif()
if(WITH_JPEG) if(WITH_JPEG)
add_definitions(-DHAVE_JPEG) add_definitions(-DHAVE_JPEG)
include_directories(${JPEG_INCLUDE_DIR}) ocv_include_directories(${JPEG_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${JPEG_LIBRARIES}) set(GRFMT_LIBS ${GRFMT_LIBS} ${JPEG_LIBRARIES})
endif() endif()
if(WITH_PNG) if(WITH_PNG)
add_definitions(-DHAVE_PNG) add_definitions(-DHAVE_PNG)
add_definitions(${PNG_DEFINITIONS}) add_definitions(${PNG_DEFINITIONS})
include_directories(${PNG_INCLUDE_DIR}) ocv_include_directories(${PNG_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${PNG_LIBRARIES}) set(GRFMT_LIBS ${GRFMT_LIBS} ${PNG_LIBRARIES})
endif() endif()
if(WITH_TIFF) if(WITH_TIFF)
add_definitions(-DHAVE_TIFF) add_definitions(-DHAVE_TIFF)
include_directories(${TIFF_INCLUDE_DIR}) ocv_include_directories(${TIFF_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${TIFF_LIBRARIES}) set(GRFMT_LIBS ${GRFMT_LIBS} ${TIFF_LIBRARIES})
endif() endif()
if(WITH_JASPER) if(WITH_JASPER)
add_definitions(-DHAVE_JASPER) add_definitions(-DHAVE_JASPER)
include_directories(${JASPER_INCLUDE_DIR}) ocv_include_directories(${JASPER_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${JASPER_LIBRARIES}) set(GRFMT_LIBS ${GRFMT_LIBS} ${JASPER_LIBRARIES})
endif() endif()
if(WITH_OPENEXR AND OPENEXR_FOUND) if(WITH_OPENEXR AND OPENEXR_FOUND)
add_definitions(-DHAVE_OPENEXR) add_definitions(-DHAVE_OPENEXR)
include_directories(${OPENEXR_INCLUDE_PATHS}) ocv_include_directories(${OPENEXR_INCLUDE_PATHS})
set(GRFMT_LIBS ${GRFMT_LIBS} ${OPENEXR_LIBRARIES}) set(GRFMT_LIBS ${GRFMT_LIBS} ${OPENEXR_LIBRARIES})
endif() endif()
@ -139,7 +139,7 @@ if(UNIX)
endif() endif()
foreach(P ${HIGHGUI_INCLUDE_DIRS}) foreach(P ${HIGHGUI_INCLUDE_DIRS})
include_directories(${P}) ocv_include_directories(${P})
endforeach() endforeach()
foreach(P ${HIGHGUI_LIBRARY_DIRS}) foreach(P ${HIGHGUI_LIBRARY_DIRS})
@ -150,7 +150,7 @@ endif()
#OpenNI #OpenNI
if(WITH_OPENNI AND HAVE_OPENNI) if(WITH_OPENNI AND HAVE_OPENNI)
set(highgui_srcs ${highgui_srcs} src/cap_openni.cpp) set(highgui_srcs ${highgui_srcs} src/cap_openni.cpp)
include_directories(${OPENNI_INCLUDE_DIR}) ocv_include_directories(${OPENNI_INCLUDE_DIR})
endif() endif()
#YV #YV
@ -192,7 +192,7 @@ endif()
if(HAVE_XIMEA AND XIMEA_FOUND) if(HAVE_XIMEA AND XIMEA_FOUND)
set(highgui_srcs ${highgui_srcs} src/cap_ximea.cpp) set(highgui_srcs ${highgui_srcs} src/cap_ximea.cpp)
include_directories(${XIMEA_PATH}) ocv_include_directories(${XIMEA_PATH})
link_directories(${XIMEA_LIBRARY_DIR}) link_directories(${XIMEA_LIBRARY_DIR})
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} m3api) set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} m3api)
set(highgui_srcs ${highgui_srcs} src/cap_ximea.cpp) set(highgui_srcs ${highgui_srcs} src/cap_ximea.cpp)
@ -221,7 +221,7 @@ endif()
if(WIN32) if(WIN32)
link_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/lib") link_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/lib")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/include")#for directshow include_directories(AFTER "${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/include") #for directshow
endif() endif()
source_group("Src" FILES ${highgui_srcs} ${highgui_hdrs}) source_group("Src" FILES ${highgui_srcs} ${highgui_hdrs})
@ -245,5 +245,36 @@ set_target_properties(${the_module} PROPERTIES LINK_INTERFACE_LIBRARIES "")
ocv_add_precompiled_headers(${the_module}) ocv_add_precompiled_headers(${the_module})
if(WIN32)
#copy ffmpeg dll to the output folder
if(MSVC64 OR MINGW64)
set(FFMPEG_SUFFIX _64)
endif()
set(ffmpeg_bare_name "opencv_ffmpeg${FFMPEG_SUFFIX}.dll")
set(ffmpeg_path "${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/${ffmpeg_bare_name}")
if(CMAKE_VERSION VERSION_GREATER "2.8.2")
add_custom_command(TARGET ${the_module} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/$<CONFIGURATION>/${ffmpeg_bare_name}"
COMMENT "Copying ${ffmpeg_path} to the output directory")
elseif(MSVC_IDE)
add_custom_command(TARGET ${the_module} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Release/${ffmpeg_bare_name}"
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Debug/${ffmpeg_bare_name}"
COMMENT "Copying ${ffmpeg_path} to the output directory")
elseif(MSVC)
add_custom_command(TARGET ${the_module} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/${ffmpeg_bare_name}"
COMMENT "Copying ${ffmpeg_path} to the output directory")
else()
add_custom_command(TARGET ${the_module} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${ffmpeg_bare_name}"
COMMENT "Copying ${ffmpeg_path} to the output directory")
endif()
install(FILES "${ffmpeg_path}" DESTINATION bin COMPONENT main)
endif()
ocv_add_accuracy_tests() ocv_add_accuracy_tests()
ocv_add_perf_tests() ocv_add_perf_tests()

@ -19,7 +19,7 @@ foreach(module ${OPENCV_JAVA_MODULES})
endforeach() endforeach()
set(target ${the_module}) set(target ${the_module})
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp") ocv_include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp")
set(GEN_JAVA "${CMAKE_CURRENT_SOURCE_DIR}/gen_java.py") set(GEN_JAVA "${CMAKE_CURRENT_SOURCE_DIR}/gen_java.py")
set(HDR_PARSER "${CMAKE_CURRENT_SOURCE_DIR}/../python/src2/hdr_parser.py") set(HDR_PARSER "${CMAKE_CURRENT_SOURCE_DIR}/../python/src2/hdr_parser.py")
@ -105,7 +105,7 @@ endforeach()
# all needed includes # all needed includes
foreach(module ${OPENCV_MODULE_${the_module}_DEPS}) foreach(module ${OPENCV_MODULE_${the_module}_DEPS})
string(REPLACE "opencv_" "" module "${module}") string(REPLACE "opencv_" "" module "${module}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../${module}/include") ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../${module}/include")
endforeach() endforeach()
# created list of documented files targets # created list of documented files targets

@ -12,8 +12,8 @@ endif()
set(the_description "The python bindings") set(the_description "The python bindings")
ocv_add_module(python BINDINGS opencv_core opencv_flann opencv_imgproc opencv_video opencv_ml opencv_features2d opencv_highgui opencv_calib3d opencv_objdetect opencv_legacy opencv_contrib) ocv_add_module(python BINDINGS opencv_core opencv_flann opencv_imgproc opencv_video opencv_ml opencv_features2d opencv_highgui opencv_calib3d opencv_objdetect opencv_legacy opencv_contrib)
include_directories(${PYTHON_INCLUDE_PATH}) ocv_include_directories(${PYTHON_INCLUDE_PATH})
include_directories( ocv_include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}/src2" "${CMAKE_CURRENT_SOURCE_DIR}/src2"
"${OpenCV_SOURCE_DIR}/modules/core/include" "${OpenCV_SOURCE_DIR}/modules/core/include"
"${OpenCV_SOURCE_DIR}/modules/flann/include" "${OpenCV_SOURCE_DIR}/modules/flann/include"

@ -9,11 +9,8 @@ ocv_check_dependencies(${OPENCV_ANDROID_SAMPLES_REQUIRED_DEPS} opencv_java)
if(BUILD_ANDROID_EXAMPLES AND OCV_DEPENDENCIES_FOUND) if(BUILD_ANDROID_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
project(android_samples) project(android_samples)
foreach(m ${OPENCV_ANDROID_SAMPLES_REQUIRED_DEPS}) ocv_include_modules(${OPENCV_ANDROID_SAMPLES_REQUIRED_DEPS})
string(REPLACE "opencv_" "" m "${m}")
include_directories("${OpenCV_SOURCE_DIR}/modules/${m}/include")
endforeach()
file(GLOB android_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *) file(GLOB android_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
list(REMOVE_ITEM android_samples hello-android) list(REMOVE_ITEM android_samples hello-android)
list(SORT android_samples) list(SORT android_samples)

@ -12,11 +12,11 @@ ocv_check_dependencies(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
project(cpp_samples) project(cpp_samples)
include_directories("${OpenCV_SOURCE_DIR}/include")#for opencv.hpp ocv_include_directories("${OpenCV_SOURCE_DIR}/include")#for opencv.hpp
ocv_include_modules(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS}) ocv_include_modules(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
if (HAVE_opencv_gpu) if (HAVE_opencv_gpu)
include_directories("${OpenCV_SOURCE_DIR}/modules/gpu/include") ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpu/include")
endif() endif()
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)

@ -11,13 +11,13 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
project("${project}_samples") project("${project}_samples")
ocv_include_modules(${OPENCV_GPU_SAMPLES_REQUIRED_DEPS}) ocv_include_modules(${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})
include_directories( ocv_include_directories(
"${OpenCV_SOURCE_DIR}/modules/gpu/src/nvidia" "${OpenCV_SOURCE_DIR}/modules/gpu/src/nvidia"
"${OpenCV_SOURCE_DIR}/modules/gpu/src/nvidia/core" "${OpenCV_SOURCE_DIR}/modules/gpu/src/nvidia/core"
) )
if(HAVE_CUDA) if(HAVE_CUDA)
include_directories(${CUDA_INCLUDE_DIRS}) ocv_include_directories(${CUDA_INCLUDE_DIRS})
endif() endif()
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)

Loading…
Cancel
Save