From caa9ac4ed95af014e1d0ea11cd68c37e7e5e0a55 Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Wed, 10 Apr 2013 16:49:03 +0200 Subject: [PATCH] fix installation of main module headers see: http://code.opencv.org/issues/2897 The order of the 2 conditions is really important, as every MATCHES operator sets ${CMAKE_MATCH_1}, which is needed inside the condition block. Ideally, this should be done using a single regex with a negative forward lookahead, but CMake doesn't seem to support this --- cmake/OpenCVModule.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index fe31b70aa6..beb12aa271 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -535,7 +535,7 @@ macro(ocv_create_module) if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};") foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS}) string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}") - if(hdr2 MATCHES "^(opencv2/.*)[^/]+.h(..)?$" AND NOT hdr2 MATCHES "opencv2/${the_module}/private.*") + if(NOT hdr2 MATCHES "opencv2/${the_module}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" ) install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT main) endif() endforeach() -- GitLab