[CMake] Delivery target
Hi, i like to create a custom target "delivery" which depends on package and simply copies the package file using scp to our server. Any ideas are apreciated. Thx, Reinhard ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Delivery target
At Wed, 5 Jan 2011 11:44:59 +0100, Reinhard Thies wrote: > > Hi, > > i like to create a custom target "delivery" which depends on package and > simply copies the package file using scp to our server. > > Any ideas are apreciated. > > Thx, > Reinhard > ___ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake Hi, You can use custom_command macro and choose scp as a command to execute but it wouldn't be portable and you of course, need to check that scp program exist on the target machine. Cheers, -- Nizar ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Delivery target
You can't depend on "package", but you can do this as your custom target's command: cmake --build . --target package --config Release scp ... HTH, David On Wed, Jan 5, 2011 at 5:44 AM, Reinhard Thies wrote: > Hi, > > i like to create a custom target "delivery" which depends on package and > simply copies the package file using scp to our server. > > Any ideas are apreciated. > > Thx, > Reinhard > ___ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake > ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Delivery target
On Wednesday 05 January 2011 12:32:52 David Cole wrote: > You can't depend on "package", but you can do this as your custom > target's command: > > cmake --build . --target package --config Release > scp ... > that the way I have it ADD_CUSTOM_TARGET(delivery rm -rf ${CMAKE_PROJECT_NAME}*.tar.gz COMMAND make package COMMAND scp ${CMAKE_PROJECT_NAME}*.tar.gz ds:/srv/repos/bin ) I just thought there might be a better way. thx, Reinhard ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Delivery target
On 01/05/2011 02:13 PM, Reinhard Thies wrote: > On Wednesday 05 January 2011 12:32:52 David Cole wrote: >> You can't depend on "package", but you can do this as your custom >> target's command: >> >> cmake --build . --target package --config Release >> scp ... >> > that the way I have it > ADD_CUSTOM_TARGET(delivery > > rm -rf ${CMAKE_PROJECT_NAME}*.tar.gz > > COMMAND make package > > COMMAND scp ${CMAKE_PROJECT_NAME}*.tar.gz ds:/srv/repos/bin > > ) > > > I just thought there might be a better way. > > thx, > Reinhard If you *know* that you *always* - have a POSIX shell - use a Makefile generator - have scp installed on host and target machine then things are fine, otherwise this will fail. If you used find_program(SCP_EXECUTABLE scp) if(SCP_EXECUTABLE) add_custom_target(delivery COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_PROJECT_NAME}*.tar.gz COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package --config Release COMMAND ${SCP_EXECUTABLE} ${CMAKE_PROJECT_NAME}*.tar.gz ds:/srv/repos/bin) else() message(SEND_ERROR "Require scp for the delivery target") endif() you at least wouldn't require a POSIX shell, don't have to care about the build system and check that you actually have scp. HTH Michael ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Delivery target
2011/1/5 Michael Wild : > On 01/05/2011 02:13 PM, Reinhard Thies wrote: >> On Wednesday 05 January 2011 12:32:52 David Cole wrote: >>> You can't depend on "package", but you can do this as your custom >>> target's command: >>> >>> cmake --build . --target package --config Release >>> scp ... >>> >> that the way I have it >> ADD_CUSTOM_TARGET(delivery >> rm -rf ${CMAKE_PROJECT_NAME}*.tar.gz >> COMMAND make package >> COMMAND scp ${CMAKE_PROJECT_NAME}*.tar.gz ds:/srv/repos/bin >> ) >> >> I just thought there might be a better way. >> >> thx, >> Reinhard > > If you *know* that you *always* > > - have a POSIX shell > - use a Makefile generator > - have scp installed on host and target machine > > then things are fine, otherwise this will fail. If you used [...] I think I already said that some time ago, but this is just a pity CMake "file" command does not support UPLOAD: file(UPLOAD file url TIMEOUT timeout] [STATUS status] [LOG log]) the DOWNLOAD counter part is based on libcurl which supports scp such that it would be possible to portably copy file using a CMake script. If some of you think the feature is interesting I may file a feature request and may be try a patch. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake