<div dir="ltr"><div><div><div>I failed to send my previous reply to the list - see below for that. This is a follow-on, using the repo mentioned previously.</div><div><br></div><div>--- Attempt #1</div></div><div><br></div><div>#   Pointing out that my Command Prompt shell doesn't need to know about the 'cl' compiler, in order to run cmake:</div><div>C:\Users\Owner\dev\cmake_learn<wbr>\cmake_learn-master\build>cl</div><div>'cl' is not recognized as an internal or external command,</div><div>operable program or batch file.</div></div><div><br></div><div><br></div><div>C:\Users\Owner\dev\cmake_learn<wbr>\cmake_learn-master\build>cmak<wbr>e ..</div><div>-- Building for: Visual Studio 15 2017</div><div>-- The C compiler identification is MSVC 19.11.25508.2</div><div>-- The CXX compiler identification is MSVC 19.11.25508.2</div><div>-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools<wbr>/MSVC/14.11.25503/bin/HostX86/<wbr>x86/cl.exe</div><div>-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools<wbr>/MSVC/14.11.25503/bin/HostX86/<wbr>x86/cl.exe -- works</div><div>-- Detecting C compiler ABI info</div><div>-- Detecting C compiler ABI info - done</div><div>-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools<wbr>/MSVC/14.11.25503/bin/HostX86/<wbr>x86/cl.exe</div><div>-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools<wbr>/MSVC/14.11.25503/bin/HostX86/<wbr>x86/cl.exe -- works</div><div>-- Detecting CXX compiler ABI info</div><div>-- Detecting CXX compiler ABI info - done</div><div>-- Detecting CXX compile features</div><div>-- Detecting CXX compile features - done</div><div>-- Found OpenMP_C: -openmp (found version "2.0")</div><div>-- Found OpenMP_CXX: -openmp (found version "2.0")</div><div>-- Configuring done</div><div>-- Generating done</div><div>-- Build files have been written to: C:/Users/Owner/dev/cmake_learn<wbr>/cmake_learn-master/build</div><div><br></div><div>This successfully builds the following files, but no Makefile so that I can simply run 'nmake' from the command line:</div><div><br></div><div><div style="font-size:12.8px">d-----        9/19/2017  10:26 AM                BioFVM</div><div style="font-size:12.8px">d-----        9/19/2017  10:26 AM                CMakeFiles</div><div style="font-size:12.8px">d-----        9/19/2017  10:26 AM                core</div><div style="font-size:12.8px">d-----        9/19/2017  10:26 AM                custom_modules</div><div style="font-size:12.8px">d-----        9/19/2017  10:26 AM                modules</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM          62588 ALL_BUILD.vcxproj</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM            304 ALL_BUILD.vcxproj.filters</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM          14371 CMakeCache.txt</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM           1841 cmake_install.cmake</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM           7860 PhysiCell.sln</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM          76341 PhysiCell.vcxproj</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM            611 PhysiCell.vcxproj.filters</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM            274 PhysiCellConfig.h</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM          46027 ZERO_CHECK.vcxproj</div><div style="font-size:12.8px">-a----        9/19/2017  10:26 AM            547 ZERO_CHECK.vcxproj.filters</div></div><div><br></div><div><div style="font-size:12.8px">------------------------------<wbr>--</div></div><div>--- Attempt #2 (without invoking vcvarsall.bat;  rf. <a href="https://dmerej.info/blog/post/cmake-visual-studio-and-the-command-line/" target="_blank">https://dmerej.info/blog/<wbr>post/cmake-visual-studio-and-t<wbr>he-command-line/</a> )</div><div><br></div><div><div style="font-size:12.8px">C:\Users\Owner\dev\cmake_learn<wbr>\cmake_learn-master\build>cmak<wbr>e -G"NMake Makefiles" ..</div><div style="font-size:12.8px">-- The C compiler identification is unknown</div><div style="font-size:12.8px">-- The CXX compiler identification is unknown</div><div style="font-size:12.8px">CMake Error at CMakeLists.txt:5 (project):</div><div style="font-size:12.8px">  The CMAKE_C_COMPILER:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">    cl</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  is not a full path and was not found in the PATH.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  To use the NMake generator with Visual C++, cmake must be run from a shell</div><div style="font-size:12.8px">  that can use the compiler cl from the command line.  This environment is</div><div style="font-size:12.8px">  unable to invoke the cl compiler.  To fix this problem, run cmake from the</div><div style="font-size:12.8px">  Visual Studio Command Prompt (vcvarsall.bat).</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">  Tell CMake where to find the compiler by setting either the environment</div><div style="font-size:12.8px">  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to</div><div style="font-size:12.8px">  the compiler, or to the compiler name if it is in the PATH.</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">------------------------------<wbr>--</div><div style="font-size:12.8px"><div style="font-size:small"><div style="font-size:12.8px"><span style="font-size:small">--- Attempt #3 (after invoking the vcvarsall.bat, thereby making my shell aware of the 'cl' compiler)</span><br></div><div style="font-size:12.8px"><span style="font-size:small"><br></span></div><div style="font-size:12.8px"><div style="font-size:12.8px">C:\Users\Owner\dev\cmake_learn<wbr>\cmake_learn-master\build>cmak<wbr>e -G"NMake Makefiles" ..</div><div>... successfully runs ...</div><div><br></div></div><div style="font-size:12.8px"><span style="font-size:small">Generates the following files, including a Makefile:</span></div><div style="font-size:12.8px"><span style="font-size:small"><br></span></div><div style="font-size:12.8px"><div style="font-size:12.8px">d-----        9/19/2017  10:46 AM                BioFVM</div><div style="font-size:12.8px">d-----        9/19/2017  10:45 AM                CMakeFiles</div><div style="font-size:12.8px">d-----        9/19/2017  10:45 AM                core</div><div style="font-size:12.8px">d-----        9/19/2017  10:46 AM                custom_modules</div><div style="font-size:12.8px">d-----        9/19/2017  10:46 AM                modules</div><div style="font-size:12.8px">-a----        9/19/2017  10:44 AM          15307 CMakeCache.txt</div><div style="font-size:12.8px">-a----        9/19/2017  10:44 AM           1839 cmake_install.cmake</div><div style="font-size:12.8px">-a----        9/19/2017  10:44 AM           7562 Makefile</div><div style="font-size:12.8px">-a----        9/19/2017  10:46 AM        1503232 PhysiCell.pdb</div><div style="font-size:12.8px">-a----        9/19/2017  10:44 AM            274 PhysiCellConfig.h</div></div><div style="font-size:12.8px"><span style="font-size:small"><br></span></div><div style="font-size:12.8px"><div style="font-size:12.8px">PS C:\Users\Owner\dev\cmake_learn<wbr>\cmake_learn-master\build> nmake</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Microsoft (R) Program Maintenance Utility Version 14.11.25508.2</div><div style="font-size:12.8px">... builds most of the way OK ...</div><div style="font-size:12.8px">... (but currently get an error at the end, trying to build code in my 'cmake_learn' repo)</div><div style="font-size:12.8px"><br></div></div></div></div><div><br></div><div>-Randy</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 18, 2017 at 10:22 PM, Randy Heiland <span dir="ltr"><<a href="mailto:randy.heiland@gmail.com" target="_blank">randy.heiland@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks everyone for your replies! I continue to learn/play, but still have problems it seems. I've created a repo, in case anyone would be willing to show me the error of my ways:<div><a href="https://github.com/rheiland/cmake_learn" target="_blank">https://github.com/rheiland/cm<wbr>ake_learn</a></div><div><br></div><div>On Win10, I too *seem* to have to run the vcvarsall.bat to have things (sort of) work.</div><div><br></div><div>I'm using cmake 3.9.2.</div><span class="m_8872018761822638901gmail-m_8311100055560202725gmail-m_-5249042284041076424gmail-m_-6502612176554818037gmail-m_8191179351736661964gmail-m_4127163241713946766gmail-HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="m_8872018761822638901gmail-m_8311100055560202725gmail-m_-5249042284041076424gmail-m_-6502612176554818037gmail-m_8191179351736661964gmail-m_4127163241713946766gmail-HOEnZb"><font color="#888888">-Randy</font></span><div><div class="m_8872018761822638901gmail-m_8311100055560202725gmail-m_-5249042284041076424gmail-m_-6502612176554818037gmail-m_8191179351736661964gmail-m_4127163241713946766gmail-h5"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 18, 2017 at 1:57 PM, Robert Maynard <span dir="ltr"><<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From a default cmd.exe I see cmake 3.9 correctly finding VS2017 when<br>
specifying the VS Generator.<br>
<br>
C:\test\build>C:\support\cmake<wbr>-3.9.2\bin\cmake -G "Visual Studio 15 2017" ../src<br>
-- The C compiler identification is MSVC 19.11.25508.2<br>
-- The CXX compiler identification is MSVC 19.11.25508.2<br>
-- Check for working C compiler: C:/Program Files (x86)/Microsoft<br>
Visual Studio/2017/Community/VC/Tools<wbr>/MSVC/14.11.25503/bin/HostX86/<wbr>x86/cl.exe<br>
-- Check for working C compiler: C:/Program Files (x86)/Microsoft<br>
Visual Studio/2017/Community/VC/Tools<wbr>/MSVC/14.11.25503/bin/HostX86/<wbr>x86/cl.exe<br>
-- works<br>
-- Detecting C compiler ABI info<br>
-- Detecting C compiler ABI info - done<br>
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft<br>
Visual Studio/2017/Community/VC/Tools<wbr>/MSVC/14.11.25503/bin/HostX86/<wbr>x86/cl.exe<br>
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft<br>
Visual Studio/2017/Community/VC/Tools<wbr>/MSVC/14.11.25503/bin/HostX86/<wbr>x86/cl.exe<br>
-- works<br>
-- Detecting CXX compiler ABI info<br>
-- Detecting CXX compiler ABI info - done<br>
-- Detecting CXX compile features<br>
-- Detecting CXX compile features - done<br>
-- Configuring done<br>
-- Generating done<br>
-- Build files have been written to: C:/test/build<br>
<div class="m_8872018761822638901gmail-m_8311100055560202725gmail-m_-5249042284041076424gmail-m_-6502612176554818037gmail-m_8191179351736661964gmail-m_4127163241713946766gmail-m_-7761471856297307401gmail-HOEnZb"><div class="m_8872018761822638901gmail-m_8311100055560202725gmail-m_-5249042284041076424gmail-m_-6502612176554818037gmail-m_8191179351736661964gmail-m_4127163241713946766gmail-m_-7761471856297307401gmail-h5"><br>
On Mon, Sep 18, 2017 at 10:49 AM, Thompson, KT <<a href="mailto:kgt@lanl.gov" target="_blank">kgt@lanl.gov</a>> wrote:<br>
> Robert,<br>
><br>
> That certainly doesn't work for me - but maybe I'm doing something non-standard.<br>
><br>
> If I don't source the vcvarsall.bat file, SDK installations (c:\Program Files (x86)\Windows Kits\... and c:\Program Files (x86)\Microsoft SDKs\...) are not found by CMake.<br>
><br>
> -kt<br>
><br>
> -----Original Message-----<br>
> From: Robert Maynard [mailto:<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware<wbr>.com</a>]<br>
> Sent: Monday, September 18, 2017 8:17 AM<br>
> To: Thompson, KT <<a href="mailto:kgt@lanl.gov" target="_blank">kgt@lanl.gov</a>><br>
> Cc: <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>
> Subject: Re: [CMake] FW: Visual Studio 2017<br>
><br>
> You shouldn't need to import VS17 vcvarsall to use the VS17 Generator,<br>
> that should only be needed if using the MSYS or Ninja generators.<br>
><br>
> As far as building from the command line, the easiest route is to use<br>
> cmake --build <path to build directory>  --config <cfg><br>
><br>
> On Fri, Sep 15, 2017 at 3:05 PM, Thompson, KT <<a href="mailto:kgt@lanl.gov" target="_blank">kgt@lanl.gov</a>> wrote:<br>
>> Randy,<br>
>><br>
>> Miroslav's recommendation should work. To expand on his response, here are the commands that I use with VS2017 to allow cmake to run from the command line:<br>
>><br>
>> - Start cmd session (should also work via powershell)<br>
>> - To import VS17's command line environment run "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxil<wbr>iary\Build\vcvarsall.bat" x86<br>
>> - Add extra project specific environment variables (possibly including appending PATH with the location of cmake).<br>
>><br>
>> I created a batch file that does these steps for me (and a shortcut on my desktop that runs the batch file).<br>
>><br>
>> @echo off<br>
>> rem cmake-with-vs17-env.bat<br>
>> @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxil<wbr>iary\Build\vcvarsall.bat" x86 %*<br>
>> set PATH=%PATH%;c:\MinGW\bin;C:\Pr<wbr>ogram Files\CMake\bin;C:\Program Files\doxygen\bin;c:\Python27a<wbr>md64<br>
>> rem set CMAKE_PREFIX_PATH=<whatever><br>
>><br>
>> With this environment, I can run cmake from the command line (cmake-gui or cmake). I can generate "Visual Studio 15 2017" or "MSYS Makefiles" projects and I can build them with or w/o the GUI.<br>
>><br>
>> I hope this helps!<br>
>><br>
>> -kt<br>
>><br>
>><br>
>> -----Original Message-----<br>
>> From: CMake [mailto:<a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.or<wbr>g</a>] On Behalf Of Mateju Miroslav, Ing.<br>
>> Sent: Friday, September 15, 2017 6:15 AM<br>
>> To: Randy Heiland <<a href="mailto:randy.heiland@gmail.com" target="_blank">randy.heiland@gmail.com</a>>; <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>
>> Subject: Re: [CMake] Visual Studio 2017<br>
>><br>
>> Hello Randy,<br>
>><br>
>> From: CMake [mailto:<a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.or<wbr>g</a>] On Behalf Of Randy Heiland<br>
>> Sent: Friday, September 15, 2017 1:38 PM<br>
>><br>
>>> Is there a "best way" to use cmake for VS17 (but same cakelists for Linux)? And by "best", I mean with minimal effort on users.<br>
>>> To be more specific, on Windows, I *think* I'd like to have users install the cmake binary, then use Powershell to build an application.<br>
>> Is there really a need for using PowerShell if you also want to use the same CMakeLists for Linux?<br>
>><br>
>>> But my initial attempt to do so is confusing. I install VS17 (for C++), it installs in standard path, but 'cl' is not found in Powershell. I read that I shouldn't edit my PATH (nor do I really want users to have to), but run some .bat instead to setup my env. So, how should one specify the compiler for cmake? Oh yes, then I see that VS17 also has its own cmake??<br>
>><br>
>><br>
>> Have you run CMake successfully yet? I am not really aware how it works but CMake *can* for sure detect VS in my CLI environment without having VS in PATH. If you use an IDE that understands CMake (like VS17 or Qt Creator, for example), you should be able to open a CMake project in the IDE and build it there. Please report your particular problem if it does not work for you.<br>
>> If you prefer to run cl.exe in CLI, then vcvarsall.bat is the .bat file you are looking for.<br>
>><br>
>> Best regards,<br>
>><br>
>> Ing. Miroslav Matějů<br>
>> Programmer Analyst<br>
>><br>
>> AŽD Praha s.r.o.<br>
>> Technology Division<br>
>> Research and Development<br>
>> Žirovnická 2/3146, 106 17  Prague<br>
>> Czech Republic<br>
>> Phone: <a href="tel:+420%20267%20287%20476" value="+420267287476" target="_blank">+420 267 287 476</a><br>
>> Web: <a href="http://www.azd.cz" rel="noreferrer" target="_blank">www.azd.cz</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/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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
>> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
>> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/cmake</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/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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
>> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
>> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/cmake</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/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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/cmake</a></div></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div></div>