aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-03-06 17:49:24 -0800
committerGerald Combs <gerald@wireshark.org>2015-03-07 02:02:19 +0000
commitacb62f1c7f8be6958c10df9d81c1c16369673825 (patch)
tree813fd03216e7756c2523cd1f9ac4307e9725568f /cmake/modules
parent394d23ed7b99e0b7f623dc5ad1ed8698691546f4 (diff)
CMake: Generate a wrapper for test.sh.
Create a wrapper script that cd's to the test directory and execs test.sh. We need to handle build configurations so the path is a bit roundabout. Change-Id: I4c2a48c041bce2479422830110b1251b3f2c5a94 Reviewed-on: https://code.wireshark.org/review/7570 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/GenerateTestSh.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/modules/GenerateTestSh.cmake b/cmake/modules/GenerateTestSh.cmake
new file mode 100644
index 0000000000..76352eb423
--- /dev/null
+++ b/cmake/modules/GenerateTestSh.cmake
@@ -0,0 +1,17 @@
+# Generate a wrapper for test.sh.
+
+set(TEST_SH_EXEC ${TEST_SH_DIR}/test.sh)
+set(TEST_SH_OUTPUT ${TEST_SH_BIN_DIR}/test.sh)
+
+file(WRITE ${TEST_SH_OUTPUT} "#!/bin/sh\n")
+file(APPEND ${TEST_SH_OUTPUT} "# Exec wrapper for ${TEST_SH_EXEC}\n")
+file(APPEND ${TEST_SH_OUTPUT} "WS_BIN_PATH=${TEST_SH_BIN_DIR}\n")
+file(APPEND ${TEST_SH_OUTPUT} "export WS_BIN_PATH\n")
+file(APPEND ${TEST_SH_OUTPUT} "WS_QT_BIN_PATH=${TEST_SH_BIN_DIR}\n")
+file(APPEND ${TEST_SH_OUTPUT} "export WS_QT_BIN_PATH\n")
+file(APPEND ${TEST_SH_OUTPUT} "cd ${TEST_SH_DIR}\n")
+file(APPEND ${TEST_SH_OUTPUT} "exec ${TEST_SH_EXEC}\n")
+
+execute_process(COMMAND chmod a+x ${TEST_SH_OUTPUT})
+
+message(STATUS "Generated ${TEST_SH_OUTPUT}") \ No newline at end of file