aboutsummaryrefslogtreecommitdiff
path: root/src/autogen/CMakeLists.txt
blob: f97526fa3249b5a156045a1ea6ee70693a8ac109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
find_program(PYTHON python3)

# version.h
configure_file(version.h.in version.h @ONLY)

# settings.h
add_custom_command(OUTPUT settings.h DEPENDS settings.h.in
    COMMAND ${PYTHON} ${CMAKE_SOURCE_DIR}/scripts/gen-default-cfg.py
    --kconfig=${CMAKE_SOURCE_DIR}/Kconfig --dotconfig=${CMAKE_SOURCE_DIR}/linux/.config
    --input=${CMAKE_CURRENT_SOURCE_DIR}/settings.h.in --output=settings.h)

# poi_logos.h
set(poi_logos ${CMAKE_SOURCE_DIR}/data/poi.svg ${CMAKE_SOURCE_DIR}/data/poi_window.svg)
add_custom_command(OUTPUT poi_logos.h DEPENDS ${poi_logos}
    COMMAND ${PYTHON} ${RCC} -o=poi_logos.h dump -ns=logos ${poi_logos})

# poi_icons.h
set(poi_icons
    icons/arrow-left.svg icons/arrow-right.svg icons/circle-x.svg icons/refresh.svg icons/home.svg
    icons/volume.svg icons/volume-3.svg)
foreach(f ${poi_icons})
  list(REMOVE_ITEM poi_icons ${f})
  list(APPEND poi_icons ${ICONS_PATH}/${f})
endforeach()
add_custom_command(OUTPUT poi_icons.h DEPENDS ${poi_icons}
    COMMAND ${PYTHON} ${RCC} -o=poi_icons.h dump -ns=icons ${poi_icons})

# autogen target
add_custom_target(py_autogen DEPENDS settings.h poi_logos.h poi_icons.h)

add_library(autogen INTERFACE)
target_sources(autogen INTERFACE util.h util.cpp applicationstyle.h applicationstyle.cpp)
target_include_directories(autogen INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(autogen INTERFACE fmt Qt5::Svg)
add_dependencies(autogen py_autogen)