cmake: fix licenses install rules

pull/14233/head
Alexander Alekhin 6 years ago
parent 69ff7a76d6
commit 4fa4bef41d
  1. 2
      3rdparty/libpng/CMakeLists.txt
  2. 3
      CMakeLists.txt
  3. 7
      cmake/OpenCVFindIPP.cmake
  4. 6
      cmake/OpenCVFindIPPIW.cmake
  5. 10
      cmake/OpenCVUtils.cmake

@ -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)

@ -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}")

@ -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)

@ -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)

@ -1200,13 +1200,17 @@ endfunction()
# ocv_install_3rdparty_licenses(<library-name> <filename1> [<filename2> ..])
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()

Loading…
Cancel
Save