]> granicus.if.org Git - fortune-mod/commitdiff
try to fix crosscompiling builds
authorShlomi Fish <shlomif@shlomifish.org>
Mon, 13 Dec 2021 13:56:19 +0000 (15:56 +0200)
committerShlomi Fish <shlomif@shlomifish.org>
Mon, 13 Dec 2021 13:56:19 +0000 (15:56 +0200)
See: https://github.com/shlomif/fortune-mod/issues/58

use the native strfile from PATH
Thanks to https://github.com/leleliu008

fortune-mod/CMakeLists.txt
fortune-mod/datfiles/CMakeLists.txt
fortune-mod/datfiles/off/CMakeLists.txt

index 4d8cd8262d919d384b4a89fc5bb60bedee24f2e5..c6b99418849bd8c953ce49fc58b3763c222e805a 100644 (file)
@@ -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")
index 324c5f9433b3f4e4396b6203aea44898e5b69741..f2b0cc07bd74770881e73ecbb65a01a5a1f5d9ea 100644 (file)
@@ -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})
index 4119f368d18c49887b06ea31294f853731c65fe5..6d6b57ad5ebfbb5679eec0ea5403070afa902ef4 100644 (file)
@@ -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 )