Über den Umzug eines Unraid-Servers

Die Hardware des bestehenden Unraid-Servers ist schon etwas in die Jahre gekommen, langsam und verbraucht viel zu viel Strom für die gebotene Rechenleistung. Die neue Hardware ist nach der Ct-Anleitung 17-Watt-Heimserver unter 400 Euro bereits zusammengeschraubt und wartet auf die Inbetriebnahme.

Im Folgenden beschriebe ich das Vorgehen.

Continue reading “Über den Umzug eines Unraid-Servers”

CMake: Parent directory and trailing slashes

The task is to get the parent directory of a given directory where the given directory is already known to be a directory.

An example where the input directory is already known to be a directory (and not a file) is a target include directory (properties INCLUDE_DIRECTORIES and INTERFACE_INCLUDE_DIRECTORIES).

With CMake prior to version 3.20 there is the get_filename_component function:

get_filename_component(filename_component "${directory}" DIRECTORY)

With CMake >= 3.20 get_filename_component is deprecated in favor of cmake_path. A naive way would be to directly call this function:

cmake_path(GET directory PARENT_PATH cmake_path_naive)

But there is a glitch with cmake_path when directory already contains a trailing slash (“/”).

Continue reading “CMake: Parent directory and trailing slashes”