[cig-commits] r13834 - cs/cigma/trunk/config

luis at geodynamics.org luis at geodynamics.org
Mon Jan 12 14:10:00 PST 2009


Author: luis
Date: 2009-01-12 14:10:00 -0800 (Mon, 12 Jan 2009)
New Revision: 13834

Modified:
   cs/cigma/trunk/config/cigma_vtk.m4
Log:
Updated cigma_vtk.m4 autoconf macro

We now derive the vtk suffix from the vtk version number. A suffix
may still be specified, but will conflict with the version flag.

Modified: cs/cigma/trunk/config/cigma_vtk.m4
===================================================================
--- cs/cigma/trunk/config/cigma_vtk.m4	2009-01-12 22:09:59 UTC (rev 13833)
+++ cs/cigma/trunk/config/cigma_vtk.m4	2009-01-12 22:10:00 UTC (rev 13834)
@@ -18,18 +18,51 @@
 # Adds the --with-vtk=PATH option to the configure options
 #
 AC_DEFUN([CIGMA_OPTIONS_VTK],[
+
+    # vtk install prefix
     AC_ARG_WITH([vtk],
                 [AC_HELP_STRING(
                     [--with-vtk],
                     [The prefix where VTK is installed @<:@default=/usr@:>@])],
                 [with_vtk="$withval"],
                 [with_vtk="/usr"])
+
+    # vtk suffix, to allow for multiple installations of vtk libraries
     AC_ARG_WITH([vtk-suffix],
                 [AC_HELP_STRING(
                     [--with-vtk-suffix],
-                    [Suffix to append to VTK's include directory, e.g., for vtk-5.2/ the suffix is "-5.2" (default)])],
+                    [Suffix to append to VTK's include directory, e.g., for vtk-5.2/ the suffix is "-5.2"])],
                 [vtk_suffix="$withval"],
-                [vtk_suffix="-5.2"])
+                [vtk_suffix=""])
+
+    # alternatively, derive suffix from version number
+    AC_ARG_WITH([vtk-version],
+                [AC_HELP_STRING(
+                    [--with-vtk-version],
+                    [Version number of VTK library @<:@default=5.2@:>@])],
+                [vtk_version="$withval"],
+                [vtk_version="5.2"])
+
+    if [[ -z "$vtk_suffix" ]]; then
+
+        # 
+        # suffix was not specified. use the version number
+        # to calculate what it should be
+        #
+        if [[ -n "$vtk_version" ]]; then
+            vtk_suffix="-$vtk_version"
+        fi
+
+    else
+        # 
+        # suffix was specified. ignore version silently?
+        # produce error for now
+        #
+        if [[ -n "$vtk_version" ]]; then
+            AC_MSG_ERROR([The option --with-vtk-suffix overrides --with-vtk-version. Do not use simultaneously.])
+        fi
+
+    fi
 ])
 
 ##############################################################################



More information about the CIG-COMMITS mailing list