mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 12:40:05 +08:00
cmake: Enable pkgconfig support for mingw
This commit is contained in:
parent
925ff6241f
commit
7e5d012f75
@ -641,7 +641,7 @@ ocv_cmake_hook(POST_COMPILER_OPTIONS)
|
||||
# ----------------------------------------------------------------------------
|
||||
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
|
||||
# ----------------------------------------------------------------------------
|
||||
if(UNIX)
|
||||
if(UNIX OR MINGW)
|
||||
if(NOT APPLE_FRAMEWORK OR OPENCV_ENABLE_PKG_CONFIG)
|
||||
if(CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{PKG_CONFIG_LIBDIR} AND NOT DEFINED ENV{PKG_CONFIG_SYSROOT_DIR}
|
||||
AND NOT OPENCV_ENABLE_PKG_CONFIG
|
||||
@ -673,6 +673,8 @@ if(UNIX)
|
||||
# no need to link to system libs with emscripten
|
||||
elseif(QNXNTO)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m)
|
||||
elseif(MINGW)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} pthread)
|
||||
else()
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
|
||||
endif()
|
||||
|
@ -103,7 +103,7 @@ add_custom_target(gen-pkgconfig ALL SOURCES "${CMAKE_BINARY_DIR}/unix-install/${
|
||||
add_dependencies(developer_scripts gen-pkgconfig)
|
||||
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
if((UNIX AND NOT ANDROID) OR MINGW)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/unix-install/${OPENCV_PC_FILE_NAME} DESTINATION ${OPENCV_LIB_INSTALL_PATH}/pkgconfig COMPONENT dev)
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user