From 796bf017978d379fec2b7ecd9846df845116c18d Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Mon, 23 Mar 2015 13:10:18 +0300 Subject: [PATCH] Do not compare extra modules in ABI check --- cmake/OpenCVGenABI.cmake | 20 ++++++++++++++++++++ cmake/templates/opencv_abi.xml.in | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/cmake/OpenCVGenABI.cmake b/cmake/OpenCVGenABI.cmake index ebf5bd6553..35cc10d8ed 100644 --- a/cmake/OpenCVGenABI.cmake +++ b/cmake/OpenCVGenABI.cmake @@ -22,6 +22,26 @@ set(OPENCV_ABI_HEADERS "{RELPATH}/${OPENCV_INCLUDE_INSTALL_PATH}") # Libraries set(OPENCV_ABI_LIBRARIES "{RELPATH}/${OPENCV_LIB_INSTALL_PATH}") +set(OPENCV_ABI_SKIP_HEADERS "") +set(OPENCV_ABI_SKIP_LIBRARIES "") +foreach(mod ${OPENCV_MODULES_BUILD}) + string(REGEX REPLACE "^opencv_" "" mod "${mod}") + if(NOT "${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${OpenCV_SOURCE_DIR}/modules/${mod}") + # headers + foreach(h ${OPENCV_MODULE_opencv_${mod}_HEADERS}) + file(RELATIVE_PATH h "${OPENCV_MODULE_opencv_${mod}_LOCATION}/include" "${h}") + list(APPEND OPENCV_ABI_SKIP_HEADERS "${h}") + endforeach() + # libraries + set(lib_name "") + get_target_property(lib_name opencv_${mod} LOCATION) + get_filename_component(lib_name "${lib_name}" NAME) + list(APPEND OPENCV_ABI_SKIP_LIBRARIES "${lib_name}") + endif() +endforeach() +string(REPLACE ";" "\n " OPENCV_ABI_SKIP_HEADERS "${OPENCV_ABI_SKIP_HEADERS}") +string(REPLACE ";" "\n " OPENCV_ABI_SKIP_LIBRARIES "${OPENCV_ABI_SKIP_LIBRARIES}") + # Options set(OPENCV_ABI_GCC_OPTIONS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") string(REGEX REPLACE "([^ ]) +([^ ])" "\\1\\n \\2" OPENCV_ABI_GCC_OPTIONS "${OPENCV_ABI_GCC_OPTIONS}") diff --git a/cmake/templates/opencv_abi.xml.in b/cmake/templates/opencv_abi.xml.in index 49702cc7b4..6a7a6d8d7e 100644 --- a/cmake/templates/opencv_abi.xml.in +++ b/cmake/templates/opencv_abi.xml.in @@ -31,8 +31,13 @@ opencv2/ts.hpp opencv2/ts/* opencv2/xobjdetect/private.hpp + @OPENCV_ABI_SKIP_HEADERS@ + + @OPENCV_ABI_SKIP_LIBRARIES@ + + @OPENCV_ABI_GCC_OPTIONS@