Problems with FindROOT.cmake

Hi,

I try to build my project using cmake instead of straight makefiles. When I try to use the provided FindROOT.cmake of my root installation (5.34.03) I get this error when doing cmake:

/home/iwsatlas1/wildauer/afsgarching/work/FullHadronicAnalysis/build> cmake ../
-- Found ROOT 5.34/03 in /home/iwsatlas1/wildauer/programs/root/current
CMake Error at FindROOT.cmake:51 (include):
  include could not find load file:

    CMakeMacroParseArguments
Call Stack (most recent call first):
  CMakeLists.txt:4 (include)


-- Configuring incomplete, errors occurred!
==============================================

This CMakeMacroParseArguments seems to be there
cmake/modules/CMakeMacroParseArguments.cmake
within the root installation.

Any ideas what I need to change? Should I give the full path or use the ROOTSYS variable?

Cheers
Andi

P.S.: in my CMakeLists.txt I do this that it knows root

include(FindROOT.cmake)

set(INCLUDE_DIRECTORIES
${ROOT_INCLUDE_DIR} 
)

include_directories( ${INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
)
 
link_directories( ${LINK_DIRECTORIES})

Hi there,

This is a bug in ROOT that is mixing different versions of CMake definitions.

You must edit /opt/local/etc/root/cmake/FindROOT.cmake and in line 51 change:

include(CMakeMacroParseArguments)

to:

include(CMakeParseArguments)

After that it should compile fine with CMake.

Hi,

thanks! Now it works.

cheers
Andi

hi,
can U write the answer once again. I cannot see …
I have to change CMakeMacroParseArguments to what?

Done.