[CMake] Force rebuild

Bill Hoffman bill.hoffman at kitware.com
Mon Mar 26 20:20:37 EST 2007


Min Cu wrote:
> Yes, that is more or less what I need. I have a project that generates 
> a header file which is included in other projects. However, once the 
> project is built when make is called the next time it does not get 
> rebuilt. So, I guess my question is "How do I make the custom target 
> run every built?" The solution needs to work on both Windows and 
> Linux/Unix so I can't use the pre-build event. It is probably a silly 
> question but I am new to CMake and don't know it well yet.
add a custom target that depends on all.  Then use add_dependency to 
make other targets depend on it.  So, look at these commends:

add_dependencies
add_custom_target

here:
http://www.cmake.org/HTML/Documentation.html

-Bill



More information about the CMake mailing list