# See: https://github.com/shlomif/fortune-mod/issues/58
+SET (_target_rot "${CMAKE_CURRENT_BINARY_DIR}/../../rot")
if ("${IS_CROSS}")
- SET (_rot "rot")
+ SET (_rot ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/../../util/rot.pl")
else()
- SET (_rot "${CMAKE_CURRENT_BINARY_DIR}/../../rot")
+ SET (_rot "${_target_rot}")
endif()
SET (rot_dir "${CMAKE_CURRENT_BINARY_DIR}/rotated")
FILE(MAKE_DIRECTORY "${rot_dir}")
SET(PATH_PERL ${PERL_EXECUTABLE})
ADD_CUSTOM_COMMAND(
OUTPUT "${rot_dest}"
- COMMAND "${_rot}"
- ARGS "<" "${SOURCE}" ">" "${rot_dest}"
- DEPENDS "${SOURCE}" "${_rot}"
+ COMMAND ${_rot} "<" "${SOURCE}" ">" "${rot_dest}"
+ DEPENDS "${SOURCE}" "${_target_rot}"
)
ADD_CUSTOM_COMMAND(
OUTPUT "${DEST}"
--- /dev/null
+#! /usr/bin/env perl
+#
+# Short description for rot.pl
+#
+# rot13 for cross compiling builds:
+# https://github.com/shlomif/fortune-mod/issues/58
+# Version 0.0.1
+# Copyright (C) 2021 Shlomi Fish < https://www.shlomifish.org/ >
+#
+# Licensed under the terms of the MIT license.
+
+use strict;
+use warnings;
+use autodie;
+
+while (<>)
+{
+ tr/A-Za-z/N-ZA-Mn-za-m/;
+ print $_;
+}