JeffersonLab / hcana

Hall C++ Analyzer
7 stars 118 forks source link

CMake build broken #378

Closed whit2333 closed 6 years ago

whit2333 commented 6 years ago
CMake Error at CMakeLists.txt:11 (include):
  include could not find load file:

    PoddCMakeEnv

CMake Error at CMakeLists.txt:20 (find_package):
  No "FindROOT.cmake" found in CMAKE_MODULE_PATH.

FindROOT.cmake should not be installed by analyzer. ROOT comes fully equipped. This is literally undoing the point of using cmake.

hansenjo commented 6 years ago

The actual problem is that PoddCMakeEnv isn't found. It's a bit hard to see how that can happen. Did you update the podd submodule? It should be in podd/cmake/Modules.

FindROOT.cmake will be in the same place as PoddCMakeEnv.cmake, so your second problem will go away then as well.

If you think that "ROOT comes fully equipped" for CMake projects, think again. ROOT's CMake config file has a variety of problems. There are comments on top of podd/cmake/Modules/FindROOT.cmake explaining some of the issues, in particular relating to RHEL EPEL installations. And as even you have realized, ROOT's dictionary generator CMake function does not work well. In our case, ROOT's implementation flat-out fails to add all required include directories and compile definitions. Also, see for example here and read under the heading "The too-simple way" for a discussion why simply plopping ROOT_USE_FILE into your build is a rather sledgehammery way of doing things. If you then go for what the author describes as "The right way (Targets)," with which I largely agree, you quickly have a page of code on your hand and might just as well make a dedicated ROOT setup function. The final show-stopper is that ROOT 5 has no CMake support, and I already said we need to support it for the time being. Our FindROOT does all that, and it's already written. Just use it as it is, it should be completely transparent to you.

sawjlab commented 6 years ago

CMake seems to be working with hcana now.