From kde-frameworks-devel Mon Jan 04 15:38:23 2016 From: "Ralf Habacker" Date: Mon, 04 Jan 2016 15:38:23 +0000 To: kde-frameworks-devel Subject: Re: Review Request 126494: Add cross compile support for desktoptojson. Message-Id: <20160104153823.6499.12906 () mimi ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-frameworks-devel&m=145192192217298 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============5588161716534676802==" --===============5588161716534676802== Content-Type: multipart/alternative; boundary="===============0819281812769479189==" --===============0819281812769479189== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Jan. 4, 2016, 3:09 nachm., Aleix Pol Gonzalez wrote: > > KF5CoreAddonsConfig.cmake.in, line 12 > > > > > > What's that property supposed to do? `IMPORTED_LOCATION_NONE` > > Ralf Habacker wrote: > If I remember correctly I took it from a different location in the framework code. Better to use IMPORTED_LOCATION ? > > Aleix Pol Gonzalez wrote: > Better not use anything. This target should be properly exported already. My impression is that it's not working for you because you have mixed cmake build types. > > Ralf Habacker wrote: > Not sure I understand you correctly: > In cross compile environments a host provided desktoptojson executable is required to build kcoreaddons (tested with mingw32). With this patch I can specify -DDESKTOPTOJSON_EXECUTABLE= on the cmake command line (see https://build.opensuse.org/package/view_file/home:rhabacker:branches:windows:mingw:win32:KF516/mingw32-kf5-filesystem/macros.mingw32-kf5?expand=1 line 92ff) to solve this. Also it provides the host provided executable for packages requiring desktoptojson. > > Aleix Pol Gonzalez wrote: > But that's not very practical, because you'll have to point to each and every target that it's used. You can consider adopting the `KF5_HOST_TOOLING` variable, which is meant for exactly this. From Qt4/KDE4 times providing each tool on the configure command line was the prefered method: QT4 https://build.opensuse.org/package/view_file/windows:mingw:win32/mingw32-libqt4/macros.mingw32-qt4?expand=1 KDE4 https://build.opensuse.org/package/view_file/windows:mingw:win32/mingw32-kde4-filesystem/macros.mingw32-kde4?expand=1 For Qt5 related host tool support is provided by using the CROSS_COMPILE configure switch configure .... CROSS_COMPILE= eg. CROSS_COMPILE=i686-w64-mingw32- For KF5 now there is the KF5_HOST_TOOLING support, which needs for every host provided tool (currently 8 [1]) to create a related ${KF5_HOST_TOOLING}//Targets.cmake, which points to the related host provided executable ? [1] from https://build.opensuse.org/package/view_file/home:rhabacker:branches:windows:mingw:win32:KF516/mingw32-kf5-filesystem/macros.mingw32-kf5?expand=1 -DKCONFIG_COMPILER_EXECUTABLE=/usr/bin/%{_mingw32_target}-kconfig_compiler_kf5 \\ -DKCONF_UPDATE_EXECUTABLE=/usr/bin/%{_mingw32_target}-kconf_update \\ -DMEINPROC5_EXECUTABLE=/usr/bin/%{_mingw32_target}-meinproc5 \\ -DCHECKXML5_EXECUTABLE=/usr/bin/%{_mingw32_target}-checkXML5 \\ -DDOCBOOKL10NHELPER_EXECUTABLE=/usr/bin/%{_mingw32_target}-docbookl10nhelper \\ -DDESKTOPTOJSON_EXECUTABLE=/usr/bin/%{_mingw32_target}-desktoptojson \\ -DPARSETRIGRAMS_EXECUTABLE=/usr/bin/%{_mingw32_target}-parsetrigrams \\ -DKATEHIGHLIGHTINGINDEXER_EXECUTABLE=/usr/bin/%{_mingw32_target}-katehighlightingindexer \\ A scan of kf5 git repos show me only three references to KF5_HOST_TOOLING, which looks incomplete ./kconfig/KF5ConfigConfig.cmake.in:9:if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING) ./kconfig/KF5ConfigConfig.cmake.in:10: find_file(KCONFIGCOMPILER_PATH KF5Config/KF5ConfigCompilerTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH) ./kconfig/KF5ConfigConfig.cmake.in-11- include("${KCONFIGCOMPILER_PATH}") -> should KCONFIGCOMPILER_PATH not better TARGETSFILE similar to the other locations -> KF5ConfigCompilerTargets.cmake: does it include all required tools for package KF5Config or simple for KCONFIGCOMPILER -> if KF5Config related it should be named KF5ConfigToolsTarget.cmake similar to the other ./kauth/KF5AuthConfig.cmake.in:17: if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING) ./kauth/KF5AuthConfig.cmake.in:18: find_file(TARGETSFILE KF5Auth/KF5AuthToolsTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH) ./kauth/KF5AuthConfig.cmake.in-19- include("${TARGETSFILE}") ./kcoreaddons/KF5CoreAddonsConfig.cmake.in:6:if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING) ./kcoreaddons/KF5CoreAddonsConfig.cmake.in:7: find_file(TARGETSFILE KF5CoreAddons/KF5CoreAddonsToolingTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH) -> KF5CoreAddonsToolingTargets.cmake not better KF5CoreAddonsToolsTargets.cmake ./kcoreaddons/KF5CoreAddonsConfig.cmake.in-8- include("${TARGETSFILE}") Unfortunally I did not found an example set for the structure of such cmake files (any howto available ?) - Ralf ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/126494/#review90552 ----------------------------------------------------------- On Jan. 4, 2016, 3:11 nachm., Ralf Habacker wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/126494/ > ----------------------------------------------------------- > > (Updated Jan. 4, 2016, 3:11 nachm.) > > > Review request for KDE Frameworks. > > > Repository: kcoreaddons > > > Description > ------- > > Add cross compile support for desktoptojson. > > > Diffs > ----- > > KF5CoreAddonsConfig.cmake.in dce3a4e65599b286d8fedbaa20235f5025f509e8 > > Diff: https://git.reviewboard.kde.org/r/126494/diff/ > > > Testing > ------- > > Cross compiled package has been build at https://build.opensuse.org/package/show/home:rhabacker:branches:windows:mingw:win32:KF516/mingw32-kcoreaddons > > > Thanks, > > Ralf Habacker > > --===============0819281812769479189== MIME-Version: 1.0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/126494/

