diff --git a/3rdparty/lapack/CMakeLists.txt b/3rdparty/lapack/CMakeLists.txt index 12487817c8..b2185ee9fc 100644 --- a/3rdparty/lapack/CMakeLists.txt +++ b/3rdparty/lapack/CMakeLists.txt @@ -62,13 +62,8 @@ set_target_properties(${the_target} ) if(NOT BUILD_SHARED_LIBS) - set_target_properties(${the_target} - PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") - install(TARGETS ${the_target} - RUNTIME DESTINATION bin COMPONENT main - LIBRARY DESTINATION lib COMPONENT main - ARCHIVE DESTINATION lib COMPONENT main) + ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main) endif() endif() #android diff --git a/3rdparty/libjasper/CMakeLists.txt b/3rdparty/libjasper/CMakeLists.txt index 72f0d297e1..7f1effc1a5 100644 --- a/3rdparty/libjasper/CMakeLists.txt +++ b/3rdparty/libjasper/CMakeLists.txt @@ -57,4 +57,10 @@ set_target_properties(${the_target} DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib" ) + +if(NOT BUILD_SHARED_LIBS) + install(TARGETS ${the_target} + ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main) +endif() + endif(ANDROID)#!android diff --git a/3rdparty/libjpeg/CMakeLists.txt b/3rdparty/libjpeg/CMakeLists.txt index f73d2ce3af..af8e6f2131 100644 --- a/3rdparty/libjpeg/CMakeLists.txt +++ b/3rdparty/libjpeg/CMakeLists.txt @@ -47,4 +47,10 @@ set_target_properties(${the_target} DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty/lib ) + +if(NOT BUILD_SHARED_LIBS) + install(TARGETS ${the_target} + ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main) +endif() + endif()#android diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt index 85d314e900..0eb998bd3b 100644 --- a/3rdparty/libpng/CMakeLists.txt +++ b/3rdparty/libpng/CMakeLists.txt @@ -41,4 +41,10 @@ set_target_properties(${the_target} DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib" ) + +if(NOT BUILD_SHARED_LIBS) + install(TARGETS ${the_target} + ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main) +endif() + endif()#android diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt index a207bb5c3b..865be5e522 100644 --- a/3rdparty/libtiff/CMakeLists.txt +++ b/3rdparty/libtiff/CMakeLists.txt @@ -99,3 +99,8 @@ set_target_properties(${the_target} DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib/" ) + +if(NOT BUILD_SHARED_LIBS) + install(TARGETS ${the_target} + ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main) +endif() diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt index cc384b230c..340a8b58db 100644 --- a/3rdparty/zlib/CMakeLists.txt +++ b/3rdparty/zlib/CMakeLists.txt @@ -40,10 +40,8 @@ set_target_properties(${the_target} ) if(NOT BUILD_SHARED_LIBS) - set_target_properties(${the_target} - PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${the_target} - ARCHIVE DESTINATION lib COMPONENT main) + ARCHIVE DESTINATION share/opencv/3rdparty/lib COMPONENT main) endif() endif(ANDROID) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0967951037..bc53f083da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -490,7 +490,7 @@ if(WITH_JASPER AND NOT JASPER_FOUND) set(JASPER_LIBRARIES libjasper) endif() -message(STATUS "Graphic libraries: ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${JASPER_LIBRARIES}") +#message(STATUS "Graphic libraries: ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${JASPER_LIBRARIES}") if(WITH_OPENEXR) include(OpenCVFindOpenEXR.cmake) diff --git a/OpenCVConfig.cmake.in b/OpenCVConfig.cmake.in index cfcfd1c07d..8efd6028f3 100644 --- a/OpenCVConfig.cmake.in +++ b/OpenCVConfig.cmake.in @@ -85,6 +85,8 @@ IF (NOT @OPENCV_BUILD_SHARED_LIB@) LINK_DIRECTORIES(@CMAKE_LIB_DIRS_CONFIGCMAKE@/../3rdparty/lib) if(WIN32) LINK_DIRECTORIES(@CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@/3rdparty/lib) + else() + LINK_DIRECTORIES(@CMAKE_LIB_DIRS_CONFIGCMAKE@/../share/opencv/3rdparty/lib) endif() set(OpenCV_LIBS @OPENCV_LINKER_LIBS@ @IPP_LIBS@ @HIGHGUI_LIBRARIES@ ${OpenCV_LIBS})