mirror of
https://github.com/opencv/opencv.git
synced 2024-12-04 16:59:12 +08:00
912592de4c
The INSTALL_NAME_DIR property of a target specifies how a dynamic library should be found on OS X. If INSTALL_NAME_DIR is not specified the loader will search relative to the standard search paths. If specified it should either be an absolute path or relative path prefixed with either @executable_path, @load_path, or @rpath. Specifying "lib" does not make sense here and causes linking error as documented here: http://answers.opencv.org/question/4134/cmake-install_name_tool-absolute-path-for-library-on-mac-osx/ and here http://stackoverflow.com/questions/26978806/dyld-library-not-loaded-lib-libopencv-core-3-0-dylib-reason-image-not-found This patch removes INSTALL_NAME_DIR everywhere it is set to "lib". An alternate solution would be to set an absolute path like "${CMAKE_INSTALL_PREFIX}/lib" or relative path like "@executable_path/../lib". However, if there is not specific need for specifying a path, it is probably best left unset.
41 lines
1.2 KiB
CMake
41 lines
1.2 KiB
CMake
project(libopencv_info)
|
|
if(NOT ANDROID_PACKAGE_RELEASE)
|
|
set(ANDROID_PACKAGE_RELEASE 1)
|
|
endif()
|
|
|
|
if(NOT ANDROID_PACKAGE_PLATFORM)
|
|
if(ARMEABI_V7A)
|
|
if(NEON)
|
|
set(ANDROID_PACKAGE_PLATFORM armv7a_neon)
|
|
else()
|
|
set(ANDROID_PACKAGE_PLATFORM armv7a)
|
|
endif()
|
|
elseif(ARM64_V8A)
|
|
set(ANDROID_PACKAGE_PLATFORM aarch64)
|
|
elseif(ARMEABI_V6)
|
|
set(ANDROID_PACKAGE_PLATFORM armv6)
|
|
elseif(ARMEABI)
|
|
set(ANDROID_PACKAGE_PLATFORM armv5)
|
|
elseif(X86)
|
|
set(ANDROID_PACKAGE_PLATFORM x86)
|
|
elseif(MIPS)
|
|
set(ANDROID_PACKAGE_PLATFORM mips)
|
|
else()
|
|
message(ERROR "Can not automatically determine the value for ANDROID_PACKAGE_PLATFORM")
|
|
endif()
|
|
endif()
|
|
|
|
add_definitions(-DANDROID_PACKAGE_RELEASE=${ANDROID_PACKAGE_RELEASE} -DANDROID_PACKAGE_PLATFORM="${ANDROID_PACKAGE_PLATFORM}")
|
|
|
|
include_directories(jni/BinderComponent jni/include "${OpenCV_SOURCE_DIR}/modules/core/include")
|
|
|
|
add_library(opencv_info SHARED info.c)
|
|
|
|
set_target_properties(${the_module} PROPERTIES
|
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
|
)
|
|
|
|
get_filename_component(lib_name "libopencv_info.so" NAME)
|
|
install(FILES "${LIBRARY_OUTPUT_PATH}/${lib_name}" DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs)
|