The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15655 ====================================================================== Reported By: James Bigler Assigned To: ====================================================================== Project: CMake Issue ID: 15655 Category: (No Category) Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2015-07-15 13:42 EDT Last Modified: 2015-07-15 13:42 EDT ====================================================================== Summary: file(GENERATE) fails of the destination directory doesn't exist Description: 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) ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-07-15 13:42 James Bigler New Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers