Changeset View
Changeset View
Standalone View
Standalone View
modules/ECMAddTests.cmake
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 86 | function(ecm_add_test) | |||
---|---|---|---|---|---|
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) | 117 | if (CMAKE_LIBRARY_OUTPUT_DIRECTORY) | ||
118 | if(CMAKE_HOST_SYSTEM MATCHES "Windows") | ||||
119 | set(PATHSEP "\\;") | ||||
120 | else() # e.g. Linux | ||||
121 | set(PATHSEP ":") | ||||
122 | endif() | ||||
118 | set(_plugin_path $ENV{QT_PLUGIN_PATH}) | 123 | set(_plugin_path $ENV{QT_PLUGIN_PATH}) | ||
119 | set_property(TEST ${_testname} PROPERTY ENVIRONMENT QT_PLUGIN_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:${_plugin_path}) | 124 | set_property(TEST ${_testname} PROPERTY ENVIRONMENT QT_PLUGIN_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}${PATHSEP}${_plugin_path}) | ||
120 | endif() | 125 | endif() | ||
121 | if (ARG_TARGET_NAME_VAR) | 126 | if (ARG_TARGET_NAME_VAR) | ||
122 | set(${ARG_TARGET_NAME_VAR} "${_targetname}" PARENT_SCOPE) | 127 | set(${ARG_TARGET_NAME_VAR} "${_targetname}" PARENT_SCOPE) | ||
123 | endif() | 128 | endif() | ||
124 | if (ARG_TEST_NAME_VAR) | 129 | if (ARG_TEST_NAME_VAR) | ||
125 | set(${ARG_TEST_NAME_VAR} "${_testname}" PARENT_SCOPE) | 130 | set(${ARG_TEST_NAME_VAR} "${_testname}" PARENT_SCOPE) | ||
126 | endif() | 131 | endif() | ||
127 | endfunction() | 132 | endfunction() | ||
Show All 31 Lines |