Fellow person who had never used CMake before about four weeks ago and initially didn't like it. Now, I much prefer it to make. The main thing to know about CMake is that you need to run it from a different directory than your source directory. Traditionally, a subdirectory called "build". You run it once to configure the build, pointing it at the parent directory. And then you can use the generated build files (either make or ninja) to build the target.
The number two thing to learn about cmake is sometimes it gets confused. (Something bad ends up in the cache or what have you.) It's very hard to dissuade cmake of things it thinks it knows in its cache. So when in doubt, rm -rf ./build && mkdir build && cd build && cmake .. && make <target>. In other words, if things are behaving strangely, delete the build directory and recreate it!
The number two thing to learn about cmake is sometimes it gets confused. (Something bad ends up in the cache or what have you.) It's very hard to dissuade cmake of things it thinks it knows in its cache. So when in doubt, rm -rf ./build && mkdir build && cd build && cmake .. && make <target>. In other words, if things are behaving strangely, delete the build directory and recreate it!
Statistics: Posted by jags84 — Fri May 03, 2024 8:39 pm