From: <ai...@us...> - 2013-11-20 06:21:29
|
Revision: 12720 http://sourceforge.net/p/plplot/code/12720 Author: airwin Date: 2013-11-20 06:21:25 +0000 (Wed, 20 Nov 2013) Log Message: ----------- Allow tkwin "device" (actually the shared object that is dynamically loaded by the "package require Plplotter command) to use stub versions of the Tcl and Tk libraries. This completes the USE_TCL_TK_STUBS work without any build or run-time issues that can be attributed to using the stub versions of the Tcl/Tk libraries. Therefore, set USE_TCL_TK_STUBS=ON by default. Modified Paths: -------------- trunk/cmake/modules/tcl-related.cmake trunk/cmake/modules/tk.cmake trunk/drivers/CMakeLists.txt Modified: trunk/cmake/modules/tcl-related.cmake =================================================================== --- trunk/cmake/modules/tcl-related.cmake 2013-11-20 05:41:51 UTC (rev 12719) +++ trunk/cmake/modules/tcl-related.cmake 2013-11-20 06:21:25 UTC (rev 12720) @@ -34,7 +34,7 @@ option(USE_INCRTCL_VERSION_4 "Use version 4 of Itcl and Itcl, version 4.1 of Iwidgets" OFF) -option(USE_TCL_TK_STUBS "Use Tcl/Tk stubs libraries" OFF) +option(USE_TCL_TK_STUBS "Use Tcl/Tk stubs libraries" ON) # Depending on these above options and system resources may also determine # the following variables which are largely self-explanatory unless documented Modified: trunk/cmake/modules/tk.cmake =================================================================== --- trunk/cmake/modules/tk.cmake 2013-11-20 05:41:51 UTC (rev 12719) +++ trunk/cmake/modules/tk.cmake 2013-11-20 06:21:25 UTC (rev 12720) @@ -54,6 +54,16 @@ endif(PLD_tk OR PLD_ntk OR PLD_tkwin) endif(NOT ENABLE_tk) +# tkwin "device" (the shared object dynamically loaded by the +# "package require Plplotter" command from a Tk wish environment) only +# makes sense for the case of dynamical devices. + +if(NOT ENABLE_DYNDRIVERS) + message(STATUS "WARNING: ENABLE_DYNDRIVERS OFF. Setting PLD_tkwin OFF.") + set(PLD_tkwin OFF CACHE BOOL "Enable tkwin device" FORCE) +endif(NOT ENABLE_DYNDRIVERS) + + # Transform TK_INCLUDE_PATH (which is a list) to blank-delimited flag form. string(REGEX REPLACE ";" " -I" TKLIB_COMPILE_FLAGS "-I${TK_INCLUDE_PATH}") @@ -68,12 +78,10 @@ set( tk_SOURCE ${CMAKE_SOURCE_DIR}/bindings/tcl/tclAPI.c - ${CMAKE_SOURCE_DIR}/bindings/tcl/tclMain.c ${CMAKE_SOURCE_DIR}/bindings/tk/Pltk_Init.c ${CMAKE_SOURCE_DIR}/bindings/tk/plframe.c ${CMAKE_SOURCE_DIR}/bindings/tk/plr.c ${CMAKE_SOURCE_DIR}/bindings/tk/tcpip.c - ${CMAKE_SOURCE_DIR}/bindings/tk/tkMain.c ) # All source that is in libtclmatrix set( @@ -105,46 +113,19 @@ if(PLD_tkwin) set(tkwin_COMPILE_FLAGS - "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I\"${CMAKE_SOURCE_DIR}\"/bindings/tcl -I\"${CMAKE_BINARY_DIR}\"/bindings/tcl -I\"${CMAKE_SOURCE_DIR}\"/bindings/tk-x-plat -I\"${CMAKE_SOURCE_DIR}\"/bindings/tk" - ) - set(tkwin_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_LIBRARY} ${TK_LIBRARY} ${X11_LIBRARIES}) + "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I\"${CMAKE_SOURCE_DIR}\"/bindings/tcl -I\"${CMAKE_BINARY_DIR}\"/bindings/tcl -I\"${CMAKE_SOURCE_DIR}\"/bindings/tk-x-plat -I\"${CMAKE_SOURCE_DIR}\"/bindings/tk" + ) + + if(USE_TCL_TK_STUBS) + set(tkwin_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY} ${X11_LIBRARIES}) + else(USE_TCL_TK_STUBS) + set(tkwin_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_LIBRARY} ${TK_LIBRARY} ${X11_LIBRARIES}) + endif(USE_TCL_TK_STUBS) + set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${TCL_LIBRARY} ${TK_LIBRARY}) set( tkwin_SOURCE ${CMAKE_SOURCE_DIR}/bindings/tk-x-plat/Plplotter_Init.c ${CMAKE_SOURCE_DIR}/bindings/tk-x-plat/plplotter.c ) - if(NOT ENABLE_DYNDRIVERS AND NOT PLD_tk) - # All source that is in libplplottcltk - set( - tkwin_SOURCE - ${tkwin_SOURCE} - ${CMAKE_SOURCE_DIR}/bindings/tcl/tclAPI.c - ${CMAKE_SOURCE_DIR}/bindings/tcl/tclMain.c - ${CMAKE_SOURCE_DIR}/bindings/tk/Pltk_Init.c - ${CMAKE_SOURCE_DIR}/bindings/tk/plframe.c - ${CMAKE_SOURCE_DIR}/bindings/tk/plr.c - ${CMAKE_SOURCE_DIR}/bindings/tk/tcpip.c - ${CMAKE_SOURCE_DIR}/bindings/tk/tkMain.c - ) - # All source that is in libtclmatrix - set( - tkwin_SOURCE - ${tkwin_SOURCE} - ${CMAKE_SOURCE_DIR}/bindings/tcl/tclMatrix.c - ${CMAKE_SOURCE_DIR}/bindings/tcl/matrixInit.c - ) - if(ENABLE_itcl) - set(tkwin_COMPILE_FLAGS - "${tkwin_COMPILE_FLAGS} -I${ITCL_INCLUDE_PATH}" - ) - set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${ITCL_LIBRARY}) - endif(ENABLE_itcl) - if(ENABLE_itk) - set(tkwin_COMPILE_FLAGS - "${tkwin_COMPILE_FLAGS} -I${ITK_INCLUDE_PATH}" - ) - set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${ITK_LIBRARY}) - endif(ENABLE_itk) - endif(NOT ENABLE_DYNDRIVERS AND NOT PLD_tk) endif(PLD_tkwin) Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2013-11-20 05:41:51 UTC (rev 12719) +++ trunk/drivers/CMakeLists.txt 2013-11-20 06:21:25 UTC (rev 12720) @@ -220,6 +220,14 @@ DESTINATION ${DRV_DIR} ) endforeach(SOURCE_ROOT_NAME ${DRIVERS_LIST}) + + if(PLD_tkwin AND USE_TCL_TK_STUBS) + set_target_properties( + tkwin + PROPERTIES COMPILE_DEFINITIONS "USE_TCL_STUBS;USE_TK_STUBS" + ) + endif(PLD_tkwin AND USE_TCL_TK_STUBS) + if(TEST_DYNDRIVERS AND NOT CMAKE_CROSSCOMPILING) add_custom_target(test_dyndrivers ALL ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |