How to find the CMake command line I used for the build?
cmake
Solution
You can't.
Original CMake command can be guessed from analysis of `CMakeCache.txt`
As a workaround, you could always create a simple wrapper to store the original command line used. Something along these lines:
#!/bin/bash
echo "$@" > cmake_command.log
$@
Problem
This is what typically happens. I get source code that has cmake build scripts. I create a `build` subdirectory, change to it, run `cmake <options> ..`. Depending upon the project and its dependencies I have to repeat the last step until it finds all necessary dependencies and generates makefiles. I successfully build and use the project. Few days pass, I forget about this installation. Then one day I'm trying to setup the same project on another machine and now I can't recall what exact CMake command line I used in the past to get things working. I still have the old build directory on the old machine. Can I find the cmake command line I used in the past, by looking into some of the autogenerated files in the build directory? I was expecting CMake would just put the exact command line I used in one of these files in commented form. But if it does so, I haven't found it yet. How can I find the original CMake command line I used?