[CMake] conflict between configure & build steps in gitlab-runner script for Windows: Debug or Release build directory not found

Craig Scott craig.scott at crascit.com
Sat Mar 23 04:17:37 EDT 2019


You have put -j8 before the --build option, but the --build option must be
the first one. This ordering requirement is stated in the docs
<https://cmake.org/cmake/help/latest/manual/cmake.1.html#build-a-project> for
the --build option in the "Build A Project" section.


On Sat, Mar 23, 2019 at 1:00 AM Joachim Wuttke <j.wuttke at fz-juelich.de>
wrote:

> A gitlab-runner configuration script .gitlab-ci.yml, for execution in the
> Powershell:
>
> ===
> windows:
>    tags:
>    - windows
>    stage: build
>    script:
>      - New-Item -ItemType "directory" -Confirm:$false -Force:$true -Name
> "build"
>      - cd build
>      - cmd.exe "C:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
>      - cmake -G "Visual Studio 15 2017" -A x64 -T host=x64 -DCERF_CPP=ON
> -DLIB_MAN=OFF -DLIB_INSTALL=OFF -B. ..
>      - cmake -j8 --build . --config Debug
>      - ctest -j4
> ===
>
> results in
>
> ===
> $ cd build
> $ cmd.exe "C:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
> Microsoft Windows [Version 10.0.17134.648]
> (c) 2018 Microsoft Corporation. All rights reserved.
>
> 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. ..
> -- The CXX compiler identification is MSVC 19.16.27026.1
> -- 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
> -- 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
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> Build C++ library libcerfcpp
> -- libcerf/lib: build library cerfcpp, CERF_CPP=ON, shared=ON
> -- Configuring done
> -- Generating done
> -- Build files have been written to:
> C:/gitlab-runner/builds/xxxxxxxx/libcerf/build
> $ cmake -j8 --build . --config Debug
> CMake Error: The source directory
> "C:/gitlab-runner/builds/xxxxxxxx/libcerf/build/Debug" does not exist.
> Specify --help for usage, or press the help button on the CMake GUI.
>
> ERROR: Job failed: exit status 1
> ===
>
> How to resolve this conflict between the configure step (cmake) and
> the build step (cmake --build)?
>
> The latter won't work without the option "--config Debug";
> but if that option is given, then it looks for a nonexistent directory.
>
> The same problem occurs with "--config Release".
>
> /Joachim
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>


-- 
Craig Scott
Melbourne, Australia
https://crascit.com

Get the hand-book for every CMake user: Professional CMake: A Practical
Guide <https://crascit.com/professional-cmake/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190323/5cdb4254/attachment-0001.html>


More information about the CMake mailing list