So we have these 3 files now in C:\dev\cmake\tutorial: To start our CMake tutorial, we need 3 files that we have to create ourselves: We will use the following directory as main directory for our tutorial: Indeed the cmake command (from Cygwin) calls the cmake.exe file within the following directory:Īnd not the one you've downloaded on the official website.Īnyway, if you want to know which version you are using, type the following command in your favorite CLI:įrom the Cygwin terminal, you should see something like this:ĬMake suite maintained and supported by Kitware (/cmake). So no need to download it from the official website.īe careful though if you installed CMake as an independant program because with Cygwin you won't use the one downloaded from the official website. If you don't know what to install, just follow this Cygwin tutorial (Part 1 and 2).ĬMake is already included inside the packages you downloaded if you followed this Cygwin tutorial. We will install it in the following directory: ![]() Our main CLI for this tutorial will be Cygwin: That's why CMake has been created, it works on every operating system (the first letter " C" standing for Cross-platform).įurthermore, with CMake it will be possible to generate Visual Studio project files, like. To be honest the main reason is because in the Windows world there is no native GNU tools available. So why creating a new tool as the GNU one works well? Thus it reduces our mechanism to only 2 steps. The make tool will generate the executable.The cmake command will scan the system information to create the Makefile.The CMake tool propose to help us configuring our workspace like the Autotools but this time with the two-step process: cmake and make. Then the make tool will use this Makefile to generate an executable. ![]() The configure step will scan the system information to create a Makefile appropriate for the current build environment. ![]() In the GNU world we have the GNU Build System with the famous two-step process: configure and make, one calls this the Autotools. In order to have a nice terminal, I'll use the Cygwin CLI during this CMake tutorial. Indeed, CMake is a complex but interesting tool that can generate native Makefiles for the compiler of your choice.īut it's not all, CMake can also create some useful project files, for a lot of IDE (such as Visual Studio or Eclipse for example) and almost every OS (like GNU/Linux, Windows, Mac, etc.). In this tutorial we are going to see how to generate a Makefile with CMake on Windows. There are many ways to create a Makefile.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |