Merge pull request #5430 from janetournois/Scripts-collect_dlls_for_demo_cygwin-jtournois

Scripts - collect dlls for Polyhedron demo with cygwin
This commit is contained in:
Laurent Rineau
2021-04-28 15:24:18 +02:00
3 changed files with 93 additions and 34 deletions
+14 -1
View File
@@ -661,7 +661,20 @@ echo 'COLLECTING RESULTS';
./collect_cgal_testresults_from_cmake;
if [ -n "\$COLLECT_DEMOS_BINARIES" ]; then
echo 'COLLECTING DEMOS BINARIES';
tar czvf '${CGAL_TEST_DIR}/demos_${CGAL_TESTER}_${PLATFORM}.tar.gz' *_Demo/*.exe *_Demo/*.dll *_Demo/*/*.dll *_Demo/*/*/*.dll
echo "cp ${CGAL_TEST_DIR}/../developer_scripts/cgal_demo_copy_all_dlls_cygwin.sh ${CGAL_BINARY_DIR}/test"
cp "${CGAL_TEST_DIR}/../developer_scripts/cgal_demo_copy_all_dlls_cygwin.sh" "${CGAL_BINARY_DIR}/test"
EOF
cat >> "$file" <<'EOF'
for demo_dir in *_Demo; do
echo "pushd ${demo_dir}"
pushd "${demo_dir}"
bash ../cgal_demo_copy_all_dlls_cygwin.sh "${demo_dir}_with_dlls" ""
mv "${demo_dir}_with_dlls" ..
popd
done
EOF
cat >> "$file" <<EOF
tar czvf "${CGAL_TEST_DIR}/demos_${CGAL_TESTER}_${PLATFORM}.tar.gz" *_Demo_with_dlls/*
fi
echo 'COPYING RESULTS';
cp 'results_${CGAL_TESTER}_${PLATFORM}.tar.gz' 'results_${CGAL_TESTER}_${PLATFORM}.txt' '${CGAL_TEST_DIR}';
@@ -0,0 +1,46 @@
#!/bin/bash
#use this script from inside the build directory of the Polyhedron demo
#Needs the Qt5_DIR env variable set to <Qt5_ROOT>/lib/cmake/Qt5
#No config : in autotest_cgal we use NMake as generator
#If using MSVC Generator, declare config="Release"
declare config="$2"
declare target_directory="$1"
if [[ ! -d "$target_directory" ]]
then
mkdir $target_directory
fi
copy_dll()
{
local dll_full_path=$(cygpath --unix --absolute "$1")
echo "copy $dll_full_path to $2"
#remove all dlls from system and Visual
if ! [[ "$dll_full_path" =~ "api-ms-win" ]] && ! [[ "$dll_full_path" =~ "system32" ]]; then
cp "$dll_full_path" "$2"
fi
}
files=($PWD/$config/*.exe)
files+=($PWD/$config/*.dll)
files+=($PWD/Plugins/*/$config/*.dll)
for file in "${files[@]}"; do
# copy exe or dll
copy_dll "$file" "$target_directory"
# list and copy dependencies
cygcheck "$file" | while read -r dll ; do
copy_dll "$dll" "$target_directory"
done; #check dependencies
done #loop over directories
mkdir -p "$target_directory/platforms"
cp "$Qt5_DIR/../../../plugins/platforms/qwindows.dll" "$target_directory/platforms"