|
From: <ai...@us...> - 2010-12-20 23:23:03
|
Revision: 11380
http://plplot.svn.sourceforge.net/plplot/?rev=11380&view=rev
Author: airwin
Date: 2010-12-20 22:29:38 +0000 (Mon, 20 Dec 2010)
Log Message:
-----------
Make determination of Octave version a little more proof against
errors. I have checked this logic works on Linux for the normal
"octave --version" command. It also gives a soft landing when "octave
--version" is replaced by a bad octave command like "octave whatever".
However, the new logic cannot give a soft landing for internal octave
errors as occurs, for example, on wine.
Modified Paths:
--------------
trunk/cmake/modules/octave.cmake
Modified: trunk/cmake/modules/octave.cmake
===================================================================
--- trunk/cmake/modules/octave.cmake 2010-12-19 23:26:40 UTC (rev 11379)
+++ trunk/cmake/modules/octave.cmake 2010-12-20 22:29:38 UTC (rev 11380)
@@ -69,9 +69,20 @@
if(ENABLE_octave)
#OCTAVE_VERSION is the (dotted triplet) octave version.
execute_process(
- COMMAND ${OCTAVE} --version
- OUTPUT_VARIABLE _OCTAVE_VERSION
- )
+ COMMAND ${OCTAVE} --version
+ OUTPUT_VARIABLE _OCTAVE_VERSION
+ ERROR_VARIABLE OCTAVE_ERROR
+ RESULT_VARIABLE return_code
+ )
+ if(return_code)
+ message(STATUS "OCTAVE_ERROR = ${OCTAVE_ERROR}")
+ message(STATUS "WARNING: "
+ "${OCTAVE} --version generates an error (non-zero return code). Disabling octave bindings")
+ set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
+ endif(return_code)
+endif(ENABLE_octave)
+
+if(ENABLE_octave)
string(REGEX REPLACE
"^.*version ([0-9]\\.[0-9]\\.[0-9]*).*$"
"\\1"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|