]> git.vomp.tv Git - vompclient.git/blob - src/CMakeLists.txt
Enable clang compiler and mold linker when cross compiling
[vompclient.git] / src / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.13.4)
2
3 set (VOMP_OBJ_COMMON
4         util.cc control.cc thread.cc timers.cc i18n.cc udp4.cc udp6.cc vdpc.cc tcp.cc
5         message.cc messagequeue.cc wol.cc audio.cc video.cc
6         vdr.cc recman.cc recording.cc recinfo.cc channel.cc rectimer.cc event.cc
7         directory.cc mark.cc option.cc vfeed.cc afeed.cc
8         demuxer.cc demuxervdr.cc demuxerts.cc stream.cc osd.cc surface.cc
9         region.cc colour.cc boxstack.cc boxx.cc tbboxx.cc vrecording.cc
10         vinfo.cc vquestion.cc vrecordinglist.cc vrecordinglistclassic.cc
11         vrecordinglistadvanced.cc vepgsummary.cc vepglistadvanced.cc
12         vmute.cc vvolume.cc vtimerlist.cc vtimeredit.cc vrecordingmenu.cc
13         vchannellist.cc vwelcome.cc vvideorec.cc vepgsettimer.cc
14         vchannelselect.cc vserverselect.cc vconnect.cc vepg.cc vrecmove.cc
15         vradiorec.cc vaudioselector.cc vscreensaver.cc vopts.cc
16         wselectlist.cc wjpeg.cc wsymbol.cc wbutton.cc wtextbox.cc
17         woptionpane.cc woptionbox.cc wremoteconfig.cc wtabbar.cc led.cc
18         inputman.cc input.cc inputudp.cc inputlirc.cc vpicturebanner.cc
19         abstractoption.cc eventdispatcher.cc vdrrequestpacket.cc
20         vdrresponsepacket.cc vvideolivetv.cc sleeptimer.cc
21         wprogressbar.cc bitmap.cc dvbsubtitles.cc tfeed.cc vteletextview.cc
22         teletextdecodervbiebu.cc teletxt/txtfont.cc movieinfo.cc seriesinfo.cc
23         wmovieview.cc wseriesview.cc wtvmedia.cc wpictureview.cc
24         osdvector.cc surfacevector.cc buffer.cc config.cc log.cc
25         playervideorec.cc playervideolive.cc playerradiolive.cc playerradiorec.cc
26         imageloader.cc image.cc
27 )
28
29 set (VOMP_OBJ_RASPBERRY
30         main.cc threadp.cc osdopenvg.cc ledraspberry.cc videoomx.cc audioomx.cc imageomx.cc
31         wjpegsimple.cc inputlinux.cc inputcec.cc
32         omx/omx.cc omx/omximagedecode.cc omx/omxeglrender.cc imageomx2.cc
33 )
34
35 #
36 #OBJ_WINDOWS = winmain.o threadwin.o inputwin.o ledwin.o videowin.o                 \
37 #              audiowin.o windowsosd.o dsallocator.o dssourcefilter.o dssourcepin.o \
38 #              wwinvideofilter.o wwinvideoh264filter.o wwinaudiofilter.o            \
39 #              wwinmp3audiofilter.o wjpegsimple.o
40 #
41 #OBJ_WINLEGACY = osdwinpixel.o surfacewin.o                                         \
42 #                fonts/helvB24.o fonts/helvB18.o
43 #
44 #OBJ_WINCURRENT = osdwinvector.o
45 #
46
47 set (PNG_FILES
48         other/vdrhires.png
49         other/wallpaper720p.jpg
50         other/properties.png
51         other/radio.png
52         other/timers.png
53         other/tv.png
54         other/recordings.png
55         other/restart.png
56         other/hd1080i.png
57         other/hd720p.png
58         other/sd576i.png
59         other/txtoff.png
60         other/txton.png
61         other/dolbyoff.png
62         other/dolbyon.png
63         other/recording.png
64         other/recfolder.png
65         other/defposter.png
66 )
67
68 project(vomp)
69 add_executable(vomp ${VOMP_OBJ_COMMON} ${VOMP_OBJ_RASPBERRY} pngs.o)
70
71 # Enable next line to use mold linker. Only available when using clang
72 target_link_options(vomp PRIVATE "-fuse-ld=/opt/mold/bin/mold")
73
74 set(CMAKE_BUILD_TYPE Debug)
75 target_compile_options(vomp PRIVATE -O0)
76
77 set_property(TARGET vomp PROPERTY CXX_STANDARD 14)
78
79 find_path(INC_VC bcm_host.h PATHS /opt/vc/include)
80 find_path(INC_FT2 ft2build.h PATHS /usr/include/freetype2)
81 find_path(INC_MAGICK Magick++.h PATHS /usr/include/ImageMagick-6)
82 find_path(INC_MAGICK2 magick/magick-baseconfig.h PATHS /usr/include/arm-linux-gnueabihf/ImageMagick-6)
83
84 target_include_directories(vomp SYSTEM PRIVATE ${INC_VC} ${INC_FT2} ${INC_MAGICK} ${INC_MAGICK2})
85
86 target_compile_options(vomp PRIVATE
87         -Werror=return-type
88         -Wall
89         -Wextra
90         -Wshadow
91         -Wmissing-declarations
92         -Winit-self
93         -Woverloaded-virtual
94         -Wold-style-cast
95         -Wconversion
96         -Wmissing-format-attribute
97         -Wdisabled-optimization
98         -Wmissing-noreturn
99 )
100
101 target_compile_options(vomp PRIVATE
102         -D_GNU_SOURCE -DIPV4 -DIPV6 -DVOMP_PLATFORM_RASPBERRY -DMAGICKCORE_HDRI_ENABLE=0
103         -DMAGICKCORE_QUANTUM_DEPTH=16 -DDEV)
104
105 target_link_libraries(vomp
106         pthread stdc++ rt brcmEGL brcmOpenVG openmaxil bcm_host avformat avcodec
107         fmt avutil swresample m dl fontconfig freetype Magick++-6.Q16
108         MagickWand-6.Q16 MagickCore-6.Q16 jsoncpp)
109
110 target_link_directories(vomp PRIVATE
111         ${CMAKE_SYSROOT}/opt/vc/lib
112         ${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf)
113
114 add_custom_command(
115         OUTPUT pngs.o
116         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
117         COMMENT pngs.o
118         COMMAND ${CMAKE_LINKER} -r -b binary -o ../build/pngs.o ${PNG_FILES}
119 )