Open hsuanguo opened 3 years ago
Hi @hsuanguo
The CMakeToolchain is currently ongoing development, and new changes will be released in Conan 1.36: https://github.com/conan-io/conan/pull/8749.
As you can see the new default way will use the AndroidNDK provided cmake, which is simpler and robust. If your question is about the ConanCenter android-ndk package, probably this is something that we should consider also somehow in the CMakeToolchain feature, not only here in conan-center-index android-ndk recipe.
Thanks for the explanation, great work, I am looking forward to it.
Yeah, it was just that I felt it's one step from great :)
I see that this is supported now, although still indicated to be "experimental".
I'm still not sure how to get this to work. Following the doc above, I keep getting errors like:
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
This points to something related to a note under a non-CMakeToolchain Generator technique.
Can you provide a clear example of build and host profiles to cross-compile from windows to Android while using the CMakeToolchain generator? Also, I'm using Conan 1.59, not Conan 2.
Thanks!
Hi
I am quite confused and can't find a related document, I know that now we have
CMakeToolchain
and the newtwo-profile
way for cross building, ideally what I tried to achieve is(android for example):[build_requires] android-ndk/r21d
[settings] compiler.libcxx=libstdc++11
[options] [env]
[requires] hello_pkg1/1.0.0@my_pkgs/test hello_pkg2/2.0.0@my_pkgs/test
[build_requires] android-ndk/r21d
[generators] cmake_find_package_multi CMakeToolchain
[options] [imports]
conan install ../conanfile.txt --profile:build=linux-x86_x64-build-default.txt --profile:host=android-armv8-clang9-api24_release.txt --build=missing
ERROR: Error in generator 'CMakeToolchain': Cannot find ANDROID_NDK (ndk-build) in the PATH
cmake -DCMAKE_TOOLCHAINFILE=/Users/a4z/.conan/data/android-ndk/r21d//_/package/46f53f156846659bf39ad6675fa0ee8156e859fe/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-21 ..