[CMake] Creating a custom target on Windows - strange problem

Brad King brad.king at kitware.com
Tue Sep 12 13:05:47 EDT 2006

Arjen Markus wrote:
>     add_custom_target(${CMAKE_CURRENT_BINARY_DIR}/${file} ALL
> When I run this in ..\build, using
>     cmake -G "NMake makefiles" ..\src
> CMake Error: Cannot open file for write:
> C:/arjen/plplot-5.6.1-cmake/testcbs/build/CMakeFiles/C:/arjen/plplot-5.6.1-cmake/testcbs/build/x02.dir/build.make.tmp

You're creating a high-level target named
"C:/arjen/plplot-5.6.1-cmake/testcbs/build/x02" which is invalid.  I'll
look into adding a better diagnostic for this.

Use ADD_CUSTOM_COMMAND for each of your files and an ADD_CUSTOM_TARGET
to drive them:



More information about the CMake mailing list