From: Shlomi Fish Date: Mon, 13 Dec 2021 13:56:19 +0000 (+0200) Subject: try to fix crosscompiling builds X-Git-Tag: fortune-mod-3.8.0~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee157356be6a9f0e6fe4211829a9ac04521e35cd;p=fortune-mod try to fix crosscompiling builds See: https://github.com/shlomif/fortune-mod/issues/58 use the native strfile from PATH Thanks to https://github.com/leleliu008 --- diff --git a/fortune-mod/CMakeLists.txt b/fortune-mod/CMakeLists.txt index 4d8cd82..c6b9941 100644 --- a/fortune-mod/CMakeLists.txt +++ b/fortune-mod/CMakeLists.txt @@ -7,6 +7,9 @@ SHLOMIF_COMMON_SETUP("${private_mod_path}") 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") diff --git a/fortune-mod/datfiles/CMakeLists.txt b/fortune-mod/datfiles/CMakeLists.txt index 324c5f9..f2b0cc0 100644 --- a/fortune-mod/datfiles/CMakeLists.txt +++ b/fortune-mod/datfiles/CMakeLists.txt @@ -1,4 +1,9 @@ -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}) diff --git a/fortune-mod/datfiles/off/CMakeLists.txt b/fortune-mod/datfiles/off/CMakeLists.txt index 4119f36..6d6b57a 100644 --- a/fortune-mod/datfiles/off/CMakeLists.txt +++ b/fortune-mod/datfiles/off/CMakeLists.txt @@ -1,5 +1,9 @@ -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 )