diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c2a16a..d621cb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,10 +51,19 @@ ENDIF(NOT TARGET dist) ADD_DEFINITIONS("-DHAVE_CONFIG_H") find_program(NIHTEST nihtest) +set(NIHTEST_REQUIRED_VERSION "1.4") + if(RUN_REGRESS) - if (NOT NIHTEST) + if(NOT NIHTEST) message(WARNING "-- nihtest not found, regression testing disabled") set(RUN_REGRESS OFF) + else() + execute_process(COMMAND ${NIHTEST} --version OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NIHTEST_VERSION_RAW) + string(REGEX REPLACE "[^ ]* " "" NIHTEST_VERSION ${NIHTEST_VERSION_RAW}) + if (${NIHTEST_VERSION} VERSION_LESS ${NIHTEST_REQUIRED_VERSION}) + message(WARNING "-- nihtest ${NIHTEST_VERSION} too old, at least ${NIHTEST_REQUIRED_VERSION} required, regression testing disabled") + set(RUN_REGRESS OFF) + endif() endif() endif()