[CMake] CMake extracting tar via execute_process does not allow extraction in subdirectories

Eric Noulard eric.noulard at gmail.com
Tue Apr 2 01:58:03 EDT 2013


2013/4/2 Saad Khattak <saadrustam at gmail.com>

> Hi,
>
> If I have the following command:
>
>   execute_process(
>     COMMAND ${CMAKE_COMMAND} -E tar xzf mySDK.tar.gz
>     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
>     )
>
> the extraction works and extracts the tar in the current directory. But
> this:
>
>   execute_process(
>     COMMAND ${CMAKE_COMMAND} -E tar xzf mySDK.tar.gz
>     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/someSubdirectory
>     )
>
> fails to extract into 'someDirectory' (even if it already exists -
> although it 'should' create the directory for me).
>

In which context do you run this piece of CMake script?
Is it inside a CMakeLists.txt or is it in a separate script?

Could you try:
execute_process(
    COMMAND ${CMAKE_COMMAND} -E echo "WD  = ${CMAKE_CURRENT_SOURCE_DIR}/
someSubdirectory"
    COMMAND ${CMAKE_COMMAND} -E tar xzf mySDK.tar.gz
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/someSubdirectory
    )

and check the value of WD = ...


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130402/c111803c/attachment.htm>


More information about the CMake mailing list