Reputation: 101
I have set up cmake tool under the Global tool configuration in Jenkins. I tried to reference it in my jenkinsfile but the build is giving this error:
'cmake is not a recognised command'.
This is how i am referencing it in the jenkinsfile :
stage('run CMake')
{
bat '''
mkdir build
cd build
cmake -DBOOST_ROOT=E:/local/boost_1_64_0 -DOPC_UA_FRAMEWORK_ROOT=E:/local/bhi-opcuaframework-1.2.0-win32
And this is the configuration of CMake in the Jenkins dashboard:
This is how my setting in global tool config looks like.
How do i correctly reference the tool in the pipeline?
Please help!!
Upvotes: 0
Views: 6058
Reputation: 7982
Use the tool
step:
stage('run CMake')
{
def cmakePath = tool 'CMake'
bat """
mkdir build
cd build
${cmakePath}\\cmake -DBOOST_ROOT=...
"""
}
Upvotes: 3
Reputation: 19
Do you have cmake installed on jenkins master? if not try to install it using installer.
Check the jenkins cmake wiki page screenshot check below, install it using installer if you haven't already check this help:
Upvotes: -1