--- plplot-5.9.9/cmake/modules/octave.cmake.orig 2011-10-13 02:43:01.000000000 +0200 +++ plplot-5.9.9/cmake/modules/octave.cmake 2011-11-18 21:36:22.706537040 +0100 @@ -241,6 +241,7 @@ # octave-2.1 (or higher) logic. #_OCTAVE_M_DIR + if(NOT DEFINED OCTAVE_M_DIR) file(WRITE ${CMAKE_BINARY_DIR}/octave_command "printf(octave_config_info(\"localfcnfiledir\"));" ) @@ -249,9 +250,19 @@ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE _OCTAVE_M_DIR ) + # Replace the OCTAVE_PREFIX with the PLplot prefix in OCTAVE_M_DIR + string(REPLACE + "${OCTAVE_PREFIX}" + "${CMAKE_INSTALL_PREFIX}" + OCTAVE_M_DIR + ${_OCTAVE_M_DIR} + ) + #message(STATUS "_OCTAVE_M_DIR = ${_OCTAVE_M_DIR}") file(TO_CMAKE_PATH ${_OCTAVE_M_DIR} _OCTAVE_M_DIR) #message(STATUS "(CMake) _OCTAVE_M_DIR = ${_OCTAVE_M_DIR}") + endif(NOT DEFINED OCTAVE_M_DIR) + message(STATUS "OCTAVE_M_DIR = ${OCTAVE_M_DIR}") #OCTAVE_OCT_DIR if(NOT DEFINED OCTAVE_OCT_DIR) @@ -268,15 +279,6 @@ #message(STATUS "(CMake) OCTAVE_OCT_DIR = ${OCTAVE_OCT_DIR}") endif(NOT DEFINED OCTAVE_OCT_DIR) - # Replace the OCTAVE_PREFIX with the PLplot prefix in OCTAVE_M_DIR - string(REPLACE - "${OCTAVE_PREFIX}" - "${CMAKE_INSTALL_PREFIX}" - OCTAVE_M_DIR - ${_OCTAVE_M_DIR} - ) - message(STATUS "OCTAVE_M_DIR = ${OCTAVE_M_DIR}") - # Transform OCTAVE_OCT_DIR if prefixes not the same. if(NOT CMAKE_INSTALL_PREFIX STREQUAL "${OCTAVE_PREFIX}") set(OCTAVE_OCT_DIR ${CMAKE_INSTALL_LIBDIR}/octave)