-
Make sure you have installed the compiler that you will use for C++, in my case I will use MinGW.
Download the installer here
I recommend you watch this video where they explain how to install it:
-
Now install CMake, you can download the installer here or check the download page.
When you finish installing CMake make sure the path is found in the environment variables.
If you like to use the terminal you can use the following command to open the system properties window:
PS C:\> start sysdm.cpl
When the system properties window opens, click on the advanced options tab and then click on environment variables. Check in
system variables > Path
that the following path is found:C:\Program Files\CMake\bin
In this installation guide I will show you how to install GLFW from the source package
, to download the source package click here.
When the download is finished, unzip the folder in the path you want, for example on the desktop. Once the file is unzipped open the terminal in administrator mode.
In the terminal go to the path where to unzip the file
PS C:\path\to\glfw-version>
Once we are in the folder path we will use CMake, using the following commands:
PS C:\path\to\glfw-version> cmake . -G "MinGW Makefiles"
PS C:\path\to\glfw-version> cmake --build .
Before proceeding with the installation make sure to create the folder in the following path:
C:\Program Files (x86)\GLFW\include\GLFW
When you make sure that the path exists you can install using the following command:
PS C:\path\to\glfw-version> cmake --install . --default-directory-permissions u=rwx
Now you can run the Example code from the GLFW documentation using CMake, check the CMakeLists file.