diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 809761c..af4c70a 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -68,7 +68,20 @@ set(imported_target "Grantlee5::defaultfilters") message(STATUS "Fetching imported location for target ${imported_target}") -get_property(imported_location TARGET "${imported_target}" PROPERTY IMPORTED_LOCATION_NONE) +foreach(property_name IMPORTED_LOCATION_NONE IMPORTED_LOCATION_RELWITHDEBINFO) + get_property(imported_location TARGET "${imported_target}" PROPERTY "${property_name}") + + message(STATUS "Property ${property_name} value: \"${imported_location}\"") + + if(NOT "${imported_location}" STREQUAL "") + break() + endif() +endforeach() + +if("${imported_location}" STREQUAL "") + message(FATAL_ERROR "Could not find location with CMake") +endif() + message(STATUS "Imported location: ${imported_location}") file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/imported-location" "${imported_location}") @@ -76,6 +89,10 @@ EOF cmake . &>cmake.log + if [[ "$VERBOSE" != "" ]]; then + cat cmake.log + fi + # clean up log if everything worked, otherwise it would be printed by the cleanup handler rm cmake.log @@ -91,6 +108,8 @@ EOF popd &>/dev/null fi +echo "\$GRANTLEE5_PLUGINS_DIR=$GRANTLEE5_PLUGINS_DIR" + if [[ ! -d "$GRANTLEE5_PLUGINS_DIR" ]]; then echo "Error: grantlee5 plugins directory does not exist or could not be found" exit 2 @@ -98,7 +117,12 @@ fi # guess grantlee version from the plugin path # this should always be the last component, as the plugins need to be stored in a directory like .../grantlee//grantlee*.so -grantlee5_version="$(echo "$GRANTLEE5_PLUGINS_DIR" | rev | cut -d/ -f1 | rev)" +grantlee5_version="$(echo "$GRANTLEE5_PLUGINS_DIR" | sed -e 's|/*$||' | rev | cut -d/ -f1 | rev)" + +if [[ "$grantlee5_version" == "" ]]; then + echo "Error: failed to detect grantlee5 version" + exit 2 +fi target_dir="$appdir"/usr/plugins/grantlee/"$grantlee5_version" diff --git a/tests/test-plugins.sh b/tests/test-plugins.sh index f010835..3130b35 100755 --- a/tests/test-plugins.sh +++ b/tests/test-plugins.sh @@ -58,7 +58,7 @@ while IFS= read -r -d '' plugin; do echo -e "\033[1mTesting plugin $name...\033[0m" printf "%-60s" " - lint plugin" - run_valid_command shellcheck "$plugin" + run_valid_command shellcheck --external-sources "$plugin" printf "%-60s" " - run with wrong usage" run_invalid_command bash "$plugin"