mkspecs/hb_functions.prf
changeset 30 80e4d18b72f5
parent 23 e6ad4ef83b23
--- a/mkspecs/hb_functions.prf	Fri Sep 17 08:32:10 2010 +0300
+++ b/mkspecs/hb_functions.prf	Mon Oct 04 00:38:12 2010 +0300
@@ -88,6 +88,20 @@
     return(true)
 }
 
+# params: <sourcepath> <targetpath>
+# e.g. hbToolExport("$${HB_BUILD_DIR}/bin/docml2bin", "$${HB_BIN_DIR}/docml2bin")
+defineTest(hbToolExport) {
+    contains(QMAKE_HOST.os, Windows) {
+        1 = "$${1}.exe"
+        2 = "$${2}.exe"
+    }
+    exists($$1) {
+        hbPrjExport($$1, $$2)
+        return(true)
+    }
+    return(false)
+}
+
 # params: <collection>
 # NOTE: exports PUBLIC_HEADERS, RESTRICTED_HEADERS and CONVENIENCE_HEADERS
 # eg. hbExportHeaders(hbcore)
@@ -197,3 +211,20 @@
 
     return(($$chk_dir_exists_mkdir) && $$copy)
 }
+
+defineReplace(hbCreateDir) {
+    dir = $$hbNativePath($$1)
+
+    contains(QMAKE_HOST.os, Windows):isEmpty(QMAKE_SH) {
+        chk_dir_exists = if not exist $$dir
+        mkdir = mkdir $$dir
+    } else {
+        chk_dir_exists = test -d $$dir
+        mkdir = mkdir -p $$dir
+    }
+
+    hbUnixStyle(): chk_dir_exists_mkdir = $$chk_dir_exists || $$mkdir
+    else:chk_dir_exists_mkdir = $$chk_dir_exists $$mkdir
+
+    return($$chk_dir_exists_mkdir)
+}