Technology, programing, gadgets and other stuff

How to grant administrator privileges to Windows applications with CMake

Sometimes happens that you need grant administrator privileges to Windows applications because you need to access to some kind of hardware feature, launch a child process within your application or anything else. Otherwise, your application will not be able to perform these actions.

For that, you need to create a manifest file in which you have to indicate that you application should ask the user for administrator privileges and, after that, embed the file in your application executable.

If you are also using CMake and you want to include all this tricky stuff in your build process, keep reading.

The first thing that you need is to create a manifest file with the following structure: