[CMake] ADD_CUSTOM_COMMAND in different CMakeLists.txt

Brad King brad.king at kitware.com
Fri Oct 27 09:51:00 EDT 2006


Maik Beckmann wrote:
> If I put the >>add_custom_command<< into
> Project_dir/mydir/CMakeLists.txt everything works fine. Is this a
> limitation of cmake?

Yes.  Custom commands are considered on a per-directory basis when
looking for source files.

Also note that your example command modifies the source tree.  It should
write its output to ${PROJECT_BINARY_DIR} or ${CMAKE_CURRENT_BINARY_DIR}
and reference the source from there.

-Brad


More information about the CMake mailing list