[CMake] Visual Studio 2010 generator and custom command

Bill Hoffman bill.hoffman at kitware.com
Wed Sep 29 17:07:32 EDT 2010


On 9/29/2010 11:02 AM, elizabeta petreska wrote:
> This is the link to bug report http://www.paraview.org/Bug/view.php?id=11274
>

OK, I have fixed the issue in CMake next.

To get around the problem you can use MAIN_DEPENDENCY like this:

ADD_CUSTOM_COMMAND(
  OUTPUT "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
  COMMAND ${CMAKE_COMMAND} -E copy
   "${PROJECT_SOURCE_DIR}/myfile.txt"
   "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
  DEPENDS "${PROJECT_SOURCE_DIR}/myfile.txt"
  MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/myfile.txt"
  )

-Bill


More information about the CMake mailing list