File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 11set (TEST_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR} /data)
22
3+ # common CMake macro for linuxdeploy, adding tests only if they are supposed to be built
4+ # otherwise if you try to run CTest the tests aren't build and CTest can't find them
5+ if (NOT COMMAND ld_add_test)
6+ function (ld_add_test TARGET_NAME)
7+ get_target_property (${TARGET_NAME} _EFA ${TARGET_NAME} EXCLUDE_FROM_ALL )
8+ if (NOT ${${TARGET_NAME} _EXCLUDE_FROM_ALL})
9+ message (STATUS "[${PROJECT_NAME} ] Adding test ${TARGET_NAME} " )
10+ add_test (${TARGET_NAME} ${TARGET_NAME} )
11+ else ()
12+ message (STATUS "[${PROJECT_NAME} ] Test ${TARGET_NAME} is excluded from ALL, not adding as test" )
13+ endif ()
14+ endfunction ()
15+ endif ()
16+
317# build a single test binary
418add_executable (test_desktopfile
519 test_desktopfile.cpp
@@ -16,4 +30,4 @@ set_property(TARGET test_desktopfile
1630 PROPERTY COMPILE_FLAGS "-DDESKTOP_FILE_PATH=\\\" ${TEST_DATA_DIR} /simple_app.desktop\\\" "
1731)
1832
19- add_test (test_desktopfile test_desktopfile)
33+ ld_add_test (test_desktopfile test_desktopfile)
You can’t perform that action at this time.
0 commit comments