mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
update osx and ios build_framework.py
This commit is contained in:
@@ -2,7 +2,7 @@ set(the_description "All the selected OpenCV modules in a single binary")
|
||||
set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
|
||||
set(BUILD_opencv_world_INIT OFF)
|
||||
|
||||
if(IOS OR NOT BUILD_SHARED_LIBS)
|
||||
if(APPLE_FRAMEWORK OR NOT BUILD_SHARED_LIBS)
|
||||
set(OPENCV_MODULE_TYPE STATIC)
|
||||
set(OPENCV_WORLD_FLAGS_PROPERTY STATIC_LIBRARY_FLAGS)
|
||||
else()
|
||||
@@ -59,26 +59,3 @@ endif()
|
||||
if(BUILD_opencv_highgui AND OPENCV_MODULE_opencv_highgui_IS_PART_OF_WORLD)
|
||||
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 "$<TARGET_LINKER_FILE:${l}>")
|
||||
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 $<TARGET_LINKER_FILE:${the_module}> ${merge_libs}
|
||||
COMMAND mv ${CMAKE_CURRENT_BINARY_DIR}/${the_module}_fat.a $<TARGET_LINKER_FILE:${the_module}>
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user