Open
Description
In our instructions to build a dev environment, we mention that tzdata
is required to run some unit tests that do data conversion. However, this instruction is easy to overlook, which leaves developers with failed test without an obvious reason or error message.
I suggest to add tzdata
as a CMake requirement for building test targets that perform corresponding data time transformations (ml::core?). Unfortunately, tzdata
is not a library or binary, but a system package. Nonetheless, we could check if the timezone databases exist in the typical system paths and output a meaningful error message if not.
For example:
find_file(TZDATA_FILE NAMES "UTC" PATHS "/usr/share/zoneinfo" "/usr/lib/zoneinfo")
if(NOT TZDATA_FILE)
message(FATAL_ERROR "tzdata is not installed or not found. Please install tzdata on your system.")
else()
message(STATUS "tzdata found.")
endif()