<div dir="ltr"><div>From my personal experience, I suggest never touch the manifest, because it's not a useful configuration to solve the DLL hell issue since Windows XP.<br></div><div><br></div><div>Instead, once we know the exact version of Visual Studio with Update, the distributor just ship the MSVC runtime installer with software, the installer would install the required MSVCRuntime locally, so everything almost exactly matches without touching the crazy configuration.</div><div><br></div><div>On MSVC, you should always use Visual Studio MSBuild rather than the other build system, just use</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>cmake --build <build_dir> --target INSTALL --config Release</div></blockquote><div><br></div><div>That's it.</div><div><br></div><div>Thank you very much.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 21, 2018 at 6:02 PM Øystein Walle <<a href="mailto:oystwa@gmail.com">oystwa@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am experiencing an error when trying to require administrator privileges on<br>
Windows. I have made a small test case[1] available to demonstrate the issue.<br>
CMake generates its own manifest and at link time MSVC is unable to merge<br>
CMake's and my own manifest, giving the following error:<br>
<br>
manifest authoring error c1010001: Values of attribute "level" not equal<br>
in different manifest snippets.<br>
<br>
The error occurs both when generating a VS project and generating Ninja build<br>
files with the MSVC toolchain with CMake 3.12.1.<br>
<br>
This problem can be worked around by adding the following to CMakeLists.txt<br>
instead using the manifest file (thanks to ngladitz at #cmake@freenode):<br>
<br>
set_property(TARGET ${PROJECT_NAME} PROPERTY<br>
LINK_FLAGS "/MANIFESTUAC:level='requireAdministrator'"<br>
)<br>
<br>
However, CMake has had support for adding manifest files to the list of sources<br>
since 3.4. Should this particular usage of a manifest file be an exception? If<br>
so, are there any other potential conflicts?<br>
<br>
If's desirable to rather fix the issue maybe the options I see are:<br>
<br>
- Use the user's manifest (if present) and discard CMake's own,<br>
- Configure MSVC to let one manifest file yield when conflicts are present<br>
(not sure if this is possible),<br>
- Do the merge in CMake itself (yuck, I guess...)<br>
<br>
I'm new to the MSVC toolchain so there may be some obvious solutions I<br>
am overlooking here...<br>
<br>
Regards,<br>
Øsse<br>
<br>
[1]: <a href="https://github.com/Osse/manifesttest" rel="noreferrer" target="_blank">https://github.com/Osse/manifesttest</a><br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div></div>