I am having problems setting a configuration variable through the command line. I cannot determine it from the system, so I expect the user to specify:
cmake -DCMAKE_TOOLCHAIN_FILE=../android.toolchain -DANDROID_ABI:STRING="arm64" ..
Inside my android.toolchain , I have the following:
message(STATUS "Android ABI: ${ANDROID_ABI}") if( "${ANDROID_ABI}" STREQUAL "" ) message(FATAL_ERROR "Please specifiy ABI at cmake call -DANDROID_ABI:STRING=armeabi or -DANDROID_ABI:STRING=arm64") endif()
No matter what happens on this line EVEN, it prints the correct arm64:
-- Android ABI: arm64 CMake Error at yaml-cpp/android.toolchain:45 (message): Please specifiy ABI at cmake call -DANDROID_ABI:STRING=armeabi or -DANDROID_ABI:STRING=arm64
Can someone direct me to what I am doing wrong?
I think this is due to:
- -D adds a cache variable instead of a regular variable
- This is in the toolchain file ... it seems to ignore cache variables
Any thoughts or suggestions?
source share