See: https://github.com/shlomif/fortune-mod/issues/58
use the native strfile from PATH
Thanks to https://github.com/leleliu008
CMAKE_POLICY(SET CMP0054 NEW)
+# see: https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING.html
+SET (IS_CROSS "${CMAKE_CROSSCOMPILING}")
+
INCLUDE(FindPkgConfig)
SET (PKGDATADIR_SUBDIR "fortune-mod")
-SET (_strfile "${CMAKE_CURRENT_BINARY_DIR}/../strfile")
+# See: https://github.com/shlomif/fortune-mod/issues/58
+if ("${IS_CROSS}")
+ SET (_strfile "strfile")
+else()
+ SET (_strfile "${CMAKE_CURRENT_BINARY_DIR}/../strfile")
+endif()
SET (_unrot_cookies )
SET (_install_unrot_cookies )
FOREACH(c ${COOKIES})
-SET (_strfile "${CMAKE_CURRENT_BINARY_DIR}/../../strfile")
-SET (_rot "${CMAKE_CURRENT_BINARY_DIR}/../../rot")
+# See: https://github.com/shlomif/fortune-mod/issues/58
+if ("${IS_CROSS}")
+ SET (_rot "rot")
+else()
+ SET (_rot "${CMAKE_CURRENT_BINARY_DIR}/../../rot")
+endif()
SET (rot_dir "${CMAKE_CURRENT_BINARY_DIR}/rotated")
FILE(MAKE_DIRECTORY "${rot_dir}")
SET (_rotated_cookies )