<div dir="ltr"><div dir="auto">Hi Gonzalo,<div dir="auto"><br></div><div dir="auto">Since you are using ninja files and building from command line, I suspect you are using a Visual Studio 2015 command prompt.</div><div><br>It may be beneficial to initialise a command prompt to specifically target Windows 8.1 SDK which is the one to go to target Windows 7. <br><br>First, make sure Windows 8.1 SDK is installed (can't remember but it is likely that the visual studio 2015 installer can help).</div><div><br>Then open a command prompt and run the vcvarsall.bat passing arguments "x64 8.1" if you are building on a 64-bit install of windows targeting 64-bit windows.<br><br>Then run cmake and ninja from there, and I suspect there's a chance the produced binaries will no longer depend on those files. Like you mentioned, those files are not redistributable by developers.<br><br>My vcvarsall.bat is located at:<br>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC<br></div><div><br>Regards,<br>Luis</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 Sep 2017 15:28, "Gonzalo Garramuño" <<a href="mailto:ggarra13@gmail.com" target="_blank">ggarra13@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">El 19/09/2017 a las 13:57, Elvis Stansvik escribió:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<br>
I also build on Win 8.1/MSVC 2015, targeting Windows 7+, and what I do<br>
is basically:<br>
<br>
if(WIN32)<br>
     add_definitions(/D_WIN32_WINN<wbr>T=0x0601) # Target Windows 7+<br>
<br>
     set(CMAKE_INSTALL_SYSTEM_RUNT<wbr>IME_DESTINATION ".")<br>
     set(CMAKE_INSTALL_UCRT_LIBRAR<wbr>IES ON)<br>
     include(InstallRequiredSystem<wbr>Libraries)<br>
endif()<br>
<br>
The /D_WIN32_WINNT=0x0601 is what ensures Windows 7 compatibility and<br>
CMAKE_INSTALL_UCRT_LIBRARIES is what ensures Universal CRT libraries<br>
like the one you mentioned gets installed alongside the application.<br>
<br>
You'll end up with a truckload of such small DLLs, but AFAIK this is<br>
what you need to do if you want to do app-local deployment of the<br>
Universal CRT.<br>
<br>
Hope that helps.<br>
<br>
Elvis<br>
</blockquote>
<br>
I followed your advice and got a bunch of api-ms-* files in the install directory when I packed it.<br>
However, for my program, there were still 3 DLLs missing: api-ms-win-core-libraryloader-<wbr>l1-2-0.dll,<br>
api-ms-win-core-sysinfo-l1-2-1<wbr>.dll,<br>
api-ms-win-core-processthreads<wbr>-l1-1-2.dll.<br>
<br>
Not sure if this is a bug in cmake.  Not sure how cmake gets those dependencies.<br>
<br>
-- <br>
Gonzalo Garramuño<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank" rel="noreferrer">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" target="_blank" rel="noreferrer">http://www.cmake.org/Wiki/CMak<wbr>e_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" target="_blank" rel="noreferrer">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank" rel="noreferrer">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank" rel="noreferrer">http://cmake.org/cmake/help/tr<wbr>aining.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank" rel="noreferrer">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank" rel="noreferrer">http://public.kitware.com/mail<wbr>man/listinfo/cmake</a></blockquote></div></div>
</div>