From 32f6d6d555db91e3aa23d11419c40e7677c4b2c8 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 11 Aug 2010 09:10:46 +0000 Subject: [PATCH] Fix cgal_test_with_cmake from Point_set_processing_3 and Surface_reconstruction_points_3: - [ "a" == "b" ] is a syntax of Bash. The POSIX way if with a single '='. - do not override MAKE_CMD if it is already set (to jom, for example). --- .../cgal_test_with_cmake | 27 ++++++++------- .../cgal_test_with_cmake | 17 ++++++---- .../cgal_test_with_cmake | 33 ++++++++++--------- .../cgal_test_with_cmake | 5 ++- .../cgal_test_with_cmake | 11 ++++--- 5 files changed, 54 insertions(+), 39 deletions(-) diff --git a/Point_set_processing_3/examples/Point_set_processing_3/cgal_test_with_cmake b/Point_set_processing_3/examples/Point_set_processing_3/cgal_test_with_cmake index a30075bd179..194a97b4df1 100755 --- a/Point_set_processing_3/examples/Point_set_processing_3/cgal_test_with_cmake +++ b/Point_set_processing_3/examples/Point_set_processing_3/cgal_test_with_cmake @@ -26,7 +26,10 @@ MAKE_CLEAN_CMD="devenv.com *.sln /Clean Release" ;; -GNMake* ) # if nmake - MAKE_CMD="nmake -fMakefile" + if [ -z "$MAKE_CMD" ]; then + MAKE_CMD="nmake" + fi + MAKE_CMD="${MAKE_CMD} -fMakefile" MAKE_CLEAN_CMD="${MAKE_CMD} clean" ;; * ) # if make @@ -83,7 +86,7 @@ can_compile() fi ;; * ) # if make or nmake - if ${MAKE_CMD} help | grep "$1" > /dev/null; then + if ${MAKE_CMD} help | grep "$1\$" > /dev/null; then echo y else echo n @@ -164,39 +167,39 @@ if [ $# -ne 0 ] ; then done else echo "Run all tests." - if [ `can_compile average_spacing_example` == "y" ]; then + if [ `can_compile average_spacing_example` = "y" ]; then compile_and_run average_spacing_example [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile grid_simplification_example` == "y" ]; then + if [ `can_compile grid_simplification_example` = "y" ]; then compile_and_run grid_simplification_example [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile jet_smoothing_example` == "y" ]; then + if [ `can_compile jet_smoothing_example` = "y" ]; then compile_and_run jet_smoothing_example [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile normal_estimation` == "y" ]; then + if [ `can_compile normal_estimation` = "y" ]; then compile_and_run normal_estimation [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile normals_example` == "y" ]; then + if [ `can_compile normals_example` = "y" ]; then compile_and_run normals_example [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile property_map` == "y" ]; then + if [ `can_compile property_map` = "y" ]; then compile_and_run property_map [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile random_simplification_example` == "y" ]; then + if [ `can_compile random_simplification_example` = "y" ]; then compile_and_run random_simplification_example [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile read_write_xyz_point_set_example` == "y" ]; then + if [ `can_compile read_write_xyz_point_set_example` = "y" ]; then compile_and_run read_write_xyz_point_set_example [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile remove_outliers_example` == "y" ]; then + if [ `can_compile remove_outliers_example` = "y" ]; then compile_and_run remove_outliers_example [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi @@ -206,7 +209,7 @@ fi # The clean target generated by CMake under cygwin # always fails for some reason # -if [ "${NEED_CLEAN}" == "y" ]; then +if [ "${NEED_CLEAN}" = "y" ]; then if ! ( uname | grep -q "CYGWIN" ) ; then ${MAKE_CLEAN_CMD} fi diff --git a/Point_set_processing_3/test/Point_set_processing_3/cgal_test_with_cmake b/Point_set_processing_3/test/Point_set_processing_3/cgal_test_with_cmake index 069a2262d32..5361f0bbf70 100755 --- a/Point_set_processing_3/test/Point_set_processing_3/cgal_test_with_cmake +++ b/Point_set_processing_3/test/Point_set_processing_3/cgal_test_with_cmake @@ -26,7 +26,10 @@ MAKE_CLEAN_CMD="devenv.com *.sln /Clean Release" ;; -GNMake* ) # if nmake - MAKE_CMD="nmake -fMakefile" + if [ -z "$MAKE_CMD" ]; then + MAKE_CMD="nmake" + fi + MAKE_CMD="${MAKE_CMD} -fMakefile" MAKE_CLEAN_CMD="${MAKE_CMD} clean" ;; * ) # if make @@ -83,7 +86,7 @@ can_compile() fi ;; * ) # if make or nmake - if ${MAKE_CMD} help | grep "$1" > /dev/null; then + if ${MAKE_CMD} help | grep "$1\$" > /dev/null; then echo y else echo n @@ -164,19 +167,19 @@ if [ $# -ne 0 ] ; then done else echo "Run all tests." - if [ `can_compile analysis_test` == "y" ]; then + if [ `can_compile analysis_test` = "y" ]; then compile_and_run analysis_test [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile normal_estimation_test` == "y" ]; then + if [ `can_compile normal_estimation_test` = "y" ]; then compile_and_run normal_estimation_test [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile remove_outliers_test` == "y" ]; then + if [ `can_compile remove_outliers_test` = "y" ]; then compile_and_run remove_outliers_test [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile smoothing_test` == "y" ]; then + if [ `can_compile smoothing_test` = "y" ]; then compile_and_run smoothing_test [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi @@ -186,7 +189,7 @@ fi # The clean target generated by CMake under cygwin # always fails for some reason # -if [ "${NEED_CLEAN}" == "y" ]; then +if [ "${NEED_CLEAN}" = "y" ]; then if ! ( uname | grep -q "CYGWIN" ) ; then ${MAKE_CLEAN_CMD} fi diff --git a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/cgal_test_with_cmake b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/cgal_test_with_cmake index b1b38fd9e32..6e3f018d3c9 100755 --- a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/cgal_test_with_cmake +++ b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/cgal_test_with_cmake @@ -26,7 +26,10 @@ MAKE_CLEAN_CMD="devenv.com *.sln /Clean Release" ;; -GNMake* ) # if nmake - MAKE_CMD="nmake -fMakefile" + if [ -z "$MAKE_CMD" ]; then + MAKE_CMD="nmake" + fi + MAKE_CMD="${MAKE_CMD} -fMakefile" MAKE_CLEAN_CMD="${MAKE_CMD} clean" ;; * ) # if make @@ -83,7 +86,7 @@ can_compile() fi ;; * ) # if make or nmake - if ${MAKE_CMD} help | grep "$1" > /dev/null; then + if ${MAKE_CMD} help | grep "$1\$" > /dev/null; then echo y else echo n @@ -164,51 +167,51 @@ if [ $# -ne 0 ] ; then done else echo "Run all tests." - if [ `can_compile Point_set_demo` == "y" ]; then + if [ `can_compile Point_set_demo` = "y" ]; then compile_and_run Point_set_demo [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_APSS_plugin` == "y" ]; then + if [ `can_compile PS_demo_APSS_plugin` = "y" ]; then compile_and_run PS_demo_APSS_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_average_spacing_plugin` == "y" ]; then + if [ `can_compile PS_demo_average_spacing_plugin` = "y" ]; then compile_and_run PS_demo_average_spacing_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_cleaning_plugin` == "y" ]; then + if [ `can_compile PS_demo_cleaning_plugin` = "y" ]; then compile_and_run PS_demo_cleaning_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_inside_out_plugin` == "y" ]; then + if [ `can_compile PS_demo_inside_out_plugin` = "y" ]; then compile_and_run PS_demo_inside_out_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_local_spacing_plugin` == "y" ]; then + if [ `can_compile PS_demo_local_spacing_plugin` = "y" ]; then compile_and_run PS_demo_local_spacing_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_normal_estimation_plugin` == "y" ]; then + if [ `can_compile PS_demo_normal_estimation_plugin` = "y" ]; then compile_and_run PS_demo_normal_estimation_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_off_plugin` == "y" ]; then + if [ `can_compile PS_demo_off_plugin` = "y" ]; then compile_and_run PS_demo_off_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_poisson_plugin` == "y" ]; then + if [ `can_compile PS_demo_poisson_plugin` = "y" ]; then compile_and_run PS_demo_poisson_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_simplification_plugin` == "y" ]; then + if [ `can_compile PS_demo_simplification_plugin` = "y" ]; then compile_and_run PS_demo_simplification_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_smoothing_plugin` == "y" ]; then + if [ `can_compile PS_demo_smoothing_plugin` = "y" ]; then compile_and_run PS_demo_smoothing_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi - if [ `can_compile PS_demo_xyz_plugin` == "y" ]; then + if [ `can_compile PS_demo_xyz_plugin` = "y" ]; then compile_and_run PS_demo_xyz_plugin [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi @@ -218,7 +221,7 @@ fi # The clean target generated by CMake under cygwin # always fails for some reason # -if [ "${NEED_CLEAN}" == "y" ]; then +if [ "${NEED_CLEAN}" = "y" ]; then if ! ( uname | grep -q "CYGWIN" ) ; then ${MAKE_CLEAN_CMD} fi diff --git a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/cgal_test_with_cmake b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/cgal_test_with_cmake index dfce0ae3c19..691ba9b4369 100755 --- a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/cgal_test_with_cmake +++ b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/cgal_test_with_cmake @@ -26,7 +26,10 @@ MAKE_CLEAN_CMD="devenv.com *.sln /Clean Release" ;; -GNMake* ) # if nmake - MAKE_CMD="nmake -fMakefile" + if [ -z "$MAKE_CMD" ]; then + MAKE_CMD="nmake" + fi + MAKE_CMD="${MAKE_CMD} -fMakefile" MAKE_CLEAN_CMD="${MAKE_CMD} clean" ;; * ) # if make diff --git a/Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/cgal_test_with_cmake b/Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/cgal_test_with_cmake index 38f8b1a6d28..604f9b4d139 100755 --- a/Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/cgal_test_with_cmake +++ b/Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/cgal_test_with_cmake @@ -26,7 +26,10 @@ MAKE_CLEAN_CMD="devenv.com *.sln /Clean Release" ;; -GNMake* ) # if nmake - MAKE_CMD="nmake -fMakefile" + if [ -z "$MAKE_CMD" ]; then + MAKE_CMD="nmake" + fi + MAKE_CMD="${MAKE_CMD} -fMakefile" MAKE_CLEAN_CMD="${MAKE_CMD} clean" ;; * ) # if make @@ -83,7 +86,7 @@ can_compile() fi ;; * ) # if make or nmake - if ${MAKE_CMD} help | grep "$1" > /dev/null; then + if ${MAKE_CMD} help | grep "$1\$" > /dev/null; then echo y else echo n @@ -164,7 +167,7 @@ if [ $# -ne 0 ] ; then done else echo "Run all tests." - if [ `can_compile poisson_reconstruction_test` == "y" ]; then + if [ `can_compile poisson_reconstruction_test` = "y" ]; then compile_and_run poisson_reconstruction_test [ -z "${NEED_CLEAN}" ] && NEED_CLEAN=y fi @@ -174,7 +177,7 @@ fi # The clean target generated by CMake under cygwin # always fails for some reason # -if [ "${NEED_CLEAN}" == "y" ]; then +if [ "${NEED_CLEAN}" = "y" ]; then if ! ( uname | grep -q "CYGWIN" ) ; then ${MAKE_CLEAN_CMD} fi