summaryrefslogtreecommitdiff
path: root/cmake/helpers/EflMacros.cmake
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-23 14:02:08 -0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-01-23 18:23:41 +0100
commitb10fc88bb0d5c6c31a797ab4e2010cdcac37b903 (patch)
treebe39ea30456a367497873fa0139945b4b0e0af7f /cmake/helpers/EflMacros.cmake
parentf009bc8b2bd3f64591ec907c864f38c4f4d13824 (diff)
EflMacros: build tests before running them.
'make test' wouldn't build the test, which is annoying. There is no way to add dependencies to reserved target 'test'. The test is also executed by another tool (ctest), not cmake itself, then we must create a test '-build' that is actually calling back cmake to compile the test suite and make it a dependency for the test itself. Nasty but improves usability.
Diffstat (limited to 'cmake/helpers/EflMacros.cmake')
-rw-r--r--cmake/helpers/EflMacros.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/helpers/EflMacros.cmake b/cmake/helpers/EflMacros.cmake
index 13e2493aa9..67a80ab167 100644
--- a/cmake/helpers/EflMacros.cmake
+++ b/cmake/helpers/EflMacros.cmake
@@ -766,6 +766,9 @@ function(EFL_TEST _testname)
766 766
767 add_test(NAME ${_testname} COMMAND ${_testtarget}) 767 add_test(NAME ${_testname} COMMAND ${_testtarget})
768 LIST_APPEND_GLOBAL(${EFL_LIB_CURRENT}_TESTS ${_testtarget}) 768 LIST_APPEND_GLOBAL(${EFL_LIB_CURRENT}_TESTS ${_testtarget})
769
770 add_test(${_testname}-build "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_testtarget})
771 set_tests_properties(${_testname} PROPERTIES DEPENDS ${_testname}-build)
769endfunction() 772endfunction()
770 773
771# EFL_MODULE(Name) 774# EFL_MODULE(Name)