<p dir="auto">If the path to the OpenCV source code contains a "+" character (common scenario: code is extracted into folder named like <code class="notranslate">opencv-3.4.1+0dfsg1</code>), generation of the <code class="notranslate">headers.txt</code> used in python bindings generation fails silently during configuration. Building off this configuration fails spectacularly, but without any indication that this is the culprit. This seems to be caused by the call to <code class="notranslate">ocv_list_filter</code> on <a href="https://github.com/opencv/opencv/blob/3.4.1/modules/python/bindings/CMakeLists.txt#L23">line 23 of <code class="notranslate">modules/python/bindings/CMakeLists.txt</code></a>, as the output of the command is empty in this situation.</p>
<p dir="auto">While an easy solution might be "don't put opencv in a folder with a plus in it", I suspect this will interfere with some debian package building software.</p>
<p dir="auto">If the source or binary path in cmake contain the character sequence "++" (without quotation marks) I get a cmake error when trying to create a project for OpenCV 3.1:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CMake Error at cmake/OpenCVUtils.cmake:76 (if):
  if given arguments:

    &quot;G:/Desktop/C++ projects/project&quot; &quot;MATCHES&quot; &quot;^G:/Desktop/C++ projects/sources&quot; &quot;OR&quot;     &quot;G:/Desktop/C++ projects/project&quot; &quot;MATCHES&quot; &quot;^G:/Desktop/C++ projects/project&quot;

  Regular expression &quot;^G:/Desktop/C++ projects/sources&quot; cannot compile
Call Stack (most recent call first):
  CMakeLists.txt:437 (ocv_include_directories)"><pre class="notranslate"><code class="notranslate">CMake Error at cmake/OpenCVUtils.cmake:76 (if):
  if given arguments:

    "G:/Desktop/C++ projects/project" "MATCHES" "^G:/Desktop/C++ projects/sources" "OR"     "G:/Desktop/C++ projects/project" "MATCHES" "^G:/Desktop/C++ projects/project"

  Regular expression "^G:/Desktop/C++ projects/sources" cannot compile
Call Stack (most recent call first):
  CMakeLists.txt:437 (ocv_include_directories)
</code></pre></div>
<p dir="auto">Apparently this line inside OpenCVUtils causes the problem:</p>
<p dir="auto"><code class="notranslate">if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")</code></p>
<p dir="auto">I noticed the problem because I have a folder called "C++ Projects" where I keep C++ projects and libraries.</p>