CMake RequireAdministrator

不问归期 提交于 2019-12-22 06:56:52

问题


I'm trying to set the RequireAdministrator manifest flag on an executable I'm building with CMake and Visual Studio.

Any ideas on how to direct CMake to set that option?

Thanks!

Billy3


回答1:


try this:

SET_TARGET_PROPERTIES(your_executable PROPERTIES LINK_FLAGS    "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" /SUBSYSTEM:WINDOWS")



回答2:


I appreciate that the question is tagged visual-studio-2008, but for VS2010 this produces the following error message:

error MSB4030: "level='requireAdministrator' uiAccess='false'" is an invalid value for the "UACUIAccess" parameter of the "Link" task. The "UACUIAccess" parameter is of type "System.Boolean".

An equivalent CMake command (disregarding the /SUBSYSTEM:WINDOWS portion) for VS2010 is

SET_TARGET_PROPERTIES(your_executable PROPERTIES LINK_FLAGS "/level='requireAdministrator' /uiAccess='false'")


来源:https://stackoverflow.com/questions/1655089/cmake-requireadministrator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!