CMake-QA
In respond of Note:Pybind11 build from source,
Please search the cmake document for why you should mkdir before building a cmake project. Similarly, please share the link that provides the information.
So at first I went here. I get to know:
1 | Usage |
From the video, the mkdir seems to be what most people do. The reason to why mkdir I supposed is that it helps organize our files, so that files won’t be a mess. It helps, but not a necessity. In order to better confirm my words, I did a little experiment on it:
1 | cmake -DCMAKE_INSTALL_PREFIX=/ . |
It works as well. So I think the reason to mkdir is that it helps sort our files in an organized way.
While building pybind, there are files being generated, including Makefile; no additional CMakeLists.txt are generated accordingly. I’m not sure whether it is possible that cmake would generate an additional CMakeLists.txt. If it does, the reason to mkdir will be even obvious, i.e, overwritting will increase the difficulty if we want to undo.
Please find out what CMAKE_INSTALL_PREFIX does, and show me the link that explains it to you.
It designated the directory of installation (link).
On my pc, while cmake -DCMAKE_INSTALL_PREFIX=/ .,
1 | ... |