On Januar 4th, 2016, 3:09 nachm. CET, Aleix Pol Gonzalez wrote:

KF5CoreAddonsConfig.cmake.in (Diff revision 1)
12
        set_target_properties(KF5::desktoptojson PROPERTIES IMPORTED_LOCATION_NONE ${DESKTOPTOJSON_EXECUTABLE})

What's that property supposed to do? IMPORTED_LOCATION_NONE

On Januar 4th, 2016, 3:20 nachm. CET, Ralf Habacker wrote:

If I remember correctly I took it from a different location in the framework code. Better to use IMPORTED_LOCATION ?

On Januar 4th, 2016, 3:21 nachm. CET, Aleix Pol Gonzalez wrote:

Better not use anything. This target should be properly exported already. My impression is that it's not working for you because you have mixed cmake build types.

On Januar 4th, 2016, 3:32 nachm. CET, Ralf Habacker wrote:

Not sure I understand you correctly: In cross compile environments a host provided desktoptojson executable is required to build kcoreaddons (tested with mingw32). With this patch I can specify -DDESKTOPTOJSON_EXECUTABLE=<host-provided-desktoptojson-executable> on the cmake command line (see https://build.opensuse.org/package/view_file/home:rhabacker:branches:windows:mingw:win32:KF516/mingw32-kf5-filesystem/macros.mingw32-kf5?expand=1 line 92ff) to solve this. Also it provides the host provided executable for packages requiring desktoptojson.

On Januar 4th, 2016, 3:34 nachm. CET, Aleix Pol Gonzalez wrote:

But that's not very practical, because you'll have to point to each and every target that it's used. You can consider adopting the KF5_HOST_TOOLING variable, which is meant for exactly this.

From Qt4/KDE4 times providing each tool on the configure command line was the prefered method:

QT4 https://build.opensuse.org/package/view_file/windows:mingw:win32/mingw32-libqt4/macros.mingw32-qt4?expand=1 KDE4 https://build.opensuse.org/package/view_file/windows:mingw:win32/mingw32-kde4-filesystem/macros.mingw32-kde4?expand=1

For Qt5 related host tool support is provided by using the CROSS_COMPILE configure switch

configure .... CROSS_COMPILE=<build-target> eg. CROSS_COMPILE=i686-w64-mingw32-

For KF5 now there is the KF5_HOST_TOOLING support, which needs for every host provided tool (currently 8 [1]) to create a related ${KF5_HOST_TOOLING}/<package>/<some-name>Targets.cmake, which points to the related host provided executable ?

[1] from https://build.opensuse.org/package/view_file/home:rhabacker:branches:windows:mingw:win32:KF516/mingw32-kf5-filesystem/macros.mingw32-kf5?expand=1

  -DKCONFIG_COMPILER_EXECUTABLE=/usr/bin/%{_mingw32_target}-kconfig_compiler_kf5 \\\
  -DKCONF_UPDATE_EXECUTABLE=/usr/bin/%{_mingw32_target}-kconf_update \\\
  -DMEINPROC5_EXECUTABLE=/usr/bin/%{_mingw32_target}-meinproc5 \\\
  -DCHECKXML5_EXECUTABLE=/usr/bin/%{_mingw32_target}-checkXML5 \\\
  -DDOCBOOKL10NHELPER_EXECUTABLE=/usr/bin/%{_mingw32_target}-docbookl10nhelper \\\
  -DDESKTOPTOJSON_EXECUTABLE=/usr/bin/%{_mingw32_target}-desktoptojson \\\
  -DPARSETRIGRAMS_EXECUTABLE=/usr/bin/%{_mingw32_target}-parsetrigrams \\\
  -DKATEHIGHLIGHTINGINDEXER_EXECUTABLE=/usr/bin/%{_mingw32_target}-katehighlightingindexer \\\

A scan of kf5 git repos show me only three references to KF5_HOST_TOOLING, which looks incomplete

./kconfig/KF5ConfigConfig.cmake.in:9:if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING) ./kconfig/KF5ConfigConfig.cmake.in:10: find_file(KCONFIGCOMPILER_PATH KF5Config/KF5ConfigCompilerTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH) ./kconfig/KF5ConfigConfig.cmake.in-11- include("${KCONFIGCOMPILER_PATH}") -> should KCONFIGCOMPILER_PATH not better TARGETSFILE similar to the other locations -> KF5ConfigCompilerTargets.cmake: does it include all required tools for package KF5Config or simple for KCONFIGCOMPILER -> if KF5Config related it should be named KF5ConfigToolsTarget.cmake similar to the other

./kauth/KF5AuthConfig.cmake.in:17: if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING) ./kauth/KF5AuthConfig.cmake.in:18: find_file(TARGETSFILE KF5Auth/KF5AuthToolsTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH) ./kauth/KF5AuthConfig.cmake.in-19- include("${TARGETSFILE}")

./kcoreaddons/KF5CoreAddonsConfig.cmake.in:6:if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING) ./kcoreaddons/KF5CoreAddonsConfig.cmake.in:7: find_file(TARGETSFILE KF5CoreAddons/KF5CoreAddonsToolingTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH) -> KF5CoreAddonsToolingTargets.cmake not better KF5CoreAddonsToolsTargets.cmake ./kcoreaddons/KF5CoreAddonsConfig.cmake.in-8- include("${TARGETSFILE}")

Unfortunally I did not found an example set for the structure of such cmake files (any howto available ?)


- Ralf


On Januar 4th, 2016, 3:11 nachm. CET, Ralf Habacker wrote:

Review request for KDE Frameworks.
By Ralf Habacker.

Updated Jan. 4, 2016, 3:11 nachm.

Repository: kcoreaddons

Description

Add cross compile support for desktoptojson.

Testing

Cross compiled package has been build at https://build.opensuse.org/package/show/home:rhabacker:branches:windows:mingw:win32:KF516/mingw32-kcoreaddons

Diffs

  • KF5CoreAddonsConfig.cmake.in (dce3a4e65599b286d8fedbaa20235f5025f509e8)

View Diff

--===============0819281812769479189==-- --===============5588161716534676802== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KS2RlLWZyYW1l d29ya3MtZGV2ZWwgbWFpbGluZyBsaXN0CktkZS1mcmFtZXdvcmtzLWRldmVsQGtkZS5vcmcKaHR0 cHM6Ly9tYWlsLmtkZS5vcmcvbWFpbG1hbi9saXN0aW5mby9rZGUtZnJhbWV3b3Jrcy1kZXZlbAo= --===============5588161716534676802==--