]> git.lyx.org Git - features.git/commitdiff
Cmake tests: Start preparing for tests involving valgrind
authorKornel Benko <kornel@lyx.org>
Tue, 7 Apr 2020 10:12:29 +0000 (12:12 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:55 +0000 (15:48 +0200)
CMakeLists.txt

index 7e2d3d1302e670ae481c13d482d4f0bfeec46885..d206d55f00ee65cf6df50d2fef854ab205e58fd3 100644 (file)
@@ -139,6 +139,9 @@ LYX_OPTION(BUNDLE           "Build bundle  (experimental) " OFF ALL)
 LYX_OPTION(ENABLE_URLTESTS  "Enable for URL tests" OFF ALL)
 LYX_OPTION(ENABLE_EXPORT_TESTS "Enable for export tests" OFF ALL)
 LYX_OPTION(ENABLE_KEYTESTS  "Enable for keytests" OFF ALL)
+if (NOT CMAKE_VERSION VERSION_LESS "3.17")
+LYX_OPTION(ENABLE_VALGRIND_TESTS  "Enable for tests involving valgrind" OFF ALL)
+endif()
 LYX_OPTION(ASAN             "Use address sanitizer" OFF ALL)
 #LYX_COMBO(USE_FILEDIALOG    "Use native or QT file dialog" QT NATIVE)
 LYX_COMBO(USE_QT            "Use Qt version as frontend" AUTO QT4 QT5)
@@ -179,6 +182,12 @@ if(help OR HELP)
 endif()
 
 # Check option dependencies
+if (LYX_ENABLE_VALGRIND_TESTS)
+       find_program(VALGRIND_EXECUTABLE "valgrind")
+       if (NOT VALGRIND_EXECUTABLE)
+               message(FATAL_ERROR "Cannot use valgrind tests, executable valgrind is missing. Please disable LYX_ENABLE_VALGRIND_TESTS")
+       endif()
+endif()
 
 if(LYX_DMG)
        set(LYX_BUNDLE ON)