Skip to content

Configuring for Android not working with Ninja #9512

@JDFind

Description

@JDFind
System information (version)
  • OpenCV => 3.3.0
  • Operating System / Platform => Windows 10 64 Bit
  • Compiler => Ninja 1.7.2
  • Cmake 3.9.1
Detailed description

On a Windows 10 machine, using Cmake, Ninja and the android.toolchain.cmake from platforms/android, configuration of OpenCv for Android fails with the following message:

CMake Error at (...)opencv/platforms/android/android.toolchain.cmake:1665 (enable_language):
  Language 'C' is currently being enabled.  Recursive call not allowed.

A possible solution may be to remove the following lines:

 enable_language( C )
 enable_language( CXX )
Steps to reproduce

Running

cmake -D CMAKE_BUILD_TYPE=Release \
	-D CMAKE_BUILD_WITH_INSTALL_RPATH=ON \
	-D CMAKE_INSTALL_PREFIX="install/opencv" \
        -D CMAKE_TOOLCHAIN_FILE="opencv/platforms/android/cmake/android.toolchain.cmake" \
        -D ANDROID_NDK="${ANDROID_NDK_ROOT}" \
        -D ANDROID_NATIVE_API_LEVEL="${API_LEVEL}" \
        -D ANDROID_ABI="${ANDROID_ABI}" \
        -D WITH_CUDA=OFF \
        -D WITH_MATLAB=OFF \
        -D BUILD_ANDROID_EXAMPLES=OFF \
        -D BUILD_DOCS=OFF \
        -D BUILD_PERF_TESTS=OFF \
        -D BUILD_TESTS=OFF \
	-D BUILD_EXAMPLES=OFF \
	-D BUILD_SHARED_LIBS=OFF \
	-G Ninja \
	-D CMAKE_MAKE_PROGRAM=${NINJA_LOCATION}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions