AIDASoft / DD4hep

Detector Description Toolkit for High Energy Physics
http://dd4hep.cern.ch
GNU Lesser General Public License v3.0
50 stars 99 forks source link

including specific version of DD4hep in cmake using find_package is broken #149

Closed cgumpert closed 7 years ago

cgumpert commented 7 years ago

Hi,

we (= the ACTS project) is relying on DD4hep for parts of our code. We use cmake as build configuration system and include the DD4hep dependencies in our CMakeLists.txt by lines like the following:

find_package (DD4hep 0.20 COMPONENTS DDCore DDSegmentation)

We make sure that the CMAKE_PREFIX_PATH include the DD4hep installation directory. However, the cmake configuration fails with the following error:

CMake Warning at Plugins/DD4hepPlugins/CMakeLists.txt:9 (find_package): Could not find a configuration file for package "DD4hep" that is compatible with requested version "0.20".

The following configuration files were considered but not accepted:

/opt/dd4hep/DD4hepConfig.cmake, version: unknown

Please note that the configuration succeeds if we do not request a minimum DD4hep version. We believe that this failure is caused by a missing DD4hepConfigVersion.cmake file.

We see that the package configuration files are supposed to be prepared with the code at CMakeLists.txt#L155 cmake/DD4hepMacros.cmake#L70

However, there is no DD4hepConfigVersion.cmake.in inside the cmake. (In general, the whole cmake package configuration setup seems to be overly complicated. There are standard cmake helpers for generating package configuration files.)

Cheers, Christian

cgumpert commented 7 years ago

Notifying @vvolkl and @jhrdinka

andresailer commented 7 years ago

@cgumpert Please test

jhrdinka commented 7 years ago

I tested is now and it is working fine.

andresailer commented 7 years ago

Ok, thanks.

cgumpert commented 7 years ago

Thanks for the quick fix. Would it be possible to make a new tag with this fix included?

Thanks, Christian

andresailer commented 7 years ago

yes, will make a new tag on Monday

cgumpert commented 7 years ago

@andresailer Thanks, please let us know once the tag was created. Then we can also make a new tag for the ACTS package which the FCC developers are waiting for (apologies for acronym overload).

andresailer commented 7 years ago

I've made the new tag: https://github.com/AIDASoft/DD4hep/releases/tag/v00-22