From: <ai...@us...> - 2009-05-23 21:40:33
|
Revision: 9996 http://plplot.svn.sourceforge.net/plplot/?rev=9996&view=rev Author: airwin Date: 2009-05-23 21:40:27 +0000 (Sat, 23 May 2009) Log Message: ----------- Add test of tcl examples to new CMake-based build system for the installed examples tree. Modified Paths: -------------- trunk/examples/CMakeLists.txt_installed_examples trunk/examples/plplot_configure.cmake_installed_examples.in trunk/examples/tcl/CMakeLists.txt Added Paths: ----------- trunk/examples/tcl/CMakeLists.txt_installed_examples_tcl Modified: trunk/examples/CMakeLists.txt_installed_examples =================================================================== --- trunk/examples/CMakeLists.txt_installed_examples 2009-05-23 21:20:13 UTC (rev 9995) +++ trunk/examples/CMakeLists.txt_installed_examples 2009-05-23 21:40:27 UTC (rev 9996) @@ -106,6 +106,12 @@ list(APPEND language_info_LIST python:p) endif(ENABLE_python) +if(ENABLE_tcl) + add_subdirectory(tcl) + get_property(targets_examples_tcl GLOBAL PROPERTY TARGETS_examples_tcl) + list(APPEND language_info_LIST tcl:t) +endif(ENABLE_tcl) + execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/lena.pgm Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-23 21:20:13 UTC (rev 9995) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-23 21:40:27 UTC (rev 9996) @@ -16,6 +16,7 @@ set(ENABLE_octave @ENABLE_octave@) set(ENABLE_pdl @ENABLE_pdl@) set(ENABLE_python @ENABLE_python@) +set(ENABLE_tcl @ENABLE_tcl@) # Always enable C language. enable_language(C) @@ -59,3 +60,9 @@ set(ENABLE_pygcw @ENABLE_pygcw@) endif(ENABLE_python) +if(ENABLE_tcl) + set(TCL_TCLSH @TCL_TCLSH@) + set(MKTCLINDEX @MKTCLINDEX@) + set(MKTCLINDEX_ARGS @MKTCLINDEX_ARGS@) +endif(ENABLE_tcl) + Modified: trunk/examples/tcl/CMakeLists.txt =================================================================== --- trunk/examples/tcl/CMakeLists.txt 2009-05-23 21:20:13 UTC (rev 9995) +++ trunk/examples/tcl/CMakeLists.txt 2009-05-23 21:40:27 UTC (rev 9996) @@ -119,3 +119,9 @@ if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") add_dependencies(tclIndex_examples_tcl tcl_examples) endif(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + +install(FILES CMakeLists.txt_installed_examples_tcl + DESTINATION ${DATA_DIR}/examples/tcl + RENAME CMakeLists.txt + ) + Added: trunk/examples/tcl/CMakeLists.txt_installed_examples_tcl =================================================================== --- trunk/examples/tcl/CMakeLists.txt_installed_examples_tcl (rev 0) +++ trunk/examples/tcl/CMakeLists.txt_installed_examples_tcl 2009-05-23 21:40:27 UTC (rev 9996) @@ -0,0 +1,114 @@ +# tcl/CMakeLists.txt for installed PLplot examples +### Process this file with cmake to produce Makefile +### +# Copyright (C) 2009 Alan W. Irwin +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; version 2 of the License. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +set(tcl_FILES +README.tcldemos +plgrid.tcl +plot.dat +plot.tcl +r.dat +stats.log +tcldemos.tcl +) + +set(tcl_STRING_INDICES +"01" +"02" +"03" +"04" +"05" +"06" +"07" +"08" +"09" +"10" +"11" +"12" +"13" +"14" +"15" +"16" +"17" +"18" +"19" +"20" +"21" +"22" +"23" +"24" +"25" +"26" +"27" +"28" +"29" +"30" +"31" +) + +set(tcl_SCRIPTS) +foreach(STRING_INDEX ${tcl_STRING_INDICES}) + set(tcl_FILES ${tcl_FILES} x${STRING_INDEX}.tcl) + set(tcl_SCRIPTS ${tcl_SCRIPTS} x${STRING_INDEX}) +endforeach(STRING_INDEX ${tcl_STRING_INDICES}) + +# Copy file and scripts to the binary directory if different to the +# source directory. Needed because the tclIndex file +# is generated in the binary tree not the source tree. +if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + set(tclIndex_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + set(tclIndex_DEPENDS) + foreach(file ${tcl_SCRIPTS} ${tcl_FILES}) + set( + tclIndex_DEPENDS + ${tclIndex_DEPENDS} + ${CMAKE_CURRENT_BINARY_DIR}/${file} + ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${file} + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} + ) + endforeach(file ${tcl_SCRIPTS} ${tcl_FILES}) + add_custom_target(tcl_examples ALL DEPENDS ${tclIndex_DEPENDS}) +else(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + set(tclIndex_DEPENDS ${tcl_FILES} ${tcl_SCRIPTS}) + set(tclIndex_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endif(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + +add_custom_command( +OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex +COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} +DEPENDS ${tclIndex_DEPENDS} +WORKING_DIRECTORY ${tclIndex_WORKING_DIRECTORY} +) + +add_custom_target(tclIndex_examples_tcl ALL + DEPENDS ${tclIndex_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex +) +set_property(GLOBAL APPEND PROPERTY TARGETS_examples_tcl tclIndex_examples_tcl) + +# Workaround CMake 2-level make recursion issue where independent +# file dependency chains that refer to the same files must have +# target dependencies between them in order to work for parallel +# builds (and possibly some visual studio builds). +if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + add_dependencies(tclIndex_examples_tcl tcl_examples) +endif(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") Property changes on: trunk/examples/tcl/CMakeLists.txt_installed_examples_tcl ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |