ROOT_GENERATE_DICTIONARY failing with CMake 3.11 and ROOT 6.14.02

_ROOT Version: 6.14.02
Platform: SL6
Compiler: GCC 6.2

Full setup:
source /cvmfs/

Using ROOT_GENERATE_DICTIONARY in a CMake project to generate dictionaries results in

[ 66%] Generating MyEvent_dict.cxx, ../lib/libMyEvent_dict_rdict.pcm, ../lib/libMy_dict.rootmap
CMake Error: cmake version 3.11.1
Usage: /cvmfs/ -E <command> [arguments...]
<snip help text>

I can only assume it comes from this line

As cmake -E rootcling is not a registered command (do the ROOT macros add that)?



PS: This is the commit that introduced the change ~8 months ago:

The version of ROOT I used before this issue occurred was 6.04.02

If instead of


I use


I can generate the dictionaries.
→ the previous version of RootNewMacros.cmake works with 6.14.02

I sources LCG_94rc1 and rootcling command is available in PATH, I don’t think the problem is actually there.
Can you try to post an output running make with with VERBOSE=1?

@oshadura Thanks for looking into this.
The problem is not that rootcling is not in PATH, since it is. rootcling by itself works.

But ROOT_GENERATE_DICTIONARY calls cmake -E rootcling which is invalid
→ problem with the macro.

Running VERBOSE=1 make shows:

[ 61%] Generating MyEvent_dict.cxx, ../lib/libMyEvent_dict_rdict.pcm, ../lib/libMyEvent_dict.rootmap
cd /code/sim/myproject/build.x86_64-slc6-gcc62-opt/tools && /cvmfs/ -E rootcling -v2 -f MyEvent_dict.cxx -s /code/sim/myproject/build.x86_64-slc6-gcc62-opt/lib/ -rml -rmf /code/sim/myproject/build.x86_64-slc6-gcc62-opt/lib/libMyEvent_dict.rootmap -DG4_STORE_TRAJECTORY -DG4VERBOSE -DG4GEOM_USE_USOLIDS -DVECCORE_ENABLE_VC -DVECGEOM_VC -DVECGEOM_REPLACE_USOLIDS -DVECGEOM_QUADRILATERALS_VC -DVECGEOM_NO_SPECIALIZATION -DVECGEOM_ROOT -DVECGEOM_USOLIDS -DVECGEOM_INPLACE_TRANSFORMATIONS -DVECGEOM_USE_INDEXEDNAVSTATES -DG4UI_USE -DG4VIS_USE -DG4MULTITHREADED -DG4UI_USE_TCSH -DG4INTY_USE_XT -DG4VIS_USE_RAYTRACERX -DG4INTY_USE_QT -DG4UI_USE_QT -DG4VIS_USE_OPENGLQT -DG4UI_USE_XM -DG4VIS_USE_OPENGLXM -DG4VIS_USE_OPENGLX -DG4VIS_USE_OPENGL -DMP_USE_GDML -I/cvmfs/ -I/cvmfs/ -I/cvmfs/ -I/cvmfs/ -I/cvmfs/ -I/cvmfs/ -I/cvmfs/ -I/code/sim/myproject/include -I/code/sim/myproject/tools/. -I/code/sim/myproject/tools/include /code/sim/myproject/tools/MyEvent.hh /code/sim/myproject/tools/MyEvent_LinkDef.h
CMake Error: cmake version 3.11.1
Usage: /cvmfs/ -E <command> [arguments...]
Available commands:
  capabilities              - Report capabilities built into cmake in JSON format
  chdir dir cmd [args...]   - run command in a given directory
  compare_files file1 file2 - check if file1 is same as file2
  copy <file>... destination  - copy files to destination (either file or directory)
  copy_directory <dir>... destination   - copy content of <dir>... directories to 'destination' directory
  copy_if_different <file>... destination  - copy files if it has changed
  echo [<string>...]        - displays arguments as text
  echo_append [<string>...] - displays arguments as text but no new line
  env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...
                            - run command in a modified environment
  environment               - display the current environment
  make_directory <dir>...   - create parent and <dir> directories
  md5sum <file>...          - create MD5 checksum of files
  sha1sum <file>...         - create SHA1 checksum of files
  sha224sum <file>...       - create SHA224 checksum of files
  sha256sum <file>...       - create SHA256 checksum of files
  sha384sum <file>...       - create SHA384 checksum of files
  sha512sum <file>...       - create SHA512 checksum of files
  remove [-f] <file>...     - remove the file(s), use -f to force it
  remove_directory dir      - remove a directory and its contents
  rename oldname newname    - rename a file or directory (on one volume)
  server                    - start cmake in server mode
  sleep <number>...         - sleep for given number of seconds
  tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]
                            - create or extract a tar or zip archive
  time command [args...]    - run command and display elapsed time
  touch file                - touch a file.
  touch_nocreate file       - touch a file but do not create it.
Available on UNIX only:
  create_symlink old new    - create a symbolic link new -> old

as you can see, cmake complains about incorrect usage of cmake -E

Now I see what you mean, @Luke_K, you are absolutely right!
Thank you for a catch! I will submit a fix in both master and 6.14 patch branches.

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