diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index f92f5ea68..94907575d 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -27,7 +27,10 @@ set(videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_ffmpeg.cpp ) -file(GLOB videoio_ext_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h") +file(GLOB videoio_ext_hdrs + "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp" + "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp" + "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h") if(WIN32 AND NOT ARM) list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_cmu.cpp) diff --git a/modules/world/CMakeLists.txt b/modules/world/CMakeLists.txt index 4e05188e0..d2f5cb168 100644 --- a/modules/world/CMakeLists.txt +++ b/modules/world/CMakeLists.txt @@ -53,3 +53,26 @@ endif() if(BUILD_opencv_highgui) ocv_highgui_configure_target() endif() + +if(IOS OR APPLE) + set(merge_libs "") + macro(ios_include_3party_libs) + foreach(l ${ARGN}) + add_dependencies(${the_module} ${l}) + list(APPEND merge_libs "$") + endforeach() + endmacro() + + if(WITH_PNG) + ios_include_3party_libs(zlib libpng) + endif() + + if(WITH_JPEG) + ios_include_3party_libs(libjpeg) + endif() + + add_custom_command(TARGET ${the_module} POST_BUILD + COMMAND /usr/bin/libtool -static -o ${CMAKE_CURRENT_BINARY_DIR}/${the_module}_fat.a $ ${merge_libs} + COMMAND mv ${CMAKE_CURRENT_BINARY_DIR}/${the_module}_fat.a $ + ) +endif()