Skip to content

Instantly share code, notes, and snippets.

@k0mp1ex
Created February 21, 2023 00:35
Show Gist options
  • Save k0mp1ex/5cf6081a6829813177d1a6dbbdf54799 to your computer and use it in GitHub Desktop.
Save k0mp1ex/5cf6081a6829813177d1a6dbbdf54799 to your computer and use it in GitHub Desktop.
Build executable with CMake that requires administrator access to run it
cmake_minimum_required(VERSION 3.24)
project(INeedAdmin VERSION 1.0.0)
set(CMAKE_CXX_STANDARD 23)
add_executable(${PROJECT_NAME} main.cpp)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS " /MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment