CMake happens to be a friend of mine. On my Linux computers, if I need to custom-compile some software, and, if that software does not come with the older ‘./configure’ scripts…, then chances are, that source tree has a ‘CMakeLists.txt’ file in its root directory. On an ‘amd64′, or an ‘i386′ -based computer, this is usually all that I need to create Makefiles, and then to compile the project.
But, I have recently run into a situation where this utility became useless to me. It was an ‘aarch64-linux-gnu’, aka, an ‘arm64′ -based Guest System, running within ‘TightVNC’, running within an Android Host System, via the ‘UserLAnd’ Android app, that uses ‘proot’ to sandbox the Linux Guest System. I tried to use CMake as usual (not really trying to cross-compile anything), and was startled by what this utility next told me: That my C++ compiler was broken, because CMake could not compile a test program, that CMake, in turn, generally tests compilers with.
What I found out was, that it was not the compiler’s fault, but rather, the apparent magic that allows CMake to find the libraries, not working when run on this platform. Hence, the compiler was failing its test, because CMake could not even discern a single library’s location, nor any other variables, that would ultimately have been relevant to the project. The compiler’s test was not even being linked to ‘libstdc++.so’.
I basically had to give up on using CMake on that platform, as well as, on custom-compiling many software projects, that would have been written by other programmers.
What I have learned however is the apparent fact, that when true experts write the ‘CMakeLists.txt’ file to do so, they can even get it to cross-compile their projects to the same platform. But those would be their projects, and not my own project.