Building from source with CMake results in an error

Since an installation via .exe does not work I’m trying to build ROOT from source now:

C:\ROOT\install_dir> cmake -DCMAKE_INSTALL_PREFIX=C:\ROOT\install_dir C:\Users\User\Downloads\root_v6.26.02.source\root-6.26.02
– Building for: NMake Makefiles
CMake Deprecation Warning at CMakeLists.txt:12 (cmake_policy):
The OLD behavior for policy CMP0091 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

CMake Error at CMakeLists.txt:30 (project):

‘nmake’ ‘-?’

failed with:

The system cannot find the file specified

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
– Configuring incomplete, errors occurred!
See also “C:/ROOT/install_dir/CMakeFiles/CMakeOutput.log”.


I followed exactly Building ROOT from source - ROOT so I don’t know what’s wrong here. It seems further parameters need to be passed to the entered command but which and why isn’t it given in the instruction?

What doesn’t work? How does it fail?
And please take a look at the end of Installing ROOT - ROOT to see how to build from source on Windows. You should do something like this:

cmake -G"Visual Studio 16 2019" -A Win32 -Thost=x64 -DCMAKE_INSTALL_PREFIX=C:\ROOT\install_dir C:\Users\User\Downloads\root_v6.26.02.source\root-6.26.02

and then:

cmake --build . --config Release --target install
1 Like

thank you, though I don’t need it anymore but at least I know now what the command should look like.
At least in principle.

Is there an “easy” way to look up all those --build --config --target options?
Just for curiousity and god’s sake :slight_smile:

The build options are the ones available with Visual Studio: Debug, Release, RelWithDebInfo, and MinSizeRel. See CMAKE_BUILD_TYPE — CMake 3.23.1 Documentation

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.