1 if (NOT GENERATE_ABI_DESCRIPTOR)
5 set(filename "opencv_abi.xml")
6 set(path1 "${CMAKE_BINARY_DIR}/${filename}")
8 set(modules "${OPENCV_MODULES_PUBLIC}")
9 ocv_list_filterout(modules "opencv_ts")
11 message(STATUS "Generating ABI compliance checker configuration: ${filename}")
13 if (OPENCV_VCSVERSION AND NOT OPENCV_VCSVERSION STREQUAL "unknown")
14 set(OPENCV_ABI_VERSION "${OPENCV_VCSVERSION}")
16 set(OPENCV_ABI_VERSION "${OPENCV_VERSION}")
20 set(OPENCV_ABI_HEADERS "{RELPATH}/${OPENCV_INCLUDE_INSTALL_PATH}")
23 set(OPENCV_ABI_LIBRARIES "{RELPATH}/${OPENCV_LIB_INSTALL_PATH}")
25 set(OPENCV_ABI_SKIP_HEADERS "")
26 set(OPENCV_ABI_SKIP_LIBRARIES "")
27 foreach(mod ${OPENCV_MODULES_BUILD})
28 string(REGEX REPLACE "^opencv_" "" mod "${mod}")
29 if(NOT OPENCV_MODULE_opencv_${mod}_CLASS STREQUAL "PUBLIC"
30 OR NOT "${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${OpenCV_SOURCE_DIR}/modules/${mod}" # opencv_contrib
33 foreach(h ${OPENCV_MODULE_opencv_${mod}_HEADERS})
34 file(RELATIVE_PATH h "${OPENCV_MODULE_opencv_${mod}_LOCATION}/include" "${h}")
35 list(APPEND OPENCV_ABI_SKIP_HEADERS "${h}")
38 if(TARGET opencv_${mod}) # opencv_world
39 list(APPEND OPENCV_ABI_SKIP_LIBRARIES "\$<TARGET_FILE_NAME:opencv_${mod}>")
43 string(REPLACE ";" "\n " OPENCV_ABI_SKIP_HEADERS "${OPENCV_ABI_SKIP_HEADERS}")
44 string(REPLACE ";" "\n " OPENCV_ABI_SKIP_LIBRARIES "${OPENCV_ABI_SKIP_LIBRARIES}")
47 set(OPENCV_ABI_GCC_OPTIONS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -DOPENCV_ABI_CHECK=1")
48 string(REGEX REPLACE "([^ ]) +([^ ])" "\\1\\n \\2" OPENCV_ABI_GCC_OPTIONS "${OPENCV_ABI_GCC_OPTIONS}")
50 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_abi.xml.in" "${path1}.base")
51 file(GENERATE OUTPUT "${path1}" INPUT "${path1}.base")