<div dir="ltr">Now, with this toolchain file: <div>-----start of toolchain file-------</div><div>set(CMAKE_SYSTEM_NAME Windows)<br>set(CMAKE_SYSTEM_PROCESSOR "x86")<br>set(CMAKE_SYSTEM_VERSION 1)<br><br># Microsoft MSVC compiler<br>#set(CMAKE_C_COMPILER cl.exe)<br>#set(CMAKE_CXX_COMPILER cl.exe)<br><br>set(CMAKE_C_COMPILER "${CMAKE_CURRENT_SOURCE_DIR}/ninja-core-lib/toolchains/cl.bat")<br>set(CMAKE_CXX_COMPILER "${CMAKE_C_COMPILER}")<br><br># Unfortunatly CMake doesn't seem to know anything about the MSVC compiler,<br># so tell CMake that cl.exe supports C99<br>set(CMAKE_C_COMPILE_FEATURES c_std_99)<br><br><br>set(CMAKE_C_FLAGS_INIT "/arch:SSE2 ${_MP_FLAG} /EHsc")<br>set(CMAKE_CXX_FLAGS_INIT "/arch:SSE2 ${_MP_FLAG}")<br><br><br><br>#set(CMAKE_STATIC_LINKER link.exe)<br>#set(CMAKE_LINKER link.exe)<br>#set(CMAKE_SHARED_LINKER link.exe)<br><br>set(CMAKE_STATIC_LINKER "${CMAKE_CURRENT_SOURCE_DIR}/ninja-core-lib/toolchains/link.bat")<br>set(CMAKE_LINKER ${CMAKE_STATIC_LINKER})<br>set(CMAKE_SHARED_LINKER ${CMAKE_STATIC_LINKER})<br><br><br>set(CMAKE_AR ${CMAKE_LINKER})<br><br>set(CMAKE_C_COMPILER_ID "porquePreciseiDeUmBat")<br></div><div>-----stop of toolchain file------- <br><br>using this cl.bat</div><div>----start of cl.bat---------</div><div>pushd<br>"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsamd64_x86.bat"<br>popd<br>cl.exe %*<br></div><div>----stop of cl.bat--------- <br></div><div><br></div><div>and link.bat in the same spirit but with link.exe instead of cl.exe, I can execute cmake, ninja, but the main.exe don't are on build/src/main</div><div><br></div><div><br></div><div>When I look on CMakeError.log on build directory, can look</div><div><br></div><div>-------start of CMakeError.log--------------------------</div><div>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles>more CMakeError.log<br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CompilerIdC".<br><br>Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":<br><br>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles\3.15.3\CompilerIdC>pushd<br><br>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles\3.15.3\CompilerIdC>"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsamd64_x86.bat"<br>**********************************************************************<br>** Visual Studio 2017 Developer Command Prompt v15.9.16<br>** Copyright (c) 2017 Microsoft Corporation<br>**********************************************************************<br>[vcvarsall.bat] Environment initialized for: 'x64_x86'<br>Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":<br><br>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles\3.15.3\CompilerIdC>pushd<br><br>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles\3.15.3\CompilerIdC>"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsamd64_x86.bat"<br>**********************************************************************<br>** Visual Studio 2017 Developer Command Prompt v15.9.16<br>** Copyright (c) 2017 Microsoft Corporation<br>**********************************************************************<br>[vcvarsall.bat] Environment initialized for: 'x64_x86'<br>Detecting C compiler ABI info failed to compile with the following output:<br>Change Dir: C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/CMakeTmp<br><br>Run Build Command(s):C:/ProgramData/chocolatey/bin/ninja.exe cmTC_8a08d && [1/2] Building C object CMakeFiles\cmTC_8a08d.dir\CMakeCCompilerABI.c.obj<br><br>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles\CMakeTmp>pushd<br><br>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles\CMakeTmp>"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsamd64_x86.bat"<br>**********************************************************************<br>** Visual Studio 2017 Developer Command Prompt v15.9.16<br>** Copyright (c) 2017 Microsoft Corporation<br>**********************************************************************<br>[vcvarsall.bat] Environment initialized for: 'x64_x86'<br>[2/2] Linking C executable cmTC_8a08d.exe<br><br>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles\CMakeTmp>pushd<br><br>C:\Users\jpabreu\Desktop\testCMAKE\build_Win32_normal\CMakeFiles\CMakeTmp>"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsamd64_x86.bat"<br>**********************************************************************<br>** Visual Studio 2017 Developer Command Prompt v15.9.16<br>** Copyright (c) 2017 Microsoft Corporation<br>**********************************************************************<br>[vcvarsall.bat] Environment initialized for: 'x64_x86'<br><br><br>Cannot copy output executable<br> ''<br>to destination specified by COPY_FILE:<br> 'C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/3.15.3/CMakeDetermineCompilerABI_C.bin'<br>Unable to find the executable at any of:<br> C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/CMakeTmp/cmTC_8a08d.exe<br> C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/CMakeTmp/Debug/cmTC_8a08d.exe<br> C:/Users/jpabreu/Desktop/testCMAKE/build_Win32_normal/CMakeFiles/CMakeTmp/Development/cmTC_8a08d.exe<br></div><div>-------stop of CMakeError.log-------------------------- <br><br>I am not understanding the last error. All this files are my (are under Users/jpabreu), so I don't think that may be permission problems.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em qui, 19 de set de 2019 às 14:02, Gonzalo Garramuño <<a href="mailto:ggarra13@gmail.com">ggarra13@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p><br>
</p>
<div class="gmail-m_6545075964148512459moz-cite-prefix">El 17/9/19 a las 16:46, fdk17 escribió:<br>
</div>
<blockquote type="cite">
<div><br>
</div>
<div>I personally never seen anyone try to use the Ninja generator
via command line CMake and use the cl.exe compiler.<br>
</div>
<div>I've only seen that using Visual Studio to open a
CMakeLists.txt file it can produce a Ninja project. But even MS
documentation states that it doesn't always work.<br>
</div>
</blockquote>
<p>I use it just like that. I open a .bat file that calls vsvars
with the right settings and then calls msys bash. Find it below:</p>
<p><br>
@echo off<br>
</p>
<p>call "C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/vcvarsall.bat" amd64 8.1<br>
C:<br>
C:\MinGW\msys\1.0\msys.bat -rxvt<br>
</p>
<p>Then I call cmake and ninja with a bash script (both are in the
bash PATH). Find it attached.<br>
</p>
<p><br>
</p>
<p>--<br>
</p>
<pre class="gmail-m_6545075964148512459moz-signature" cols="72">Gonzalo Garramuño</pre>
</div>
-- <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>