D9118: ki18n cmake macros: Mark UIC-generated .h files to skip AUTOMOC by default

2017-12-04 Thread Michael Pyne
This revision was automatically updated to reflect the committed changes.
Closed by commit R249:6e3b70843566: cmake: Mark UIC-generated .h files to skip 
AUTOMOC by default. (authored by mpyne).

CHANGED PRIOR TO COMMIT
  https://phabricator.kde.org/D9118?vs=23312&id=23478#toc

REPOSITORY
  R249 KI18n

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D9118?vs=23312&id=23478

REVISION DETAIL
  https://phabricator.kde.org/D9118

AFFECTED FILES
  cmake/KF5I18NMacros.cmake

To: mpyne, #frameworks, #build_system, #localization, kfunk
Cc: aacid


D9118: ki18n cmake macros: Mark UIC-generated .h files to skip AUTOMOC by default

2017-12-04 Thread Kevin Funk
kfunk accepted this revision.
kfunk added a comment.
This revision is now accepted and ready to land.


  This shouldn't create any troubles with earlier CMake versions.
  
  Also note that we set the same properties unconditionally in newer Qt5 CMake 
macros: https://codereview.qt-project.org/#/c/207327

INLINE COMMENTS

> KF5I18NMacros.cmake:56
>)
> +  set_property(SOURCE ${_header} PROPERTY SKIP_AUTOMOC ON)
>list(APPEND ${_sources} ${_header})

`set_source_files_properties(${_header} ...)` is probably the more canonical 
way to do this.

REPOSITORY
  R249 KI18n

REVISION DETAIL
  https://phabricator.kde.org/D9118

To: mpyne, #frameworks, #build_system, #localization, kfunk
Cc: aacid


D9118: ki18n cmake macros: Mark UIC-generated .h files to skip AUTOMOC by default

2017-12-03 Thread Michael Pyne
mpyne added a comment.


  In https://phabricator.kde.org/D9118#174892, @aacid wrote:
  
  > Will this cause trouble with older cmake versions?
  
  
  Good question, I haven't tried it. I've verified that `set_property` at least 
is present in 2.8.12 
 so it 
shouldn't introduce a syntax error.  Whether the added semantic of turning on 
SKIP_AUTOMOC introduces an issue is open.
  
  Perhaps it's best to try to wrap with a version check.  If no one is able to 
test on an ancient supported CMake I can try to adapt the patch to add that.

REPOSITORY
  R249 KI18n

REVISION DETAIL
  https://phabricator.kde.org/D9118

To: mpyne, #frameworks, #build_system, #localization, kfunk
Cc: aacid


D9118: ki18n cmake macros: Mark UIC-generated .h files to skip AUTOMOC by default

2017-12-03 Thread David Faure
dfaure added a reviewer: kfunk.

REPOSITORY
  R249 KI18n

REVISION DETAIL
  https://phabricator.kde.org/D9118

To: mpyne, #frameworks, #build_system, #localization, kfunk
Cc: aacid


D9118: ki18n cmake macros: Mark UIC-generated .h files to skip AUTOMOC by default

2017-12-03 Thread Albert Astals Cid
aacid added a comment.


  Will this cause trouble with older cmake versions?

REPOSITORY
  R249 KI18n

REVISION DETAIL
  https://phabricator.kde.org/D9118

To: mpyne, #frameworks, #build_system, #localization
Cc: aacid


D9118: ki18n cmake macros: Mark UIC-generated .h files to skip AUTOMOC by default

2017-12-02 Thread Michael Pyne
mpyne created this revision.
mpyne added reviewers: Frameworks, Build System, Localization.
Restricted Application added a project: Frameworks.

REVISION SUMMARY
  CMake in 3.10.0 has started warning that `.h` files which are automatically 
generated have historically been left out of AUTOMOC, and that future CMake 
releases will start including them in AUTOMOC.
  
  For now the warning can be squelched by either specifically opting in to 
future behavior (by setting policy CMP0071) or by manually marking the 
generated file as needing to skip AUTOMOC. Since the `ui_*.h` files do not 
create `QObject`-based subclasses, it seems to me that matching historical 
behavior and skipping AUTOMOC is the proper decision.
  
  The question is where in the CMake code to set that property.  The warnings I 
saw were generated for `*.h` files created by uic.  This generation step is 
ultimately setup by the `ki18n_wrap_ui` CMake macro from KI18n, so this seems 
like the right spot to flag the generated .h file as needing to skip AUTOMOC.

TEST PLAN
  KI18n builds and installs.
  My test app (JuK) now successfully builds and installs without the CMake 
warnings previously generated.

REPOSITORY
  R249 KI18n

REVISION DETAIL
  https://phabricator.kde.org/D9118

AFFECTED FILES
  cmake/KF5I18NMacros.cmake

To: mpyne, #frameworks, #build_system, #localization