]> granicus.if.org Git - fortune-mod/commitdiff
Convert to shlomif_common_bootstrap.
authorShlomi Fish <shlomif@shlomifish.org>
Wed, 31 Jan 2018 12:38:11 +0000 (14:38 +0200)
committerShlomi Fish <shlomif@shlomifish.org>
Wed, 31 Jan 2018 12:38:11 +0000 (14:38 +0200)
This will help people who use the GitHub source.

fortune-mod/CMakeLists.txt
fortune-mod/cmake/shlomif_common_bootstrap.cmake [new file with mode: 0644]

index e76b1f40dd83d0cf0c67d14ce686d2fbe4eab2d8..2ef6baea67679b1089a7059129de036144808b5c 100644 (file)
@@ -1,9 +1,6 @@
 cmake_minimum_required(VERSION 3.2)
 
-SET (private_mod_path "${CMAKE_SOURCE_DIR}/cmake")
-LIST (APPEND CMAKE_MODULE_PATH "${private_mod_path}")
-INCLUDE(Shlomif_Common)
-
+INCLUDE ("${CMAKE_SOURCE_DIR}/cmake/shlomif_common_bootstrap.cmake")
 SHLOMIF_COMMON_SETUP("${private_mod_path}")
 
 CMAKE_POLICY(SET CMP0054 NEW)
diff --git a/fortune-mod/cmake/shlomif_common_bootstrap.cmake b/fortune-mod/cmake/shlomif_common_bootstrap.cmake
new file mode 100644 (file)
index 0000000..8ee7112
--- /dev/null
@@ -0,0 +1,10 @@
+SET (private_mod_path "${CMAKE_SOURCE_DIR}/cmake")
+LIST (APPEND CMAKE_MODULE_PATH "${private_mod_path}")
+SET (_result)
+INCLUDE(Shlomif_Common OPTIONAL RESULT_VARIABLE _result)
+
+IF ("${_result}" STREQUAL "NOTFOUND")
+    MESSAGE (WARNING "Could not find Shlomif_Common.cmake - you can find it here: https://bitbucket.org/shlomif/shlomif-cmake-modules/overview ; trying to download it for you.")
+    FILE (DOWNLOAD "https://bitbucket.org/shlomif/shlomif-cmake-modules/raw/default/shlomif-cmake-modules/Shlomif_Common.cmake" "${private_mod_path}/Shlomif_Common.cmake")
+    INCLUDE(Shlomif_Common)
+ENDIF ()