[CMake] Conflicting MSVC manifests

Bo Zhou bo.schwarzstein at gmail.com
Tue Aug 21 05:11:36 EDT 2018


>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.

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.

On MSVC, you should always use Visual Studio MSBuild rather than the other
build system, just use

cmake --build <build_dir> --target INSTALL --config Release


That's it.

Thank you very much.

On Tue, Aug 21, 2018 at 6:02 PM Øystein Walle <oystwa at gmail.com> wrote:

> 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 at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180821/c286b02b/attachment.html>


More information about the CMake mailing list