ki18n_wrap_ui: error when file doesn't exist
ClosedPublic

Authored by davidre on Jan 14 2020, 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.Jan 14 2020, 7:39 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 14 2020, 7:39 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidre requested review of this revision.Jan 14 2020, 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)Jan 14 2020, 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.Jan 17 2020, 7:33 PM

So much easier, thanks Christoph

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

Remove debug message

davidre marked 2 inline comments as done.Jan 17 2020, 7:46 PM
davidre updated this revision to Diff 73791.Jan 17 2020, 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.Jan 17 2020, 7:57 PM

Doesn't seem right taking a closer look

davidre added a comment.EditedJan 17 2020, 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.Jan 17 2020, 8:34 PM

arc diff so pending changes is reset

cullmann accepted this revision.Jan 22 2020, 7:58 PM

I think this ok the way it is now, or?

This revision is now accepted and ready to land.Jan 22 2020, 7:58 PM
This revision was automatically updated to reflect the committed changes.