OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-cogutil commits / 31af9b6

Fix up the FindCxxtest script
31af9b6f21b4082f833170374ee2479cf4045f0a
by Linas Vepstas <linasvepstas@gmail.com> · 2025-12-15T22:29:45.000Z

Changed files (1) +24 -27

cmake/FindCxxtest.cmake +24 -27
……@@ -11,43 +11,40 @@
1111# CXXTEST_BIN_DIR environment variable must have been defined already
1212
1313# cxxtest has a Python version and a Perl version. First, look
14# for the Python version.
15FIND_PACKAGE(Python3 COMPONENTS Interpreter)
16IF (Python3_Interpreter_FOUND)
17 # Look for the .py version first. Some versions of cxxtest have a
18 # non-py version, but it crashes and burns, so, use the .py version
19 # preferentially, in order to maintain compatibility across (all??)
20 # versions of cxxtest
21 FIND_PATH(CXXTEST_PYTHON_BIN_DIR cxxtestgen.py
14# for the Python version (.py extension).
15FIND_PATH(CXXTEST_PYTHON_BIN_DIR cxxtestgen.py
16 $ENV{CXXTEST_BIN_DIR}
17 /usr/bin
18 /usr/local/bin
19 DOC "Where is cxxtest located?"
20)
21
22# Sometimes, the python version doesn't have a .py extension.
23IF (NOT CXXTEST_PYTHON_BIN_DIR)
24 FIND_PATH(CXXTEST_PYTHON_BIN_DIR cxxtestgen
2225 $ENV{CXXTEST_BIN_DIR}
2326 /usr/bin
2427 /usr/local/bin
2528 DOC "Where is cxxtest located?"
2629 )
27 IF (CXXTEST_PYTHON_BIN_DIR)
28 SET(CXXTEST_FOUND 1)
29 SET(CXXTEST_GEN "${CXXTEST_PYTHON_BIN_DIR}/cxxtestgen.py" CACHE FILEPATH "CxxTest binary filepath")
30 ENDIF (CXXTEST_PYTHON_BIN_DIR)
30 SET(CXXTEST_NO_PY_EXT TRUE)
31ENDIF (NOT CXXTEST_PYTHON_BIN_DIR)
3132
32 # Sometimes, the python version doesn't have a .py extension.
33 # repeat the above search, without the extension.
34 IF (NOT CXXTEST_FOUND)
35 FIND_PATH(CXXTEST_PYTHON_BIN_DIR cxxtestgen
36 $ENV{CXXTEST_BIN_DIR}
37 /usr/bin
38 /usr/local/bin
39 DOC "Where is cxxtest located?"
40 )
41 IF (CXXTEST_PYTHON_BIN_DIR)
42 SET(CXXTEST_FOUND 1)
33# If we found a Python version of cxxtestgen, verify Python3 is available
34IF (CXXTEST_PYTHON_BIN_DIR)
35 FIND_PACKAGE(Python3 COMPONENTS Interpreter)
36 IF (Python3_Interpreter_FOUND)
37 SET(CXXTEST_FOUND 1)
38 IF (CXXTEST_NO_PY_EXT)
4339 SET(CXXTEST_GEN "${CXXTEST_PYTHON_BIN_DIR}/cxxtestgen" CACHE FILEPATH "CxxTest binary filepath")
44 ENDIF (CXXTEST_PYTHON_BIN_DIR)
45 ENDIF (NOT CXXTEST_FOUND)
46ENDIF (Python3_Interpreter_FOUND)
40 ELSE (CXXTEST_NO_PY_EXT)
41 SET(CXXTEST_GEN "${CXXTEST_PYTHON_BIN_DIR}/cxxtestgen.py" CACHE FILEPATH "CxxTest binary filepath")
42 ENDIF (CXXTEST_NO_PY_EXT)
43 ENDIF (Python3_Interpreter_FOUND)
44ENDIF (CXXTEST_PYTHON_BIN_DIR)
4745
4846# If we still haven't found it, try the perl version.
4947IF (NOT CXXTEST_FOUND)
50 # The python version wasn't found--search for the perl version.
5148 FIND_PATH(CXXTEST_PERL_BIN_DIR cxxtestgen.pl
5249 $ENV{CXXTEST_BIN_DIR}
5350 /usr/bin