From: <and...@us...> - 2007-10-29 10:33:40
|
Revision: 7982 http://plplot.svn.sourceforge.net/plplot/?rev=7982&view=rev Author: andrewross Date: 2007-10-29 03:33:43 -0700 (Mon, 29 Oct 2007) Log Message: ----------- Ensure tclIndex is generated in the build tree and not in the source tree. This involves copy files over which is not elegant, but it is the only way to do it since tcl's auto_mkindex always puts in the index file in the same directory as the source files. Modified Paths: -------------- trunk/bindings/tk/CMakeLists.txt Modified: trunk/bindings/tk/CMakeLists.txt =================================================================== --- trunk/bindings/tk/CMakeLists.txt 2007-10-27 06:42:04 UTC (rev 7981) +++ trunk/bindings/tk/CMakeLists.txt 2007-10-29 10:33:43 UTC (rev 7982) @@ -57,6 +57,29 @@ cmap1d.pal ) +# Ugly hack to copy all .tcl files to the build tree so that tclIndex +# can be generated there. This is a limitation is tcl's auto_mkindex which +# always generates the index in the directory with the files. +if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + set(tclIndex_DEPENDS) + foreach(file ${tcldata} ${itkdata}) + 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 ${tcldata} ${itkdata}) + add_custom_target(tcl_files ALL DEPENDS ${tclIndex_DEPENDS}) +else(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + set(tclIndex_DEPENDS ${tcldata} ${itkdata}) +endif(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + install( FILES ${tcldata} ${itkdata} ${paldata} DESTINATION ${TCL_DIR} @@ -86,13 +109,18 @@ install(TARGETS plserver DESTINATION ${BIN_DIR}) add_custom_target(tclIndex_tk ALL + DEPENDS ${tclIndex_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex +) + +add_custom_command( +OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} -DEPENDS ${tcldata} ${itkdata} -WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +DEPENDS ${tclIndex_DEPENDS} +WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) install( -FILES ${CMAKE_CURRENT_SOURCE_DIR}/tclIndex +FILES ${CMAKE_CURRENT_BINARY_DIR}/tclIndex DESTINATION ${TCL_DIR} ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |