Skip to content

Commit 59798b3

Browse files
committed
java: use module's public headers only
1 parent 0e1d65d commit 59798b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/java/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,14 @@ foreach(module ${OPENCV_JAVA_MODULES})
149149
file(STRINGS "${custom_header_list}" module_headers)
150150
ocv_list_add_prefix(module_headers "${OPENCV_MODULE_opencv_${module}_LOCATION}/")
151151
else()
152-
set(module_headers "${OPENCV_MODULE_opencv_${module}_HEADERS}")
152+
set(module_headers "")
153+
# TODO Implement module's "_HEADERS_PUBLIC" variable (OpenCVModule.cmake)
154+
foreach(hdr ${OPENCV_MODULE_opencv_${module}_HEADERS})
155+
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
156+
if(NOT hdr2 MATCHES "opencv2/${m}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )
157+
list(APPEND module_headers "${hdr}")
158+
endif()
159+
endforeach()
153160
endif()
154161

155162
if(NOT module_headers)

0 commit comments

Comments
 (0)