update osx and ios build_framework.py

This commit is contained in:
Alexander Alekhin
2015-12-16 17:28:03 +03:00
parent 3c6aa650a1
commit be23846c4e
12 changed files with 131 additions and 206 deletions

View File

@@ -83,7 +83,6 @@ file(GLOB imgcodecs_ext_hdrs
)
if(IOS)
add_definitions(-DHAVE_IOS=1)
list(APPEND imgcodecs_srcs ${CMAKE_CURRENT_LIST_DIR}/src/ios_conversions.mm)
list(APPEND IMGCODECS_LIBRARIES "-framework Accelerate" "-framework CoreGraphics" "-framework CoreImage" "-framework QuartzCore" "-framework AssetsLibrary")
endif()

View File

@@ -1,7 +1,8 @@
# ----------------------------------------------------------------------------
# CMake file for java support
# ----------------------------------------------------------------------------
if(IOS OR WINRT OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE OR NOT (JNI_FOUND OR (ANDROID AND ANDROID_NATIVE_API_LEVEL GREATER 7))
if(APPLE_FRAMEWORK OR WINRT OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE
OR NOT (JNI_FOUND OR (ANDROID AND ANDROID_NATIVE_API_LEVEL GREATER 7))
OR BUILD_opencv_world
)
ocv_module_disable(java)

View File

@@ -9,7 +9,7 @@ if((WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
ocv_module_disable(python3)
endif()
if(ANDROID OR IOS OR WINRT)
if(ANDROID OR APPLE_FRAMEWORK OR WINRT)
ocv_module_disable(python2)
ocv_module_disable(python3)
endif()

View File

@@ -189,7 +189,6 @@ if(HAVE_GPHOTO2)
endif(HAVE_GPHOTO2)
if(IOS)
add_definitions(-DHAVE_IOS=1)
list(APPEND videoio_srcs
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_abstract_camera.mm
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_photo_camera.mm

View File

@@ -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()