ki18n_wrap_ui: error when file doesn't exist
Needs ReviewPublic

Authored by davidre on Tue, Jan 14, 7:39 PM.

Details

Summary

Makes it clear why the current build is failing instead of the developer wasting
time investigating other causes. The message is styled similar to the CMake
error when it can't find a source file.

Test Plan

Diff Detail

Repository
R249 KI18n
Branch
error (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21296
Build 21314: arc lint + arc unit
davidre created this revision.Tue, Jan 14, 7:39 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptTue, Jan 14, 7:39 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidre requested review of this revision.Tue, Jan 14, 7:39 PM
kossebau added inline comments.
cmake/KF5I18nMacros.cmake.in
52

This assumes a relative path given. It might make sense to also deal with absolute path, and only append CMAKE_CURRENT_LIST_DIR if not absolute, then check for existance?

davidre edited the summary of this revision. (Show Details)Tue, Jan 14, 7:47 PM
cullmann added inline comments.
cmake/KF5I18nMacros.cmake.in
52

Some lines below we anyways do

get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)

Could we not just use the result of this for both the check + output?

davidre updated this revision to Diff 73788.Fri, Jan 17, 7:33 PM

So much easier, thanks Christoph

davidre updated this revision to Diff 73790.Fri, Jan 17, 7:45 PM

Remove debug message

davidre marked 2 inline comments as done.Fri, Jan 17, 7:46 PM
davidre updated this revision to Diff 73791.Fri, Jan 17, 7:47 PM

Don't change whitespace

Output of

cmake_minimum_required(VERSION 2.8.12)
find_package(ECM)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
find_package(Qt5Widgets)
find_package(KF5I18n)
ki18n_wrap_ui(var test.ui)
ki18n_wrap_ui(var test.uia)
ki18n_wrap_ui(${CMAKE_CURRENT_SOURCE_DIR}/test.ui)
ki18n_wrap_ui(/not/existing/path)

with existing test.ui next to CMakeLists.txt:

[...]
CMake Error at /home/david/kde/lib/x86_64-linux-gnu/cmake/KF5I18n/KF5I18nMacros.cmake:55 (message):
   Cannot find ui file:
   
      test.ui

Call Stack (most recent call first):
  CMakeLists.txt:7 (ki18n_wrap_ui)


CMake Error at /home/david/kde/lib/x86_64-linux-gnu/cmake/KF5I18n/KF5I18nMacros.cmake:55 (message):
   Cannot find ui file:
   
      test.uia

Call Stack (most recent call first):
  CMakeLists.txt:8 (ki18n_wrap_ui)


-- Configuring incomplete, errors occurred!
See also "/tmp/test/build/CMakeFiles/CMakeOutput.log".
davidre planned changes to this revision.Fri, Jan 17, 7:57 PM

Doesn't seem right taking a closer look

davidre added a comment.EditedFri, Jan 17, 8:04 PM

Well it seems I forgot to create the test.ui file...


Output:

CMake Error at /home/david/kde/lib/x86_64-linux-gnu/cmake/KF5I18n/KF5I18nMacros.cmake:56 (message):
   Cannot find ui file:
   
      test.uia

Call Stack (most recent call first):
  CMakeLists.txt:7 (ki18n_wrap_ui)


CMake Error at /home/david/kde/lib/x86_64-linux-gnu/cmake/KF5I18n/KF5I18nMacros.cmake:56 (message):
   Cannot find ui file:
   
      /not/existing/path

Call Stack (most recent call first):
  CMakeLists.txt:9 (ki18n_wrap_ui)


-- Configuring incomplete, errors occurred!
See also "/tmp/test/build/CMakeFiles/CMakeOutput.log".

So everything seems to work correctly

davidre updated this revision to Diff 73793.Fri, Jan 17, 8:34 PM

arc diff so pending changes is reset