Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencv fails to build in a directory with ++ #1091

Closed
starius opened this issue Dec 20, 2015 · 3 comments · Fixed by #1093
Closed

opencv fails to build in a directory with ++ #1091

starius opened this issue Dec 20, 2015 · 3 comments · Fixed by #1093

Comments

@starius
Copy link
Member

starius commented Dec 20, 2015

Similar to #1087 and #1030

From log:

-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detected version of GNU GCC: 49 (409)
RegularExpression::compile(): Nested *?+.
RegularExpression::compile(): Error in compile.
CMake Error at cmake/OpenCVUtils.cmake:42 (if):
  if given arguments:

    "/home/mxe/mxe-libmysqlclient-++-plus-plus/tmp-opencv-i686-w64-mingw32.static/opencv-2.4.10.build" "MATCHES" "^/home/mxe/mxe-libmysqlclient-++-plus-plus/tmp-opencv-i686-w64-mingw32.static/opencv-2.4.10" "OR" "/home/mxe/mxe-libmysqlclient-++-plus-plus/tmp-opencv-i686-w64-mingw32.static/opencv-2.4.10.build" "MATCHES" "^/home/mxe/mxe-libmysqlclient-++-plus-plus/tmp-opencv-i686-w64-mingw32.static/opencv-2.4.10.build"

  Regular expression
  "^/home/mxe/mxe-libmysqlclient-++-plus-plus/tmp-opencv-i686-w64-mingw32.static/opencv-2.4.10"
  cannot compile
Call Stack (most recent call first):
  CMakeLists.txt:348 (ocv_include_directories)


-- Configuring incomplete, errors occurred!
@tonytheodore
Copy link
Member

At this point, we need to deal with it at the cmake level.

@starius
Copy link
Member Author

starius commented Dec 20, 2015

The code is as follows:

# cmake/OpenCVUtils.cmake:42
if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR
   "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}")

It checks if ${__abs_dir} is a subdirectory starts with ${OpenCV_SOURCE_DIR} or ${OpenCV_BINARY_DIR}. It can be replaced with getting a prefix and comparing with STREQUAL.

starius added a commit to LuaAndC/mxe that referenced this issue Dec 20, 2015
@starius
Copy link
Member Author

starius commented Dec 20, 2015

Or use FIND:

string(FIND "${__abs_dir}" "${OpenCV_SOURCE_DIR}" OpenCV_SOURCE_DIR_offset)
string(FIND "${__abs_dir}" "${OpenCV_BINARY_DIR}" OpenCV_BINARY_DIR_offset)
if($OpenCV_BINARY_DIR_offset} EQUAL 0 OR ${OpenCV_BINARY_DIR_offset} EQUAL 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants