OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
| 1 | Index: plplot-5.9.7/cmake/modules/octave.cmake |
| 2 | =================================================================== |
| 3 | --- plplot-5.9.7.orig/cmake/modules/octave.cmake 2011-01-28 20:38:37.000000000 +0100 |
| 4 | +++ plplot-5.9.7/cmake/modules/octave.cmake 2011-01-29 12:38:57.000000000 +0100 |
| 5 | @@ -45,12 +45,12 @@ |
| 6 | endif(ENABLE_octave AND NOT PERL_FOUND) |
| 7 | |
| 8 | if(ENABLE_octave) |
| 9 | - find_program(OCTAVE octave) |
| 10 | + find_program(OCTAVE octave-config) |
| 11 | if(OCTAVE) |
| 12 | message(STATUS "OCTAVE = ${OCTAVE}") |
| 13 | else(OCTAVE) |
| 14 | message(STATUS "WARNING: " |
| 15 | - "octave not found. Disabling octave bindings") |
| 16 | + "octave-config not found.") |
| 17 | set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE) |
| 18 | endif(OCTAVE) |
| 19 | endif(ENABLE_octave) |
| 20 | @@ -71,10 +71,11 @@ |
| 21 | execute_process( |
| 22 | COMMAND ${OCTAVE} --version |
| 23 | OUTPUT_VARIABLE _OCTAVE_VERSION |
| 24 | + OUTPUT_STRIP_TRAILING_WHITESPACE |
| 25 | ) |
| 26 | string(REGEX REPLACE |
| 27 | - "^.*version ([0-9]\\.[0-9]\\.[0-9]*).*$" |
| 28 | - "\\1" |
| 29 | + "^.*(version )?([0-9]\\.[0-9]\\.[0-9]*).*$" |
| 30 | + "\\2" |
| 31 | OCTAVE_VERSION |
| 32 | ${_OCTAVE_VERSION} |
| 33 | ) |
| 34 | @@ -168,35 +169,38 @@ |
| 35 | # this method because as far as I know there is no method |
| 36 | # of invoking octave scripts from the octave command line other than |
| 37 | # with a file. |
| 38 | - file(WRITE ${CMAKE_BINARY_DIR}/octave_command |
| 39 | - "printf(octave_config_info(\"prefix\"));" |
| 40 | - ) |
| 41 | +# file(WRITE ${CMAKE_BINARY_DIR}/octave_command |
| 42 | +# "printf(octave_config_info(\"prefix\"));" |
| 43 | +# ) |
| 44 | execute_process( |
| 45 | - COMMAND ${OCTAVE} -q -f octave_command |
| 46 | + COMMAND ${OCTAVE} -p PREFIX |
| 47 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
| 48 | OUTPUT_VARIABLE OCTAVE_PREFIX |
| 49 | + OUTPUT_STRIP_TRAILING_WHITESPACE |
| 50 | ) |
| 51 | - #message(STATUS "OCTAVE_PREFIX = ${OCTAVE_PREFIX}") |
| 52 | + message(STATUS "OCTAVE_PREFIX = ${OCTAVE_PREFIX}") |
| 53 | |
| 54 | # octave-2.1 (or higher) logic. |
| 55 | #_OCTAVE_M_DIR |
| 56 | - file(WRITE ${CMAKE_BINARY_DIR}/octave_command |
| 57 | - "printf(octave_config_info(\"localfcnfiledir\"));" |
| 58 | - ) |
| 59 | +# file(WRITE ${CMAKE_BINARY_DIR}/octave_command |
| 60 | +# "printf(octave_config_info(\"localfcnfiledir\"));" |
| 61 | +# ) |
| 62 | execute_process( |
| 63 | - COMMAND ${OCTAVE} -q -f octave_command |
| 64 | + COMMAND ${OCTAVE} -p LOCALFCNFILEDIR |
| 65 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
| 66 | OUTPUT_VARIABLE _OCTAVE_M_DIR |
| 67 | + OUTPUT_STRIP_TRAILING_WHITESPACE |
| 68 | ) |
| 69 | #OCTAVE_OCT_DIR |
| 70 | if(NOT DEFINED OCTAVE_OCT_DIR) |
| 71 | - file(WRITE ${CMAKE_BINARY_DIR}/octave_command |
| 72 | - "printf(octave_config_info(\"localoctfiledir\"));" |
| 73 | - ) |
| 74 | +# file(WRITE ${CMAKE_BINARY_DIR}/octave_command |
| 75 | +# "printf(octave_config_info(\"localoctfiledir\"));" |
| 76 | +# ) |
| 77 | execute_process( |
| 78 | - COMMAND ${OCTAVE} -q -f octave_command |
| 79 | + COMMAND ${OCTAVE} -p LOCALVEROCTFILEDIR |
| 80 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
| 81 | OUTPUT_VARIABLE OCTAVE_OCT_DIR |
| 82 | + OUTPUT_STRIP_TRAILING_WHITESPACE |
| 83 | ) |
| 84 | endif(NOT DEFINED OCTAVE_OCT_DIR) |
| 85 | |
| 86 |
