<div dir="ltr"><div dir="ltr">You have put -j8 before the --build option, but the --build option must be the first one. This ordering requirement is <a href="https://cmake.org/cmake/help/latest/manual/cmake.1.html#build-a-project">stated in the docs</a> for the --build option in the "Build A Project" section.</div><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 23, 2019 at 1:00 AM Joachim Wuttke <<a href="mailto:j.wuttke@fz-juelich.de">j.wuttke@fz-juelich.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">A gitlab-runner configuration script .gitlab-ci.yml, for execution in the Powershell:<br>
<br>
===<br>
windows:<br>
   tags:<br>
   - windows<br>
   stage: build<br>
   script:<br>
     - New-Item -ItemType "directory" -Confirm:$false -Force:$true -Name "build"<br>
     - cd build<br>
     - cmd.exe "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"<br>
     - cmake -G "Visual Studio 15 2017" -A x64 -T host=x64 -DCERF_CPP=ON -DLIB_MAN=OFF -DLIB_INSTALL=OFF -B. ..<br>
     - cmake -j8 --build . --config Debug<br>
     - ctest -j4<br>
===<br>
<br>
results in<br>
<br>
===<br>
$ cd build<br>
$ cmd.exe "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"<br>
Microsoft Windows [Version 10.0.17134.648]<br>
(c) 2018 Microsoft Corporation. All rights reserved.<br>
<br>
C:\gitlab-runner\builds\s-nngMTK\0\mlz\libcerf\build>$ cmake -G "Visual Studio 15 2017" -A x64 -T host=x64 -DCERF_CPP=ON -DLIB_MAN=OFF -DLIB_INSTALL=OFF -B. ..<br>
-- The CXX compiler identification is MSVC 19.16.27026.1<br>
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe<br>
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe -- 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>
Build C++ library libcerfcpp<br>
-- libcerf/lib: build library cerfcpp, CERF_CPP=ON, shared=ON<br>
-- Configuring done<br>
-- Generating done<br>
-- Build files have been written to: C:/gitlab-runner/builds/xxxxxxxx/libcerf/build<br>
$ cmake -j8 --build . --config Debug<br>
CMake Error: The source directory "C:/gitlab-runner/builds/xxxxxxxx/libcerf/build/Debug" does not exist.<br>
Specify --help for usage, or press the help button on the CMake GUI.<br>
<br>
ERROR: Job failed: exit status 1<br>
===<br>
<br>
How to resolve this conflict between the configure step (cmake) and<br>
the build step (cmake --build)?<br>
<br>
The latter won't work without the option "--config Debug";<br>
but if that option is given, then it looks for a nonexistent directory.<br>
<br>
The same problem occurs with "--config Release".<br>
<br>
/Joachim<br>
<br>
<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/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><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>Get the hand-book for every CMake user: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div>