Hi,

I am experiencing an error when trying to require administrator privileges on
Windows. I have made a small test case[1] available to demonstrate the issue.
CMake generates its own manifest and at link time MSVC is unable to merge
CMake's and my own manifest, giving the following error:

    manifest authoring error c1010001: Values of attribute "level" not equal
    in different manifest snippets.

The error occurs both when generating a VS project and generating Ninja build
files with the MSVC toolchain with CMake 3.12.1.

This problem can be worked around by adding the following to CMakeLists.txt
instead using the manifest file (thanks to ngladitz at #cmake@freenode):

    set_property(TARGET ${PROJECT_NAME} PROPERTY
        LINK_FLAGS "/MANIFESTUAC:level='requireAdministrator'"
    )

However, CMake has had support for adding manifest files to the list of sources
since 3.4. Should this particular usage of a manifest file be an exception? If
so, are there any other potential conflicts?

If's desirable to rather fix the issue maybe the options I see are:

 - Use the user's manifest (if present) and discard CMake's own,
 - Configure MSVC to let one manifest file yield when conflicts are present
   (not sure if this is possible),
 - Do the merge in CMake itself (yuck, I guess...)

I'm new to the MSVC toolchain so there may be some obvious solutions I
am overlooking here...

Regards,
Øsse

[1]: https://github.com/Osse/manifesttest
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to