Fix debug widget packaging 79/24779/1
authorScott Murray <scott.murray@konsulko.com>
Tue, 16 Jun 2020 22:34:34 +0000 (18:34 -0400)
committerScott Murray <scott.murray@konsulko.com>
Tue, 16 Jun 2020 22:38:00 +0000 (18:38 -0400)
Add some logic to add "-debug" in the name of the debug widget file
to match the behavior of widget builds that use the cmake app
template.

Bug-AGL: SPEC-2049, SPEC-3300

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I4cd6930835f8363ff4e7152a3537772735559a06

CMakeLists.txt

index d18172d..9b8ff97 100644 (file)
@@ -47,6 +47,12 @@ install (TARGETS yelp-client DESTINATION bin)
 # AGL binding
 configure_file(config.xml.in config.xml)
 
+if("${CMAKE_BUILD_TYPE}" MATCHES "[Dd][Ee][Bb][Uu][Gg]")
+  set (WGT_SUFFIX "-debug")
+else()
+  set (WGT_SUFFIX "")
+endif()
+
 add_custom_command(
        OUTPUT poi.wgt
        DEPENDS yelp-client
@@ -55,7 +61,7 @@ add_custom_command(
        COMMAND cp config.xml package/root/
        COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/HMI_AppLauncher_POI_Active-01.png package/root/icon.png
        COMMAND cp yelp-client package/root/poi
-       COMMAND wgtpkg-pack -f -o package/poi.wgt package/root
-       COMMAND cp package/poi.wgt .
+       COMMAND wgtpkg-pack -f -o package/poi${WGT_SUFFIX}.wgt package/root
+       COMMAND cp package/poi${WGT_SUFFIX}.wgt .
 )
 add_custom_target(widget ALL DEPENDS poi.wgt)