MantisBT - CMake
View Issue Details
0015655CMake(No Category)public2015-07-15 13:422016-06-10 14:31
James Bigler 
Kitware Robot 
normalminoralways
closedmoved 
 
 
0015655: file(GENERATE) fails of the destination directory doesn't exist
I wanted to use file(GENERATE) to create some files in an output build directory, but these directories don't exist at the time of configure and build so the command fails. These directories are created during build, though so CMake knows about them somehow.

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

file(GENERATE OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>/test.out CONTENT "Hello, world")

file(WRITE a.cpp "int main() { return 0; }")
add_executable(a a.cpp)
No tags attached.
Issue History
2015-07-15 13:42James BiglerNew Issue
2016-06-10 14:29Kitware RobotNote Added: 0042810
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
(0042810)
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.