From: <ai...@us...> - 2011-02-09 22:10:32
|
Revision: 11552 http://plplot.svn.sourceforge.net/plplot/?rev=11552&view=rev Author: airwin Date: 2011-02-09 22:10:25 +0000 (Wed, 09 Feb 2011) Log Message: ----------- The swig-generated bindings for octave are completely mature now, AFAIK. Therefore, replace the ENABLE_swig_octave ON/OFF option with ENABLE_matwrapped_octave OFF/ON option with the default being ENABLE_matwrapped_octave=OFF. Emphasize that ENABLE_matwrapped_octave=ON is a legacy alternative that is not going to be around for much longer (my guess is we will probably drop it just after the next release). Modified Paths: -------------- trunk/README.release trunk/bindings/octave/CMakeLists.txt trunk/cmake/modules/octave.cmake trunk/plplot_test/CMakeLists.txt Modified: trunk/README.release =================================================================== --- trunk/README.release 2011-02-09 13:21:11 UTC (rev 11551) +++ trunk/README.release 2011-02-09 22:10:25 UTC (rev 11552) @@ -348,9 +348,12 @@ (all of which have now have been updated to use those functions) and get consistent results with the corresponding C examples. The swig-generated bindings for Octave are used by default, but the build -system falls back to the matwrapped bindings if swig is not available. -Users can force the matwrapped bindings by using the --DENABLE_swig_octave=OFF cmake command-line option. +system falls back to the legacy matwrapped bindings if swig is not +available. For now, users can force the legacy matwrapped bindings by +using the -DENABLE_matwrapped_octave=ON cmake command-line option for +comparison purposes, but in the near future we plan to remove the +matwrapped octave bindings because the swig-generated alternative is +more complete and easier to maintain. Like the matwrapped bindings before it, the new swig-generated octave bindings currently do not have a number of the PLplot functions @@ -1170,9 +1173,12 @@ (all of which have now have been updated to use those functions) and get consistent results with the corresponding C examples. The swig-generated bindings for Octave are used by default, but the build -system falls back to the matwrapped bindings if swig is not available. -Users can force the matwrapped bindings by using the --DENABLE_swig_octave=OFF cmake command-line option. +system falls back to the legacy matwrapped bindings if swig is not +available. For now, users can force the legacy matwrapped bindings by +using the -DENABLE_matwrapped_octave=ON cmake command-line option for +comparison purposes, but in the near future we plan to remove the +matwrapped octave bindings because the swig-generated alternative is +more complete and easier to maintain. Like the matwrapped bindings before it, the new swig-generated octave bindings currently do not have a number of the PLplot functions Modified: trunk/bindings/octave/CMakeLists.txt =================================================================== --- trunk/bindings/octave/CMakeLists.txt 2011-02-09 13:21:11 UTC (rev 11551) +++ trunk/bindings/octave/CMakeLists.txt 2011-02-09 22:10:25 UTC (rev 11552) @@ -121,6 +121,8 @@ ) # Add (Unix) custom target to check that plplot_oct_def is up to date. + # This check only relevant for legacy matwrapped octave bindings since + # swig-based bindings don't use plplot_oct_def. add_custom_target( check_plplot_octave_def COMMAND ${CMAKE_COMMAND} -E remove -f @@ -137,66 +139,11 @@ ) # Build octave interface. - if(ENABLE_swig_octave) - - add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub_hand_crafted.m - ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub_hand_crafted.m - ) - - add_custom_target( - plplot_stub.m_built ALL - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m - ) - + if(ENABLE_matwrapped_octave) set(octave_interface_INCLUDE_PATHS ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/lib/qsastime ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR} - ${OCTAVE_INCLUDE_PATH} - ${CMAKE_SOURCE_DIR}/bindings/swig-support - ) - include_directories(${octave_interface_INCLUDE_PATHS}) - set(CMAKE_SWIG_FLAGS -DSWIG_OCTAVE) - set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}) - - set_source_files_properties(plplot_octave.i - PROPERTIES - SWIG_MODULE_NAME plplot_octave - CPLUSPLUS ON - ) - - set(SWIG_MODULE_plplot_octave_EXTRA_DEPS - ${CMAKE_SOURCE_DIR}/bindings/swig-support/swig_documentation.i - ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i - ) - - # Set up swig + c wrapper. - swig_add_module(plplot_octave octave plplot_octave.i) - swig_link_libraries( - plplot_octave - plplot${LIB_TAG} - "${OCTAVE_LIBRARIES}" - "${OCTINTERP_LIBRARIES}" - ) - - # Make sure plplot_stub.m is copied to build tree before plplot_octave - # is created so can use plplot_octave in normal way. - add_dependencies(plplot_octave plplot_stub.m_built) - - else(ENABLE_swig_octave) - set(octave_interface_INCLUDE_PATHS - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${OCTAVE_INCLUDE_PATH} @@ -272,9 +219,61 @@ # serialize these custom targets so that parallel build jobs # don't interfere with each other. add_dependencies(plplot_stub.m_built make_documentation) + else(ENABLE_matwrapped_octave) + add_custom_command( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub_hand_crafted.m + ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub_hand_crafted.m + ) - endif(ENABLE_swig_octave) + add_custom_target( + plplot_stub.m_built ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m + ) + set(octave_interface_INCLUDE_PATHS + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/lib/qsastime + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/include + ${CMAKE_CURRENT_BINARY_DIR} + ${OCTAVE_INCLUDE_PATH} + ${CMAKE_SOURCE_DIR}/bindings/swig-support + ) + include_directories(${octave_interface_INCLUDE_PATHS}) + set(CMAKE_SWIG_FLAGS -DSWIG_OCTAVE) + set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}) + + set_source_files_properties(plplot_octave.i + PROPERTIES + SWIG_MODULE_NAME plplot_octave + CPLUSPLUS ON + ) + + set(SWIG_MODULE_plplot_octave_EXTRA_DEPS + ${CMAKE_SOURCE_DIR}/bindings/swig-support/swig_documentation.i + ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i + ) + + # Set up swig + c wrapper. + swig_add_module(plplot_octave octave plplot_octave.i) + swig_link_libraries( + plplot_octave + plplot${LIB_TAG} + "${OCTAVE_LIBRARIES}" + "${OCTINTERP_LIBRARIES}" + ) + + # Make sure plplot_stub.m is copied to build tree before plplot_octave + # is created so can use plplot_octave in normal way. + add_dependencies(plplot_octave plplot_stub.m_built) + endif(ENABLE_matwrapped_octave) + # Need access elsewhere (examples/octave) to the file depends of # this custom target. set_property(GLOBAL PROPERTY Modified: trunk/cmake/modules/octave.cmake =================================================================== --- trunk/cmake/modules/octave.cmake 2011-02-09 13:21:11 UTC (rev 11551) +++ trunk/cmake/modules/octave.cmake 2011-02-09 22:10:25 UTC (rev 11552) @@ -263,11 +263,11 @@ if(PL_DOUBLE) set(DEFINE_PL_DOUBLE "#define PL_DOUBLE") endif(PL_DOUBLE) - option(ENABLE_swig_octave "Enable Octave bindings generated by SWIG" ON) - if(NOT SWIG_FOUND AND ENABLE_swig_octave) + option(ENABLE_matwrapped_octave "Enable legacy Octave bindings generated by matwrap" OFF) + if(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave) message(STATUS "WARNING: " - "SWIG not found. Falling back to deprecated matwrapped octave bindings.") - set(ENABLE_swig_octave OFF CACHE BOOL "Enable Octave bindings generated by SWIG" FORCE) - endif(NOT SWIG_FOUND AND ENABLE_swig_octave) + "SWIG not found. Falling back to deprecated matwrapped Octave bindings.") + set(ENABLE_matwrapped_octave ON CACHE BOOL "Enable legacy Octave bindings generated by matwrap" FORCE) + endif(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave) endif(ENABLE_octave) Modified: trunk/plplot_test/CMakeLists.txt =================================================================== --- trunk/plplot_test/CMakeLists.txt 2011-02-09 13:21:11 UTC (rev 11551) +++ trunk/plplot_test/CMakeLists.txt 2011-02-09 22:10:25 UTC (rev 11552) @@ -123,13 +123,13 @@ endif(ENABLE_java) if(ENABLE_octave) - if(ENABLE_swig_octave) + if(ENABLE_matwrapped_octave) + set(matwrap_octave_comment) + set(swig_octave_comment "# (ignore for matwrap-generated case) ") + else(ENABLE_matwrapped_octave) set(swig_octave_comment) set(matwrap_octave_comment "# (ignore for swig-generated case) ") - else(ENABLE_swig_octave) - set(matwrap_octave_comment) - set(swig_octave_comment "# (ignore for matwrap-generated case) ") - endif(ENABLE_swig_octave) + endif(ENABLE_matwrapped_octave) configure_file( test_octave_interactive.sh.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |