summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2020-02-05 01:07:52 -0800
committerGuy Harris <guy@alum.mit.edu>2020-02-05 01:07:52 -0800
commit74224d189c21428c84747a4cfd7c13621f30f95c (patch)
tree341530fd2b82df768e01aa0331b58a05da7b94cc /CMakeLists.txt
parentd0963e4032ab61e2cc58c32b397f4d289a398a75 (diff)
downloadtcpdump-74224d189c21428c84747a4cfd7c13621f30f95c.tar.gz
Don't assume a Perl script can be run directly as a command.
That's not the case on Windows - it doesn't support #!. Look for the perl interpreter and, if we find it, add a rule that runs tests/TESTrun with the interpreter.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b946c17d..626f090a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1200,6 +1200,15 @@ add_custom_target(uninstall
#
# Tcpdump tests
-#
-add_custom_target(check
- COMMAND ${CMAKE_SOURCE_DIR}/tests/TESTrun)
+# We try to find the Perl interpreter and, if we do, we have the check
+# rule run tests/TESTrun with it, because just trying to run the TESTrun
+# script as a command won't work on Windows.
+#
+find_program(PERL perl)
+if(PERL)
+ message(STATUS "Found perl at ${PERL}")
+ add_custom_target(check
+ COMMAND ${PERL} ${CMAKE_SOURCE_DIR}/tests/TESTrun)
+else()
+ message(STATUS "Didn't find perl")
+endif()