Alan W. Irwin wrote: > On 2009-06-06 19:36-0400 Hazen Babcock wrote: >> I've moved the pyqt4 bindings into bindings/python/pyqt4 and I have started >> in on trying to figure out how to get them built. I was able to create the >> required config.py.in using the cmake file() command. Now I'm struggling to >> get the "python config.py" command to happen. Is add_custom_command() the >> right way to do this? > > Hi Hazen: > > I am glad you put the question on list since these build system details > concerning add_custom_command (and add_custom_target) are important for all > PLplot developers if they want to understand or modify our build system > > Here is what you have now: > > file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.py.in "") > add_custom_command( > OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ > COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/config.py > WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} > ) > > That is close, but here > is how I would replace that: > > add_custom_command( > OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/config.py.in > COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/config.py.in > COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/config.py > WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} > DEPENDS > ${CMAKE_CURRENT_SOURCE_DIR}/config.py > ${CMAKE_CURRENT_SOURCE_DIR}/plplot_pyqt.sip > ) > > add_custom_target(generate_pyqt_source > DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/config.py.in > )
Hi Alan, Thanks for the help and suggestions! I also added: COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/plplot_pyqt.sip ${CMAKE_CURRENT_BINARY_DIR}/. Since this seemed like the right thing to do to get the "python config.py" command to work when executed in WORKING_DIRECTORY. One result of executing "python config.py" is that it generates its own Makefile in WORKING_DIRECTORY. This overwrites the Makefile that was generated by CMake. What is the best way to handle this? -Hazen ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel