Tuesday, October 4, 2022

[SOLVED] I can't build and install a project with Cmake on Jenkins

Issue

I really need some help to build a simple project with Cmake with Jenkins.

I downloaded the Cmake plugin on Jenkins.

I configured it in the job :

href="https://i.stack.imgur.com/etNsJ.png" rel="nofollow noreferrer">enter image description here

and in Global Tool Configuration :

enter image description here

But then it doesn't work. Here are the end of the logs before the Jenkins build fails :

+ ls
CMakeLists.txt
MathFunctions
TutorialConfig.h.in
build
tutorial.cxx
[build] $ cmake /var/jenkins_home/workspace/Project
ERROR: Cannot run program "cmake" (in directory "/var/jenkins_home/workspace/Project/build"): error=2, No such file or directory
Build step 'CMake Build' marked build as failure
Finished: FAILURE

I don't understand why there is no proper step-by-step tutorial to create something that common as a Cmake build with Jenkins.


Solution

In the end, I managed to pull it off.

I uninstalled the Cmake plugin which seems to be useless apparently...

And I simply installed Cmake manually on the Jenkins container.



Answered By - Autechre
Answer Checked By - Terry (WPSolving Volunteer)