dda1b6e494c1f484dc440822faa3fdef63aad238
[vlc.git] / extras / buildsystem / cmake / CMakeLists / src_CMakeLists.txt
1 include_directories( . )
2
3 add_definitions(-Dasm=__asm__ -D_INTL_REDIRECT_MACROS)
4
5 # vlc
6 add_executable(vlc vlc.c)
7 target_link_libraries(vlc libvlc)
8
9 install_programs(/bin FILES vlc)
10
11 # libvlc
12
13 set( SOURCES_libvlc_beos misc/beos_specific.cpp )
14 set( SOURCES_libvlc_darwin misc/darwin_specific.c )
15 set( SOURCES_libvlc_win32 misc/win32_specific.c )
16 set( SOURCES_libvlc_dirent extras/dirent.c )
17 set( SOURCES_libvlc_getopt misc/getopt.c misc/getopt.h misc/getopt1.c )
18 set( SOURCES_libvlc_common
19     libvlc.c
20         libvlc-common.c
21         libvlc.h
22         libvlc-module.c
23         interface/interface.h
24         interface/interface.c
25         interface/intf_eject.c
26         interface/interaction.c
27         playlist/playlist_internal.h
28         playlist/thread.c
29         playlist/control.c
30         playlist/engine.c
31         playlist/sort.c
32         playlist/loadsave.c
33         playlist/tree.c
34         playlist/item.c
35         playlist/search.c
36         playlist/services_discovery.c
37         input/item.c
38         input/access.c
39         input/clock.c
40         input/control.c
41         input/decoder.c
42         input/decoder_synchro.c
43         input/demux.c
44         input/es_out.c
45         input/input.c
46         input/meta.c
47         input/input_internal.h
48         input/vlm_internal.h
49         input/stream.c
50         input/mem_stream.c
51         input/subtitles.c
52         input/var.c
53         video_output/video_output.c
54         video_output/vout_pictures.c
55         video_output/vout_pictures.h
56         video_output/video_text.c
57         video_output/video_widgets.c
58         video_output/vout_subpictures.c
59         video_output/vout_intf.c
60         audio_output/aout_internal.h
61         audio_output/common.c
62         audio_output/dec.c
63         audio_output/filters.c
64         audio_output/input.c
65         audio_output/mixer.c
66         audio_output/output.c
67         audio_output/intf.c
68         stream_output/stream_output.c
69         stream_output/stream_output.h
70         stream_output/announce.c
71         stream_output/profiles.c
72         stream_output/sap.c
73         stream_output/sdp.c
74         osd/osd.c
75         osd/osd_text.c
76         osd/osd_widgets.c
77         network/acl.c
78         network/getaddrinfo.c
79         network/io.c
80         network/error.c
81         network/tcp.c
82         network/udp.c
83         network/httpd.c
84         network/rootwrap.c
85         network/tls.c
86         network/poll.c
87         text/charset.c
88         text/strings.c
89         text/unicode.c
90         text/wincp.c
91         text/iso_lang.c
92         text/iso-639_def.h
93         misc/md5.c
94         misc/rand.c
95         misc/mtime.c
96         misc/block.c
97         modules/builtin.h
98         modules/modules.h
99         modules/modules.c
100         modules/cache.c
101         modules/entry.c
102         modules/os.c
103         misc/threads.c
104         misc/stats.c
105         misc/cpu.c
106         config/configuration.h
107         config/core.c
108         config/chain.c
109         config/file.c
110         config/cmdline.c
111         misc/events.c
112         misc/image.c
113         misc/messages.c
114         misc/objects.c
115         misc/variables.h
116         misc/variables.c
117         misc/error.c
118         misc/update.c
119         misc/revision.c
120         input/vlm.c
121         misc/xml.c
122         misc/devices.c
123         extras/libc.c )
124
125 set( SOURCES_libvlc ${SOURCES_libvlc_common} )
126
127 if(SYS_DARWIN)
128     set( SOURCES_libvlc ${SOURCES_libvlc} ${SOURCES_libvlc_darwin} )
129 endif(SYS_DARWIN)
130
131 add_library(libvlc SHARED ${SOURCES_libvlc})
132 install_targets(/lib libvlc)
133
134
135 # libvlc-control
136 set( SOURCES_libvlc_control
137      control/libvlc_internal.h
138      control/core.c
139      control/log.c
140      control/playlist.c
141      control/vlm.c
142      control/video.c
143      control/audio.c
144      control/dynamic_media_list.c
145      control/event.c
146      control/flat_media_list_view.c
147      control/hierarchical_media_list_view.c
148      control/hierarchical_node_media_list_view.c
149      control/media_descriptor.c
150      control/media_instance.c
151      control/media_list.c
152      control/media_list_path.h
153      control/media_list_player.c
154      control/media_list_view.c
155      control/media_library.c
156      control/mediacontrol_internal.h
157      control/mediacontrol_core.c
158      control/mediacontrol_util.c
159      control/mediacontrol_audio_video.c
160      control/media_discoverer.c
161      control/tag_query.c )
162
163 add_library(libvlc-control SHARED ${SOURCES_libvlc_control})
164 install_targets(/lib libvlc-control)
165 target_link_libraries(libvlc-control libvlc)
166
167 ##########################################################
168 # Libraries
169
170 # iconv
171 target_link_libraries(libvlc ${HAVE_ICONV})
172
173 # Carbon
174 if(APPLE)
175   find_library(CARBON_FRAMEWORK Carbon)
176   target_link_libraries(libvlc ${CARBON_FRAMEWORK})
177 endif(APPLE)
178
179 ##########################################################
180 # revision.c
181
182 set(rev "${CMAKE_CURRENT_SOURCE_DIR}/misc/revision.c")
183 add_custom_command(
184 OUTPUT ${rev}
185 COMMAND rm -f ${rev} ${rev}.tmp
186 COMMAND echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > ${rev}.tmp
187 COMMAND printf "const char psz_vlc_changeset[] = \"" >> ${rev}.tmp
188 COMMAND sh -c "echo `LANG=C\ svnversion\ ${CMAKE_SOURCE_DIR}\ ||\ echo\ exported`"
189 COMMAND echo "\";" >> ${rev}.tmp
190 COMMAND mv -f ${rev}.tmp ${rev}
191 VERBATIM
192 )
193
194 ##########################################################
195 # builtin.h
196 # No real use for this one, we just used to need it.
197 # We should really remove that.
198 set(builtin "${CMAKE_CURRENT_SOURCE_DIR}/modules/builtin.h")
199
200 add_custom_command(
201 OUTPUT ${builtin}
202 COMMAND echo "/* Auto generated by ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt */" > ${builtin}
203 COMMAND echo "int vlc_entry__main( module_t* );" >> ${builtin}
204 COMMAND echo "#define ALLOCATE_ALL_BUILTINS() do {} while(0)" >> ${builtin}
205 VERBATIM
206 )
207
208 set(rev)
209 ##########################################################
210 # SET_TARGET_PROPERTIES
211
212 set_target_properties(libvlc libvlc-control vlc PROPERTIES COMPILE_FLAGS
213     "-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wmissing-prototypes" )