chrono icon indicating copy to clipboard operation
chrono copied to clipboard

ChronoConfig.cmake isn't installed in correct folder

Open mablanchard opened this issue 4 years ago • 1 comments

Building Chrono 4.0.0, the CMake config. script get installed as <prefix>/<libdir>/cmake/ChronoConfig.cmake. This is somehow unfortunate because this is not a location CMake's find_package() search procedure would search for ChronoConfig.cmake, leading to errors of the kind:

-- Could NOT find Chrono (missing: Chrono_DIR)

I believe a better location would be <prefix>/<libdir>/cmake/Chrono/ChronoConfig.cmake which would allow something like the snippet below to just work:

find_package(
  Chrono CONFIG
  HINTS
    "${prefix}")

mablanchard avatar Feb 16 '21 20:02 mablanchard

A workaround would be something like:

set(Chrono_DIR "${prefix}/lib/cmake")
find_package(
  Chrono CONFIG)

mablanchard avatar Feb 16 '21 20:02 mablanchard

fix in https://github.com/projectchrono/chrono/pull/421

scpeters avatar Oct 01 '22 06:10 scpeters