summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAlex Ozdemir <aozdemir@hmc.edu>2019-11-14 10:39:05 -0800
committerAndres Noetzli <andres.noetzli@gmail.com>2019-11-14 10:39:05 -0800
commit68eea7921ddfa0544e2f7936fe5f7724107df189 (patch)
tree318cad838a4026e7c3f9bc177d4ce077d51f4d65 /cmake
parent0383980050ab86b1a4f7f265d9c8527e627ef971 (diff)
Use Shebang in cxxtestgen when appropriate (#3458)
CxxTest's generator has one of three names, depending on the CxxTest version: * `cxxtestgen.py`, a python program * `cxxtestgen`, some kind of program with a shebang * `cxxtestgen.pl`, a perl program We were mistakenly assuming that the `cxxtestgen` form was always a python program. Now, if we find that form on the system, we assume that it is has a shebang, and is executable.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindCxxTest.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/FindCxxTest.cmake b/cmake/FindCxxTest.cmake
index cd7aed70d..2348edb98 100644
--- a/cmake/FindCxxTest.cmake
+++ b/cmake/FindCxxTest.cmake
@@ -20,11 +20,16 @@ find_program(CxxTest_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
if(NOT CxxTest_HOME)
find_path(CxxTest_INCLUDE_DIR cxxtest/TestSuite.h)
- find_program(CxxTest_PYTHON_TESTGEN_EXECUTABLE NAMES cxxtestgen cxxtestgen.py)
+ find_program(CxxTest_PYTHON_TESTGEN_EXECUTABLE NAMES cxxtestgen.py)
+ find_program(CxxTest_SHEBANG_TESTGEN_EXECUTABLE NAMES cxxtestgen)
find_program(CxxTest_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl)
endif()
-if(PYTHONINTERP_FOUND AND CxxTest_PYTHON_TESTGEN_EXECUTABLE)
+
+if(CxxTest_SHEBANG_TESTGEN_EXECUTABLE)
+ set(CxxTest_USE_SHEBANG ON)
+ set(CxxTest_TESTGEN_EXECUTABLE ${CxxTest_SHEBANG_TESTGEN_EXECUTABLE})
+elseif(PYTHONINTERP_FOUND AND CxxTest_PYTHON_TESTGEN_EXECUTABLE)
set(CxxTest_TESTGEN_EXECUTABLE ${CxxTest_PYTHON_TESTGEN_EXECUTABLE})
set(CxxTest_TESTGEN_INTERPRETER ${PYTHON_EXECUTABLE})
elseif(PERL_FOUND AND CxxTest_PERL_TESTGEN_EXECUTABLE)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback