[PATCH] Fix kirigami build

Dirk Hohndel dirk at hohndel.org
Wed Aug 17 21:44:19 PDT 2016


On Wed, Aug 17, 2016 at 06:50:35PM +0200, Anton Lundin wrote:
> This fixes the subsurface-mobile build on my Linux desktop and on
> android.
> 
> To get it to run on Linux desktop, set QT_QUICK_CONTROLS_STYLE to
> something that kirigami doesn't know about, like kakor. Otherwise it
> will detect Desktop and die on:
> qrc:/styles/Desktop/Icon.qml:23 module "org.kde.kquickcontrolsaddons" is not installed
> 
> This works with kirigami 32c980c46, when 47fb7821 is reverted.
> 
> Signed-off-by: Anton Lundin <glance at acc.umu.se>
> ---
> The cmake parts are sketchy at best, and should be fixed in a better way.
> 
> It would also be nice if kirigami static build did have a install target
> that created a dir contaning the needed parts.
> 
>  CMakeLists.txt              |  3 ++-
>  packaging/android/build.sh  | 13 +++++++++----
>  scripts/build.sh            | 10 +++++-----
>  scripts/mobilecomponents.sh |  7 ++++---
>  4 files changed, 20 insertions(+), 13 deletions(-)
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index a824d03..6328dc0 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -240,7 +240,8 @@ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
>  	endif()
>  	ADD_LIBRARY(kirigami_static_library STATIC IMPORTED)
>  	SET_TARGET_PROPERTIES(kirigami_static_library PROPERTIES
> -		IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../kirigami-build/src/libkirigamiplugin.a)
> +		IMPORTED_LOCATION ${KIRIGAMI_LIBRARY})

No, that breaks the build as KIRIGAMI LIBRARY is not defined in the
CMakeLists.txt file. It's fine to have this work if the value is provided
buy a build script, but there must be a default value so existing builds
don't break with syntax error.


> diff --git a/packaging/android/build.sh b/packaging/android/build.sh
> index d844e8d..4b353e3 100644
> --- a/packaging/android/build.sh
> +++ b/packaging/android/build.sh
> @@ -316,11 +316,15 @@ if [ "$SUBSURFACE_MOBILE" = "ON" ] ; then
>  	pushd $SUBSURFACE_SOURCE
>  	bash ./scripts/mobilecomponents.sh
>  	popd
> -	rm -rf kirigami-build
> -	mkdir -p kirigami-build
> -	pushd kirigami-build
> -	cmake $SUBSURFACE_SOURCE/mobile-widgets/qml/kirigami/ -DSTATIC_LIBRARY=ON -DCMAKE_PREFIX_PATH:UNINITIALIZED=${QT5_ANDROID}/android_${QT_ARCH}/lib/cmake
> +	rm -rf kirigami-build-$ARCH
> +	mkdir -p kirigami-build-$ARCH
> +	pushd kirigami-build-$ARCH
> +	cmake \
> +		$SUBSURFACE_SOURCE/../kirigami/ \
> +		-DSTATIC_LIBRARY=ON \
> +		-DCMAKE_PREFIX_PATH:UNINITIALIZED=${QT5_ANDROID}/android_${QT_ARCH}/lib/cmake
>  	make -j4
> +	KIRIGAMI_LIBRARY="-DKIRIGAMI_LIBRARY=../kirigami-build-$ARCH/src/libkirigamiplugin.a"

I don't like this way of using a variable...

> @@ -361,6 +365,7 @@ cmake $MOBILE_CMAKE \
>  	-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
>  	-DMAKE_TESTS=OFF \
>  	-DFTDISUPPORT=${FTDI} \
> +	$KIRIGAMI_LIBRARY \

I'd rather have
	-DKIRIGAMI_LIBRARY=$KIRIGAMI_LIBRARY


> diff --git a/scripts/build.sh b/scripts/build.sh
> index 02f1095..113ab6f 100755
> --- a/scripts/build.sh
> +++ b/scripts/build.sh
>  		make -j4
> +		KIRIGAMI_LIBRARY="-DKIRIGAMI_LIBRARY=$SRC/kirigami-build/src/libkirigamiplugin.a"
>  	fi
>  	cmake -DCMAKE_BUILD_TYPE=Debug .. \
> +		$KIRIGAMI_LIBRARY \
>  		-DSUBSURFACE_TARGET_EXECUTABLE=$SUBSURFACE_EXECUTABLE \

Ditto.

/D


More information about the subsurface mailing list