diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d1992d8fe..4616ba8707 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -700,6 +700,17 @@ endif() set(_lyx "${PACKAGE_BASE}${PROGRAM_SUFFIX}") set(_tex2lyx tex2lyx${PROGRAM_SUFFIX}) + +set (cmd ${CMAKE_CTEST_COMMAND}) +if (MSVC) + set (cmd ${cmd} -C ${CMAKE_CFG_INTDIR}) +else () + set (cmd ${cmd} -C ${CMAKE_BUILD_TYPE}) +endif () +add_custom_target (lyx_run_tests COMMAND ${cmd}) +set_target_properties(lyx_run_tests PROPERTIES FOLDER "tests") + + add_subdirectory(src "${TOP_BINARY_DIR}/src") add_subdirectory(lib/lyx2lyx "${TOP_BINARY_DIR}/lyx2lyx") add_subdirectory(lib/scripts "${TOP_BINARY_DIR}/scripts") diff --git a/development/autotests/xvkbd/CMakeLists.txt b/development/autotests/xvkbd/CMakeLists.txt index 51a08db818..7e35bec06e 100644 --- a/development/autotests/xvkbd/CMakeLists.txt +++ b/development/autotests/xvkbd/CMakeLists.txt @@ -30,3 +30,4 @@ else() endif() target_link_libraries(xvkbd ${XVFBDLIBS}) +add_dependencies(lyx_run_tests xvkbd) diff --git a/src/support/tests/CMakeLists.txt b/src/support/tests/CMakeLists.txt index 1ff0ce66a8..a6d0578030 100644 --- a/src/support/tests/CMakeLists.txt +++ b/src/support/tests/CMakeLists.txt @@ -45,6 +45,7 @@ foreach(_src ${check_PROGRAMS}) -P "${TOP_SRC_DIR}/src/support/tests/supporttest.cmake") set_target_properties(${_src} PROPERTIES FOLDER "tests/support") + add_dependencies(lyx_run_tests ${_src}) endforeach() diff --git a/src/tex2lyx/test/CMakeLists.txt b/src/tex2lyx/test/CMakeLists.txt index 2b3ddb4dc0..4994641a1c 100644 --- a/src/tex2lyx/test/CMakeLists.txt +++ b/src/tex2lyx/test/CMakeLists.txt @@ -25,4 +25,5 @@ foreach(_fl ${_tex_tests}) ${fl}) endforeach() +add_dependencies(lyx_run_tests ${_tex2lyx} ${_lyx})