Revision
87615
Author
ryandesign@macports.org
Date
2011-11-28 13:12:21 -0800 (Mon, 28 Nov 2011)

Log Message

cgal: prevent build failure when old version is active; see #31562

Modified Paths

Diff

Modified: trunk/dports/gis/cgal/Portfile (87614 => 87615)


--- trunk/dports/gis/cgal/Portfile	2011-11-28 21:11:56 UTC (rev 87614)
+++ trunk/dports/gis/cgal/Portfile	2011-11-28 21:12:21 UTC (rev 87615)
@@ -49,6 +49,19 @@
     }
 }
 
+pre-build {
+    # When building 3.9 with 3.8 active:
+    # error: 'CGAL_CORE_finite' was not declared in this scope
+    if {[file exists ${prefix}/include/CGAL/version.h]} {
+        set installed_version [exec awk {/^#define +CGAL_VERSION +/ {print $3}} ${prefix}/include/CGAL/version.h]
+        if {${version} != ${installed_version}} {
+            ui_error "${name} ${version} cannot be built while ${name} ${installed_version} is installed and active."
+            ui_error "Please deactivate ${name} ${installed_version} first."
+            return -code error "incompatible ${name} version active"
+        }
+    }
+}
+
 variant demos description {Create demos} {
 	PortGroup				qt4 1.0