target install ~/package/build $ cmake -install. # From the build directory (pick one) ~/package/build $ make install ~/package/build $ cmake -build. If you are using a newer version of CMake (which you usually should be, except for checking compatibility with older CMake), you can instead do this: if you'd like, and it will call make or whatever build tool you are using. You can replace the make line with cmake -build. ~/package $ mkdir build ~/package $ cd build ~/package/build $ cmake. Here's the Classic CMake Build Procedure (TM): You can technically do an in-source build, but you'll have to be careful not to overwrite files or add them to git, so just don't. Unless otherwise noted, you should always make a build directory and build from there. This is true for almost all CMake projects, which is almost everything. Before writing CMake, let's make sure you know how to run it to make things.
0 Comments
Leave a Reply. |