void-packages/srcpkgs/okteta/patches/cmake.testing.working_dir.p...

27 lines
1.6 KiB
Diff

upstream bug: https://bugs.kde.org/show_bug.cgi?id=436128
--- kasten/controllers/CMakeLists.txt.ORIG 2021-03-29 13:51:56.000000000 +0200
+++ kasten/controllers/CMakeLists.txt 2021-04-24 23:12:17.358195447 +0200
@@ -584,15 +584,12 @@
LINK_LIBRARIES structureview-tested-srcs Qt5::Test poddecoder-typeeditors
)
- # remove useless default definition of QT_TESTCASE_BUILDDIR in interface from imported target Qt5::Test
- get_target_property(qttestdefs Qt5::Test INTERFACE_COMPILE_DEFINITIONS)
- list(FILTER qttestdefs EXCLUDE REGEX [[^QT_TESTCASE_BUILDDIR=]])
- set_property(TARGET Qt5::Test PROPERTY INTERFACE_COMPILE_DEFINITIONS ${qttestdefs})
- # set the definition as needed for our tests
- target_compile_definitions(customtostringtest PRIVATE QT_TESTCASE_BUILDDIR="${CMAKE_CURRENT_BINARY_DIR}")
- target_compile_definitions(jsparsertest PRIVATE QT_TESTCASE_BUILDDIR="${CMAKE_CURRENT_BINARY_DIR}")
- # TODO: still fragile once __FILE__ is neither absolute or full relative path to this build dir
- # look into using custom code intead of simple QFINDTESTDATA usage
+ # The tests below are using data files that are pointed via QFINDTESTDATA macro,
+ # that is related to cmake WORKING_DIRECTORY. WORKING_DIRECTORY points the current
+ # directory, while data files are stored in test/ subdirectory.
+ # So set WORKING_DIRECTORY correctly.
+ target_compile_definitions(customtostringtest PRIVATE WORKING_DIRECTORY="${CMAKE_CURRENT_SOURCE_DIR}/test")
+ target_compile_definitions(jsparsertest PRIVATE WORKING_DIRECTORY="${CMAKE_CURRENT_SOURCE_DIR}/test")
#replace tool unit tests
ecm_add_test(