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

2013-04-03 Thread Eric Noulard
2013/4/3 Saad Khattak saadrus...@gmail.com

 That prints the directory in the console:

 Z:/engine/src/mySDK

 But did not extract to it. Note that mySDK exists, and the tar is in the
 'src' folder and I am able to extract in the 'src' folder properly.


Ok this is weird.

Which version of CMake are you using? (try cmake --version)
You seem to be running on a Windows host,
do you use native CMake or some combination of cygwin and cygwin cmake?

Which cmake generator are you using? (Visual Studio xxx, MinGW, ...)

Is cmake able to untar manually i.e. could you try that:

cd Z:/engine/src/mySDK
cmake -E tar xvf ../mySDK.tar.gz
--

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] CMake extracting tar via execute_process does not allow extraction in subdirectories

2013-04-03 Thread Saad Khattak
I am using version 2.8.8. I am running Windows 7 and do not use cygwin,
only native CMake.

cd Z:/engine/src/mySDK
 cmake -E tar xvf ../mySDK.tar.gz


That works. The tar is successfully extracted to the mySDK folder. As
before, it appears it can only extract to the current directory.

- Saad


On Wed, Apr 3, 2013 at 2:08 AM, Eric Noulard eric.noul...@gmail.com wrote:




 2013/4/3 Saad Khattak saadrus...@gmail.com

 That prints the directory in the console:

 Z:/engine/src/mySDK

 But did not extract to it. Note that mySDK exists, and the tar is in the
 'src' folder and I am able to extract in the 'src' folder properly.


 Ok this is weird.

 Which version of CMake are you using? (try cmake --version)
 You seem to be running on a Windows host,
 do you use native CMake or some combination of cygwin and cygwin cmake?

 Which cmake generator are you using? (Visual Studio xxx, MinGW, ...)

 Is cmake able to untar manually i.e. could you try that:

 cd Z:/engine/src/mySDK
 cmake -E tar xvf ../mySDK.tar.gz




--

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] CMake extracting tar via execute_process does not allow extraction in subdirectories

2013-04-02 Thread Saad Khattak
Hi Eric,

I created the folder manually, but it still did not extract to that folder.
It appears to only be able to extract to the current folder. It 'is' able
to create folders that are in the tar as expected.

- Saad


On Tue, Apr 2, 2013 at 1:50 AM, Eric Noulard eric.noul...@gmail.com wrote:




 2013/4/2 Saad Khattak saadrus...@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).


 No it shouldn't.


  Am I misunderstanding some commands?


 Yes I think you misunderstand WORKING_DIRECTORY argument of
 execute_process command.
 The WORKING_DIRECTORY MUST exists beforehand and it is NOT the job of
 execute_process
 to create it.

 A WORKING_DIRECTORY is **always** supposed to exists when used
 by the cmake command providing this option like:
 add_custom_command, add_test or execute_process.

 If you need to create a directory you can cmake -E make_directory
 or file(MAKE_DIRECTORY ...)

 That said cmake -E tar xzf mySDK.tar.gz will create any directory found
 in the archive as expected.
 working directory for untar and [possibly] top-level directory created
 nby untar are not the same.


 --
 Erk
 Le gouvernement représentatif n'est pas la démocratie --
 http://www.le-message.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

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

2013-04-02 Thread Saad Khattak
That prints the directory in the console:

Z:/engine/src/mySDK

But did not extract to it. Note that mySDK exists, and the tar is in the
'src' folder and I am able to extract in the 'src' folder properly.

- Saad

On Tue, Apr 2, 2013 at 1:58 AM, Eric Noulard eric.noul...@gmail.com wrote:

 COMMAND ${CMAKE_COMMAND} -E echo WD  = ${CMAKE_CURRENT_SOURCE_DIR}/
 someSubdirectory

--

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

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

2013-04-01 Thread Saad Khattak
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).

Am I misunderstanding some commands?

Thanks,
Saad
--

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] CMake extracting tar via execute_process does not allow extraction in subdirectories

2013-04-01 Thread David Cole

Where does the extraction end up?

Or does it fail regardless of the WORKING_DIRECTORY argument?

Use :

   execute_process(... RESULT_VARIABLE rv)
   message(rv='${rv}')

to see what the return value of CMake is.

Is there an error message when trying to extract the tar file?



-Original Message-
From: Saad Khattak saadrus...@gmail.com
To: CMake Mailing List cmake@cmake.org
Sent: Mon, Apr 1, 2013 6:06 pm
Subject: [CMake] CMake extracting tar via execute_process does not 
allow extraction in subdirectories



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).



Am I misunderstanding some commands?


Thanks,
Saad



--

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] CMake extracting tar via execute_process does not allow extraction in subdirectories

2013-04-01 Thread Saad Khattak
As far as I can tell, it does not extract at all.

The return code when it is able to extract is 0, when it is not able to
extract, it is 1

- Saad


On Mon, Apr 1, 2013 at 6:12 PM, David Cole dlrd...@aol.com wrote:

 Where does the extraction end up?

 Or does it fail regardless of the WORKING_DIRECTORY argument?

 Use :

execute_process(... RESULT_VARIABLE rv)
message(rv='${rv}')

 to see what the return value of CMake is.

 Is there an error message when trying to extract the tar file?




 -Original Message-
 From: Saad Khattak saadrus...@gmail.com
 To: CMake Mailing List cmake@cmake.org
 Sent: Mon, Apr 1, 2013 6:06 pm
 Subject: [CMake] CMake extracting tar via execute_process does not allow
 extraction in subdirectories


 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).


 Am I misunderstanding some commands?


 Thanks,
 Saad



 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at http://www.kitware.com/**
 opensource/opensource.htmlhttp://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/**CMake_FAQhttp://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/**listinfo/cmakehttp://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] CMake extracting tar via execute_process does not allow extraction in subdirectories

2013-04-01 Thread Eric Noulard
2013/4/2 Saad Khattak saadrus...@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).


No it shouldn't.


 Am I misunderstanding some commands?


Yes I think you misunderstand WORKING_DIRECTORY argument of
execute_process command.
The WORKING_DIRECTORY MUST exists beforehand and it is NOT the job of
execute_process
to create it.

A WORKING_DIRECTORY is **always** supposed to exists when used
by the cmake command providing this option like:
add_custom_command, add_test or execute_process.

If you need to create a directory you can cmake -E make_directory
or file(MAKE_DIRECTORY ...)

That said cmake -E tar xzf mySDK.tar.gz will create any directory found
in the archive as expected.
working directory for untar and [possibly] top-level directory created
nby untar are not the same.


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.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

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

2013-04-01 Thread Eric Noulard
2013/4/2 Saad Khattak saadrus...@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
--

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