diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt index 9100cd20d6..c0c2b133cb 100644 --- a/3rdparty/libpng/CMakeLists.txt +++ b/3rdparty/libpng/CMakeLists.txt @@ -84,4 +84,4 @@ if(NOT BUILD_SHARED_LIBS) ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev) endif() -ocv_install_3rdparty_licenses(libpng LICENSE README opencv-libpng.patch) +ocv_install_3rdparty_licenses(libpng LICENSE README) diff --git a/CMakeLists.txt b/CMakeLists.txt index aea37b9f64..c639e6067c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -582,6 +582,7 @@ if(ANDROID) ocv_update(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include) ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native) ocv_update(OPENCV_OTHER_INSTALL_PATH sdk/etc) + ocv_update(OPENCV_LICENSES_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/licenses") else() set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib") ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}") @@ -597,6 +598,7 @@ else() ocv_update(OPENCV_JAR_INSTALL_PATH java) ocv_update(OPENCV_OTHER_INSTALL_PATH etc) ocv_update(OPENCV_CONFIG_INSTALL_PATH ".") + ocv_update(OPENCV_LICENSES_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}/licenses") else() include(GNUInstallDirs) ocv_update(OPENCV_LIB_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}) @@ -604,6 +606,7 @@ else() ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples) ocv_update(OPENCV_JAR_INSTALL_PATH share/OpenCV/java) ocv_update(OPENCV_OTHER_INSTALL_PATH share/OpenCV) + ocv_update(OPENCV_LICENSES_INSTALL_PATH "${CMAKE_INSTALL_DATAROOTDIR}/licenses/opencv3") if(NOT DEFINED OPENCV_CONFIG_INSTALL_PATH) math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}") diff --git a/cmake/OpenCVFindIPP.cmake b/cmake/OpenCVFindIPP.cmake index 49f24389f4..7fa0bb0b64 100644 --- a/cmake/OpenCVFindIPP.cmake +++ b/cmake/OpenCVFindIPP.cmake @@ -245,7 +245,12 @@ if(NOT DEFINED IPPROOT) return() endif() set(IPPROOT "${ICV_PACKAGE_ROOT}/icv") - ocv_install_3rdparty_licenses(ippicv "${IPPROOT}/readme.htm" "${ICV_PACKAGE_ROOT}/EULA.txt") + ocv_install_3rdparty_licenses(ippicv "${IPPROOT}/readme.htm") + if(WIN32) + ocv_install_3rdparty_licenses(ippicv "${ICV_PACKAGE_ROOT}/EULA.rtf") + else() + ocv_install_3rdparty_licenses(ippicv "${ICV_PACKAGE_ROOT}/EULA.txt") + endif() endif() file(TO_CMAKE_PATH "${IPPROOT}" __IPPROOT) diff --git a/cmake/OpenCVFindIPPIW.cmake b/cmake/OpenCVFindIPPIW.cmake index 79a9fb21be..bd3b0b8422 100644 --- a/cmake/OpenCVFindIPPIW.cmake +++ b/cmake/OpenCVFindIPPIW.cmake @@ -148,9 +148,13 @@ if(BUILD_IPP_IW) set(IPPIW_ROOT "${IPPROOT}/../iw") ocv_install_3rdparty_licenses(ippiw - "${IPPIW_ROOT}/../EULA.txt" "${IPPIW_ROOT}/../support.txt" "${IPPIW_ROOT}/../third-party-programs.txt") + if(WIN32) + ocv_install_3rdparty_licenses(ippiw "${IPPIW_ROOT}/../EULA.rtf") + else() + ocv_install_3rdparty_licenses(ippiw "${IPPIW_ROOT}/../EULA.txt") + endif() # Package sources get_filename_component(__PATH "${IPPROOT}/../iw/" ABSOLUTE) diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 0a84aa6a5c..dbce2de736 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -1200,13 +1200,17 @@ endfunction() # ocv_install_3rdparty_licenses( [ ..]) function(ocv_install_3rdparty_licenses library) foreach(filename ${ARGN}) + set(filepath "${filename}") + if(NOT IS_ABSOLUTE "${filepath}") + set(filepath "${CMAKE_CURRENT_LIST_DIR}/${filepath}") + endif() get_filename_component(name "${filename}" NAME) install( - FILES "${filename}" - DESTINATION "${OPENCV_OTHER_INSTALL_PATH}/licenses" + FILES "${filepath}" + DESTINATION "${OPENCV_LICENSES_INSTALL_PATH}" COMPONENT licenses RENAME "${library}-${name}" - OPTIONAL) + ) endforeach() endfunction()