aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2021-12-19 20:34:36 +0200
committerAhmad Samir <a.samirh78@gmail.com>2021-12-19 20:34:36 +0200
commitcca11c3432af161fa7da56548e1fc36bb1f4b345 (patch)
tree74224b6f6fd279f57db3d61dc89362e7a9ad8205
parentb66c9f3c35aeb76143e754808006b40f0bf7f423 (diff)
downloadextra-cmake-modules-cca11c3432af161fa7da56548e1fc36bb1f4b345.tar.gz
extra-cmake-modules-cca11c3432af161fa7da56548e1fc36bb1f4b345.tar.bz2
Revert "Fix QT_PLUGIN_PATH for unittests"
As discussed in [1], it's simpler to put the files in builddir/bin/, i.e. no /plugins subdir, this makes it easier to run the unittest directly from the CLI/debugger/IDE, without relying on ctest exporting the correct QT_PLUGIN_PATH; instead QCoreApplication::libraryPaths() will pick up the plugins in e.g. builddir/bin/kf5/kio/ automatically. This will be followed by a change in KCoreAddons to remove the /plugins/ dir from the path in the builddir. [1] https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/213
-rw-r--r--modules/ECMAddTests.cmake8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/ECMAddTests.cmake b/modules/ECMAddTests.cmake
index b1ebda1e..58c78d05 100644
--- a/modules/ECMAddTests.cmake
+++ b/modules/ECMAddTests.cmake
@@ -100,14 +100,12 @@ function(ecm_add_test)
if (CMAKE_LIBRARY_OUTPUT_DIRECTORY)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
# https://stackoverflow.com/questions/59862894/how-do-i-make-a-list-in-cmake-with-the-semicolon-value
- set(SEP "\\\;") # Don't want cmake to treat it like a list
+ set(PATHSEP "\\\;") # Don't want cmake to treat it like a list
else() # e.g. Linux
- set(SEP ":")
+ set(PATHSEP ":")
endif()
set(_plugin_path "$ENV{QT_PLUGIN_PATH}")
- set(_out_lib_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
- set_property(TEST ${_testname}
- PROPERTY ENVIRONMENT "QT_PLUGIN_PATH=${_out_lib_dir}/plugins${SEP}${_out_lib_dir}${SEP}${_plugin_path}")
+ set_property(TEST ${_testname} PROPERTY ENVIRONMENT "QT_PLUGIN_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}${PATHSEP}${_plugin_path}")
endif()
if (ARG_TARGET_NAME_VAR)
set(${ARG_TARGET_NAME_VAR} "${_targetname}" PARENT_SCOPE)