[CMake] Fwd: Re: VC2015 and Windows 7 compatibility

Gonzalo Garramuño ggarra13 at gmail.com
Wed Sep 20 10:27:49 EDT 2017


El 19/09/2017 a las 13:57, Elvis Stansvik escribió:
>
> I also build on Win 8.1/MSVC 2015, targeting Windows 7+, and what I do
> is basically:
>
> if(WIN32)
>      add_definitions(/D_WIN32_WINNT=0x0601) # Target Windows 7+
>
>      set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
>      set(CMAKE_INSTALL_UCRT_LIBRARIES ON)
>      include(InstallRequiredSystemLibraries)
> endif()
>
> The /D_WIN32_WINNT=0x0601 is what ensures Windows 7 compatibility and
> CMAKE_INSTALL_UCRT_LIBRARIES is what ensures Universal CRT libraries
> like the one you mentioned gets installed alongside the application.
>
> You'll end up with a truckload of such small DLLs, but AFAIK this is
> what you need to do if you want to do app-local deployment of the
> Universal CRT.
>
> Hope that helps.
>
> Elvis

I followed your advice and got a bunch of api-ms-* files in the install directory when I packed it.
However, for my program, there were still 3 DLLs missing: api-ms-win-core-libraryloader-l1-2-0.dll,
api-ms-win-core-sysinfo-l1-2-1.dll,
api-ms-win-core-processthreads-l1-1-2.dll.

Not sure if this is a bug in cmake.  Not sure how cmake gets those dependencies.

-- 
Gonzalo Garramuño



More information about the CMake mailing list