From: <and...@us...> - 2011-10-31 12:42:43
|
Revision: 12017 http://plplot.svn.sourceforge.net/plplot/?rev=12017&view=rev Author: andrewross Date: 2011-10-31 12:42:36 +0000 (Mon, 31 Oct 2011) Log Message: ----------- Fixes so that installed tcl and tk examples work using the cmake build system with a separate binary directory, even if the original plplot source and binary trees are no longer present. Modified Paths: -------------- trunk/examples/plplot_configure.cmake_installed_examples.in trunk/examples/tcl/CMakeLists.txt Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2011-10-31 11:28:37 UTC (rev 12016) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2011-10-31 12:42:36 UTC (rev 12017) @@ -137,7 +137,7 @@ if(ENABLE_tcl OR ENABLE_tk) set(TCL_TCLSH @TCL_TCLSH@) - set(MKTCLINDEX @MKTCLINDEX@) + set(MKTCLINDEX ${CMAKE_SOURCE_DIR}/tcl/mktclIndex) set(MKTCLINDEX_ARGS @MKTCLINDEX_ARGS@) endif(ENABLE_tcl OR ENABLE_tk) Modified: trunk/examples/tcl/CMakeLists.txt =================================================================== --- trunk/examples/tcl/CMakeLists.txt 2011-10-31 11:28:37 UTC (rev 12016) +++ trunk/examples/tcl/CMakeLists.txt 2011-10-31 12:42:36 UTC (rev 12017) @@ -84,34 +84,35 @@ @ONLY ) -if(CORE_BUILD) - # Copy file and scripts to the binary directory if different to the - # source directory. Needed for ctest, but also so the tclIndex file - # is generated in the binary tree not the source tree. - set(tclIndex_DEPENDS) - foreach(file ${tcl_SCRIPTS} ${tcl_FILES}) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${file} - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} - ) - list(APPEND tclIndex_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${file}) - endforeach(file ${tcl_SCRIPTS} ${tcl_FILES}) - add_custom_target(tcl_examples ALL DEPENDS ${tclIndex_DEPENDS}) - +# Copy file and scripts to the binary directory if different to the +# source directory. Needed for ctest, but also so the tclIndex file +# is generated in the binary tree not the source tree. +set(tclIndex_DEPENDS) +foreach(file ${tcl_SCRIPTS} ${tcl_FILES}) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex - COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} - DEPENDS ${tclIndex_DEPENDS} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${file} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} ) - add_custom_target(tclIndex_examples_tcl ALL - DEPENDS ${tclIndex_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex - ) + list(APPEND tclIndex_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${file}) +endforeach(file ${tcl_SCRIPTS} ${tcl_FILES}) +add_custom_target(tcl_examples ALL DEPENDS ${tclIndex_DEPENDS}) - # These two custom targets file-depend on common files so must serialize. - add_dependencies(tclIndex_examples_tcl tcl_examples) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex + COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} + DEPENDS ${tclIndex_DEPENDS} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) +add_custom_target(tclIndex_examples_tcl ALL + DEPENDS ${tclIndex_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex + ) + +# These two custom targets file-depend on common files so must serialize. +add_dependencies(tclIndex_examples_tcl tcl_examples) + +if(CORE_BUILD) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/tclIndex DESTINATION ${DATA_DIR}/examples/tcl @@ -125,14 +126,6 @@ install(FILES CMakeLists.txt DESTINATION ${DATA_DIR}/examples/tcl ) - -else(CORE_BUILD) - set(tclIndex_DEPENDS) - foreach(file ${tcl_SCRIPTS} ${tcl_FILES}) - list(APPEND tclIndex_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) - endforeach(file ${tcl_SCRIPTS} ${tcl_FILES}) - add_custom_target(tcl_examples ALL DEPENDS ${tclIndex_DEPENDS}) - endif(CORE_BUILD) if(BUILD_TEST) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |