Per Persson wrote:
> Orion, Alan et al.
> 
> I did a quick check of the CBS on OS X about a week ago, I noticed a few 
> quirks but they are likely specific to my system... However, I had 
> problems with octave similar to what Orion has, so I started looking 
> into the octave.cmake file.
> 
> I'm not sure if octave-config is part of octave 2.7.x (I have only 2.9.x 
> installed) but if it is then I suggest that we use it to get octave 
> information for octave.cmake.
> 

Indeed, the existing code for parsing the version output from octave is 
broken (it expects versions like #.#.##, which breaks my case for 
2.9.9).  I like the octave-config version because minimal massaging is 
needed, though you were missing stripping the newline from the output of 
octave-version.  Here's the patch I'm currently using.  Next issue is 
that PATH_SUFFIXES seem to be broken on x86_64.

--- plplot-20061031/cmake/modules/octave.cmake.orig     2006-10-03 
10:50:49.000000000 -0600
+++ plplot-20061031/cmake/modules/octave.cmake  2006-10-31 
15:00:54.000000000 -0700
@@ -57,17 +57,23 @@
  endif(ENABLE_octave)

  if(ENABLE_octave)
+  find_program(OCTAVECONFIG octave-config)
+  if(OCTAVECONFIG)
+    message(STATUS "OCTAVECONFIG = ${OCTAVECONFIG}")
+  else(OCTAVECONFIG)
+    message(STATUS "WARNING: "
+    "octave-config not found. Disabling octave bindings")
+    set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
+  endif(OCTAVECONFIG)
+endif(ENABLE_octave)
+
+if(ENABLE_octave)
    #OCTAVE_VERSION is the (dotted triplet) octave version.
    execute_process(
-  COMMAND ${OCTAVE} --version
-  OUTPUT_VARIABLE _OCTAVE_VERSION
-  )
-  string(REGEX REPLACE
-  "^.*version ([0-9]\\.[0-9]\\.[0-9][0-9]).*$"
-  "\\1"
-  OCTAVE_VERSION
-  ${_OCTAVE_VERSION}
+  COMMAND ${OCTAVECONFIG} -p VERSION
+  OUTPUT_VARIABLE OCTAVE_VERSION
    )
+  STRING(REGEX REPLACE "(\r?\n)+$" "" OCTAVE_VERSION "${OCTAVE_VERSION}")
    message(STATUS "OCTAVE_VERSION = ${OCTAVE_VERSION}")

    # The following if block is required to keep from repeated pre-pending

-- 
Orion Poplawski
System Administrator                  303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  [EMAIL PROTECTED]
Boulder, CO 80301              http://www.cora.nwra.com

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to