File: folders.cmake

package info (click to toggle)
lnav 0.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 60,084 kB
  • sloc: cpp: 215,599; ansic: 59,220; sh: 4,650; makefile: 3,578; python: 1,197; sql: 315; xml: 264; javascript: 18
file content (21 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
set_property(GLOBAL PROPERTY USE_FOLDERS YES)

# Call this function at the end of a directory scope to assign a folder to
# targets created in that directory. Utility targets will be assigned to the
# UtilityTargets folder, otherwise to the ${name}Targets folder. If a target
# already has a folder assigned, then that target will be skipped.
function(add_folders name)
  get_property(targets DIRECTORY PROPERTY BUILDSYSTEM_TARGETS)
  foreach(target IN LISTS targets)
    get_property(folder TARGET "${target}" PROPERTY FOLDER)
    if(DEFINED folder)
      continue()
    endif()
    set(folder Utility)
    get_property(type TARGET "${target}" PROPERTY TYPE)
    if(NOT type STREQUAL "UTILITY")
      set(folder "${name}")
    endif()
    set_property(TARGET "${target}" PROPERTY FOLDER "${folder}Targets")
  endforeach()
endfunction()