From 5ed7ba07e4f382f4e07e2de7feca33c16a2793f7 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Thu, 29 Dec 2016 16:39:25 +0100 Subject: appstreamtest: handle non-installed programs Summary: If you just built the software without installing it and then run ctest, this will systematically fail while trying to read install_manifest.txt. With this patch this case is now handled gracefully, not forcing to install to have a test suite which fully passes. Reviewers: #frameworks, apol Differential Revision: https://phabricator.kde.org/D3860 --- kde-modules/appstreamtest.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'kde-modules/appstreamtest.cmake') diff --git a/kde-modules/appstreamtest.cmake b/kde-modules/appstreamtest.cmake index e524bacb..8361473b 100644 --- a/kde-modules/appstreamtest.cmake +++ b/kde-modules/appstreamtest.cmake @@ -1,5 +1,11 @@ -file(READ "${INSTALL_FILES}" out) -string(REPLACE "\n" ";" out "${out}") +file(GLOB install_done "${INSTALL_FILES}") +if (install_done) + file(READ "${INSTALL_FILES}" out) + string(REPLACE "\n" ";" out "${out}") +else() + message("Not installed yet, skipping") + set(out "") +endif() set(metadatafiles) foreach(file IN LISTS out) -- cgit v1.2.1