deepin-ocr/3rdparty/opencv-4.5.4/modules/objc/test/cmakelists.template
wangzhengyang 718c41634f feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试
2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程
3.重整权利声明文件,重整代码工程,确保最小化侵权风险

Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake
Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
2022-05-10 10:22:11 +08:00

47 lines
1.7 KiB
Plaintext

cmake_minimum_required(VERSION 3.15)
project(OpenCVTest)
enable_testing()
find_package(XCTest REQUIRED)
# Enable C++11
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
set (OBJC_COMPILE_FLAGS "-fobjc-arc -fobjc-weak -fvisibility=hidden")
set (SUPPRESS_WARNINGS_FLAGS "-Wno-incomplete-umbrella")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OBJC_COMPILE_FLAGS} ${SUPPRESS_WARNINGS_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OBJC_ARC_COMPILE_FLAGS} ${SUPPRESS_WARNINGS_FLAGS}")
# grab the files
file(GLOB_RECURSE test_sources "test/*\.h" "test/*\.m" "test/*\.mm" "test/*\.swift")
add_library(OpenCVTest STATIC dummy/dummy.mm)
enable_language(Swift)
# XCTest for Framework
xctest_add_bundle(OpenCVTestTests OpenCVTest ${test_sources} test/resources ${FRAMEWORK_DIR}/${FRAMEWORK_NAME}.framework)
set_target_properties(OpenCVTestTests PROPERTIES
XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS "${FRAMEWORK_DIR}"
XCODE_ATTRIBUTE_OTHER_SWIFT_FLAGS "-Xcc ${SUPPRESS_WARNINGS_FLAGS}"
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "${FRAMEWORK_DIR}"
)
# link necessary Frameworks
target_link_libraries(OpenCVTestTests PRIVATE "-framework Accelerate")
target_link_libraries(OpenCVTestTests PRIVATE "-framework AVFoundation")
target_link_libraries(OpenCVTestTests PRIVATE "-framework CoreMedia")
if (NOT DEFINED IOS_ARCH)
target_link_libraries(OpenCVTestTests PRIVATE "-framework OpenCL")
endif()
# its OK to ignore stuff we don't know about since there will be no tests relying on it
set_target_properties(OpenCVTestTests PROPERTIES LINK_FLAGS -Wl,-undefined,dynamic_lookup)
set_source_files_properties(test/resources PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
xctest_add_test(XCTest.OpenCVTest OpenCVTestTests)