2
0

filename.cmake 380 B

123456789
  1. function(define_FILENAME targetname)
  2. get_target_property(source_files "${targetname}" SOURCES)
  3. foreach(sourcefile ${source_files})
  4. get_filename_component(basename "${sourcefile}" NAME)
  5. set_property(
  6. SOURCE "${sourcefile}" APPEND
  7. PROPERTY COMPILE_DEFINITIONS "__FILENAME__=\"${basename}\"")
  8. endforeach()
  9. endfunction()