Commit a5561376 authored by Droscy's avatar Droscy Committed by Brad King

FindCxxTest: Add support for CxxTest 4 (#13022)

In CxxTest version 4 the Perl generator has been deleted and the
Python generator is installed without the ".py" extension.
parent ec50093b
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# Only used in the case both Python & Perl # Only used in the case both Python & Perl
# are detected on the system to control # are detected on the system to control
# which CxxTest code generator is used. # which CxxTest code generator is used.
# Valid only for CxxTest version 3.
# #
# NOTE: In older versions of this Find Module, # NOTE: In older versions of this Find Module,
# this variable controlled if the Python test # this variable controlled if the Python test
...@@ -159,7 +160,8 @@ find_package(PythonInterp QUIET) ...@@ -159,7 +160,8 @@ find_package(PythonInterp QUIET)
find_package(Perl QUIET) find_package(Perl QUIET)
find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h) find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE
NAMES cxxtestgen cxxtestgen.py
PATHS ${CXXTEST_INCLUDE_DIR}) PATHS ${CXXTEST_INCLUDE_DIR})
find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
PATHS ${CXXTEST_INCLUDE_DIR}) PATHS ${CXXTEST_INCLUDE_DIR})
...@@ -167,7 +169,7 @@ find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl ...@@ -167,7 +169,7 @@ find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
if(PYTHONINTERP_FOUND OR PERL_FOUND) if(PYTHONINTERP_FOUND OR PERL_FOUND)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND)) if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND OR NOT DEFINED CXXTEST_USE_PYTHON))
set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE}) set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
set(CXXTEST_TESTGEN_INTERPRETER ${PYTHON_EXECUTABLE}) set(CXXTEST_TESTGEN_INTERPRETER ${PYTHON_EXECUTABLE})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment