D7008: Don't export internal helper executables

Harald Sitter noreply at phabricator.kde.org
Tue Aug 8 14:27:43 UTC 2017


sitter added a subscriber: apol.
sitter added a comment.


  In https://phabricator.kde.org/D7008#133756, @habacker wrote:
  
  > In https://phabricator.kde.org/D7008#133755, @sitter wrote:
  >
  > > In https://phabricator.kde.org/D7008#133644, @sitter wrote:
  > >
  > > > https://phabricator.kde.org/source/kconfig/browse/master/KF5ConfigConfig.cmake.in;023e3ecfe985e09f786134fc28793d24383998f8$11 when not xcompiling the targets are fairly useless and don't need to get imported at all)
  > >
  >
  >
  > What content does the file included by
  >
  > include("${KCONFIGCOMPILER_PATH}")
  >
  > should have to be usable ?
  
  
  The exported executable. Basically: CMake has two Targets.cmake files. One for the library artifacts and one completely separate one for the helpers. This allows including either/or depending on what is needed and by extension including the host's helpers when cross compiling
  
  Further references:
  
  - here we install the binary and EXPORT it into KF5ConfigCompilerTargets https://phabricator.kde.org/source/kconfig/browse/master/src/kconfig_compiler/CMakeLists.txt;023e3ecfe985e09f786134fc28793d24383998f8$23
  - here we install the targets https://phabricator.kde.org/source/kconfig/browse/master/CMakeLists.txt;023e3ecfe985e09f786134fc28793d24383998f8$81
  - note that KF5ConfigCompilerTargets (helper binaries) is different from KF5ConfigTargets (library artifacts)
  - in our Config.cmake we always include our library targets https://phabricator.kde.org/source/kconfig/browse/master/KF5ConfigConfig.cmake.in;023e3ecfe985e09f786134fc28793d24383998f8$5
  - but depending on xcompiling we'll either include the helper binary from the host's KF5ConfigCompilerTargets or ours when not xcompiling https://phabricator.kde.org/source/kconfig/browse/master/KF5ConfigConfig.cmake.in;023e3ecfe985e09f786134fc28793d24383998f8$11
  
  This ultimately results in `find_package(KF5Config)` always importing `KF5::kconfig_compiler`, but depending on the xcompiling stuff it may be the host's.
  
  This would work pretty much exactly the same for sonnet with the additional change that the xcompile if inside the source itself (https://phabricator.kde.org/source/sonnet/browse/master/data/CMakeLists.txt;c4c007cc3c0b9ee0ee46e91d026752662dd867a4$18) would change to `find_file; include` boilerplate of https://phabricator.kde.org/source/kconfig/browse/master/KF5ConfigConfig.cmake.in;023e3ecfe985e09f786134fc28793d24383998f8$12
  
  I think @apol wrote the initial implementation of this magic and can probably answer questions better than me though :)

REPOSITORY
  R246 Sonnet

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

To: vkrause, #frameworks, cordlandwehr
Cc: apol, sitter, sandsmark, habacker, dfaure
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170808/9fec0887/attachment.html>


More information about the Kde-frameworks-devel mailing list