Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 22nd, 2012  |  syntax: None  |  size: 0.59 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. CMAKE generating clean target for subdirectory
  2. app/
  3.   A
  4.   B
  5.  
  6. lib/
  7.    A
  8.    B
  9.    C
  10.        
  11. macro(add_clean_target dir)
  12. add_custom_target(clean-${dir} COMMAND ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir})
  13. endmacro(add_clean_target)
  14.        
  15. add_clean_target(app-A)
  16.        
  17. projectroot/
  18.   applications/
  19.     appA
  20.   libraries/
  21.     libA
  22.     libB
  23.        
  24. project( MyProject )
  25. add_subdirectory( libraries )
  26. add_subdirectory( applications )
  27.        
  28. project( Libraries )
  29. add_subdirectory( libA )
  30. add_subdirectory( libB )
  31. add_subdirectory( libC )
  32.        
  33. project( Applications )
  34. add_subdirectory( appA )