tde_add_check_executable: add TEST argument

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit 9150bd170f)
v3.5.13-sru
Alexander Golubev 8 years ago committed by Slávek Banko
parent da82a62cce
commit 766aeaca3d

@ -925,6 +925,7 @@ macro( tde_add_check_executable _arg_target )
unset( _target )
unset( _automoc )
unset( _test )
unset( _meta_includes )
unset( _sources )
unset( _destination )
@ -944,6 +945,12 @@ macro( tde_add_check_executable _arg_target )
set( _automoc 1 )
endif( "+${_arg}" STREQUAL "+AUTOMOC" )
# found directive "TEST"
if( "+${_arg}" STREQUAL "+TEST" )
set( _skip_store 1 )
set( _test 1 )
endif( "+${_arg}" STREQUAL "+TEST" )
# found directive "META_INCLUDES"
if( "+${_arg}" STREQUAL "+META_INCLUDES" )
set( _skip_store 1 )
@ -1014,6 +1021,17 @@ macro( tde_add_check_executable _arg_target )
add_dependencies( check ${_target} )
# add test target
if( _test )
# get relative path to current directory and strip end tests dir
file( RELATIVE_PATH _test_prefix ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
string( REGEX REPLACE "(^\\.+/?|(^|/)tests?$|/$)" "" _test_prefix "${_test_prefix}" )
if( _test_prefix )
set( _test_prefix "${_test_prefix}/" )
endif( _test_prefix )
add_test( NAME "${_test_prefix}${_target}" COMMAND "${_target}" )
endif( _test )
endmacro( tde_add_check_executable )

Loading…
Cancel
Save