diff options
author | Alex Ozdemir <aozdemir@hmc.edu> | 2019-11-14 10:39:05 -0800 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2019-11-14 10:39:05 -0800 |
commit | 68eea7921ddfa0544e2f7936fe5f7724107df189 (patch) | |
tree | 318cad838a4026e7c3f9bc177d4ce077d51f4d65 /cmake | |
parent | 0383980050ab86b1a4f7f265d9c8527e627ef971 (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.cmake | 9 |
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) |