Changeset View
Changeset View
Standalone View
Standalone View
modules/ECMAddTests.cmake
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 86 | function(ecm_add_test) | |||
---|---|---|---|---|---|
109 | endif() | 109 | endif() | ||
110 | add_executable(${_targetname} ${gui_args} ${_sources}) | 110 | add_executable(${_targetname} ${gui_args} ${_sources}) | ||
111 | if(NOT ARG_GUI) | 111 | if(NOT ARG_GUI) | ||
112 | ecm_mark_nongui_executable(${_targetname}) | 112 | ecm_mark_nongui_executable(${_targetname}) | ||
113 | endif() | 113 | endif() | ||
114 | add_test(NAME ${_testname} COMMAND ${_targetname}) | 114 | add_test(NAME ${_testname} COMMAND ${_targetname}) | ||
115 | target_link_libraries(${_targetname} ${ARG_LINK_LIBRARIES}) | 115 | target_link_libraries(${_targetname} ${ARG_LINK_LIBRARIES}) | ||
116 | ecm_mark_as_test(${_targetname}) | 116 | ecm_mark_as_test(${_targetname}) | ||
117 | if (CMAKE_LIBRARY_OUTPUT_DIRECTORY) | ||||
118 | set(_plugin_path $ENV{QT_PLUGIN_PATH}) | ||||
119 | set_property(TEST ${_testname} PROPERTY ENVIRONMENT QT_PLUGIN_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:${_plugin_path}) | ||||
120 | endif() | ||||
117 | if (ARG_TARGET_NAME_VAR) | 121 | if (ARG_TARGET_NAME_VAR) | ||
118 | set(${ARG_TARGET_NAME_VAR} "${_targetname}" PARENT_SCOPE) | 122 | set(${ARG_TARGET_NAME_VAR} "${_targetname}" PARENT_SCOPE) | ||
119 | endif() | 123 | endif() | ||
120 | if (ARG_TEST_NAME_VAR) | 124 | if (ARG_TEST_NAME_VAR) | ||
121 | set(${ARG_TEST_NAME_VAR} "${_testname}" PARENT_SCOPE) | 125 | set(${ARG_TEST_NAME_VAR} "${_testname}" PARENT_SCOPE) | ||
122 | endif() | 126 | endif() | ||
123 | endfunction() | 127 | endfunction() | ||
124 | 128 | | |||
Show All 30 Lines |