AssignSourceGroup.cmake 525 B

123456789101112
  1. function(assign_source_group)
  2. foreach(_source IN ITEMS ${ARGN})
  3. if (IS_ABSOLUTE "${_source}")
  4. file(RELATIVE_PATH _source_rel "${CMAKE_CURRENT_SOURCE_DIR}" "${_source}")
  5. else()
  6. set(source_rel "${_source}")
  7. endif()
  8. get_filename_component(_source_path "${_source_rel}" PATH)
  9. string(REPLACE "/" "\\" _source_path_msvc "${_source_path}")
  10. source_group("${_source_path_msvc}" FILES "${_source}")
  11. endforeach()
  12. endfunction(assign_source_group)