MantisBT - CMake
View Issue Details
0015249CMakeCMakepublic2014-11-13 02:022016-06-10 14:31
Micha Renner 
Kitware Robot 
normalminoralways
closedmoved 
 
 
0015249: Default WORKING_DIRECTORY of EXECUTE_PROCESS
3.1.rc1. Windows version - only

It seems that the default WORKING_DIRECTORY of EXECUTE_PROCESS is not any longer CMAKE_BINARY_DIR.

EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory conftest.a) results in

Error making directory "
conftest.a".

Maybe EXECUTE_PROCESS runs in a write-protected directory.

EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory conftest.a # WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

works.


No tags attached.
Issue History
2014-11-13 02:02Micha RennerNew Issue
2014-11-13 09:07Brad KingNote Added: 0037208
2016-06-10 14:29Kitware RobotNote Added: 0042667
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0037208)
Brad King   
2014-11-13 09:07   
The execute_process command does not define or document any default working directory. It will be wherever the working directory of the running cmake process happens to be.

I don't think this behavior has changed.

For this particular case you can use the file(MAKE_DIRECTORY) command, but that should also be given a full path.
(0042667)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.