2 add_definitions(-Dasm=__asm__ -D_INTL_REDIRECT_MACROS)
3 add_definitions(-DLOCALEDIR=\\"${CMAKE_INSTALL_PREFIX}/locale\\")
4 add_definitions(-DPLUGIN_PATH=\\"${CMAKE_INSTALL_PREFIX}/lib/vlc\\")
7 add_executable(vlc vlc.c)
8 target_link_libraries(vlc libvlc)
12 set( SOURCES_libvlc_beos misc/beos_specific.cpp )
13 set( SOURCES_libvlc_darwin misc/darwin_specific.c )
14 set( SOURCES_libvlc_win32 misc/win32_specific.c )
15 set( SOURCES_libvlc_dirent extras/dirent.c )
16 set( SOURCES_libvlc_getopt misc/getopt.c misc/getopt.h misc/getopt1.c )
17 set( SOURCES_libvlc_common
24 interface/intf_eject.c
25 interface/interaction.c
26 playlist/playlist_internal.h
35 playlist/services_discovery.c
41 input/decoder_synchro.c
46 input/input_internal.h
52 video_output/video_output.c
53 video_output/vout_pictures.c
54 video_output/vout_pictures.h
55 video_output/video_text.c
56 video_output/video_widgets.c
57 video_output/vout_subpictures.c
58 video_output/vout_intf.c
59 audio_output/aout_internal.h
62 audio_output/filters.c
67 stream_output/stream_output.c
68 stream_output/stream_output.h
69 stream_output/announce.c
70 stream_output/profiles.c
96 ${CMAKE_BINARY_DIR}/src/modules/builtin.h
105 config/configuration.h
118 ${CMAKE_BINARY_DIR}/src/misc/revision.c
123 ${CMAKE_BINARY_DIR}/include/vlc_about.h )
125 set( SOURCES_libvlc ${SOURCES_libvlc_common} )
128 set( SOURCES_libvlc ${SOURCES_libvlc} ${SOURCES_libvlc_darwin} )
131 add_library(libvlc SHARED ${SOURCES_libvlc})
133 set_target_properties(libvlc PROPERTIES
135 SOVERSION 1 VERSION 1.0.0)
137 target_link_libraries(libvlc ${LIBM} ${LIBRT} ${LIBICONV} ${Dlopen_LIBRARIES})
141 set( SOURCES_libvlc_control
142 control/libvlc_internal.h
149 control/dynamic_media_list.c
151 control/flat_media_list_view.c
152 control/hierarchical_media_list_view.c
153 control/hierarchical_node_media_list_view.c
154 control/media_descriptor.c
155 control/media_instance.c
157 control/media_list_path.h
158 control/media_list_player.c
159 control/media_list_view.c
160 control/media_library.c
161 control/mediacontrol_internal.h
162 control/mediacontrol_core.c
163 control/mediacontrol_util.c
164 control/mediacontrol_audio_video.c
165 control/media_discoverer.c
166 control/tag_query.c )
168 add_library(libvlc-control SHARED ${SOURCES_libvlc_control})
170 set_target_properties(libvlc-control PROPERTIES OUTPUT_NAME vlc-control)
171 set_target_properties(libvlc-control PROPERTIES SOVERSION 0)
172 set_target_properties(libvlc PROPERTIES VERSION 0.0.0)
174 target_link_libraries(libvlc-control libvlc)
176 ##########################################################
179 install(TARGETS libvlc libvlc-control DESTINATION lib)
180 install(TARGETS vlc DESTINATION bin)
182 ##########################################################
187 find_library(CARBON_FRAMEWORK Carbon)
188 target_link_libraries(libvlc ${CARBON_FRAMEWORK})
191 ##########################################################
194 set(rev "${CMAKE_BINARY_DIR}/src/misc/revision.c")
195 exec_program(dirname ARGS ${rev} OUTPUT_VARIABLE rev_dir)
199 COMMAND rm -f ${rev} ${rev}.tmp
200 COMMAND mkdir -p ${rev_dir}
201 COMMAND sh -c "echo '/* AUTOGENERATED FILE - DO NOT EDIT */' > ${rev}.tmp"
202 COMMAND sh -c "printf 'const char psz_vlc_changeset[] = \"' >> ${rev}.tmp"
203 COMMAND sh -c "printf `LANG=C svnversion ${CMAKE_SOURCE_DIR} || printf \"exported\"` >> ${rev}.tmp"
204 COMMAND sh -c "echo '\";' >> ${rev}.tmp"
205 COMMAND mv -f ${rev}.tmp ${rev}
210 ##########################################################
212 # No real use for this one, we just used to need it.
213 # We should really remove that.
214 set(builtin "${CMAKE_BINARY_DIR}/src/modules/builtin.h")
215 exec_program(dirname ARGS ${builtin} OUTPUT_VARIABLE builtin_dir)
219 COMMAND mkdir -p ${builtin_dir}
220 COMMAND sh -c "echo '/* Auto generated by ${CMAKE_CURRENT_BUILD_DIR}/CMakeLists.txt */' > ${builtin}"
221 COMMAND sh -c "echo 'int vlc_entry__main( module_t* );' >> ${builtin}"
222 COMMAND sh -c "echo '#define ALLOCATE_ALL_BUILTINS() do {} while(0)' >> ${builtin}"
227 ##########################################################
229 set(about "${CMAKE_BINARY_DIR}/include/vlc_about.h")
230 exec_program(dirname ARGS ${about} OUTPUT_VARIABLE about_dir)
234 COMMAND rm -f "${about}.tmp"
235 COMMAND mkdir -p ${about_dir}
236 COMMAND sh -c "echo '/* Automatically generated file - DO NOT EDIT */' > ${about}.tmp"
237 COMMAND sh -c "echo 'static const char psz_license[] =' >> ${about}.tmp"
238 COMMAND sh -c "cat ${CMAKE_SOURCE_DIR}/COPYING | sed s/\\\"/''/g | awk '{ print \"\\\"\"$0\"\\\\n\\\"\" }' >> ${about}.tmp"
239 COMMAND sh -c "echo ';' >> ${about}.tmp"
240 COMMAND sh -c "echo 'static const char psz_thanks[] =' >> ${about}.tmp"
241 COMMAND sh -c "grep -v '$$Id:' ${CMAKE_SOURCE_DIR}/THANKS | sed 's/\"/''/g' | awk '{ print \"\\\"\"$0\"\\\\n\\\"\" }'|sed 's/\"<.*.> \"//' >> ${about}.tmp"
242 COMMAND sh -c "echo ';' >> ${about}.tmp"
243 COMMAND sh -c "echo 'static const char psz_authors[] =' >> ${about}.tmp"
244 COMMAND sh -c "grep N: ${CMAKE_SOURCE_DIR}/AUTHORS | cut -d '\ ' -f 2- | sed 's/\"/''/g' | awk '{ print \"\\\"\"$0\"\\\\n\\\"\" }' >> ${about}.tmp"
245 COMMAND sh -c "echo ';' >> ${about}.tmp"
246 COMMAND sh -c "mv -f -- ${about}.tmp ${about}"
247 DEPENDS ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_SOURCE_DIR}/THANKS ${CMAKE_SOURCE_DIR}/COPYING
253 ##########################################################
254 # SET_TARGET_PROPERTIES
256 # FIXME: Should probably be autodetected in configure?
258 set(LINK_FLAGS "-z defs --as-needed")
261 target_link_libraries(libvlc "${CMAKE_THREAD_LIBS_INIT}")
262 target_link_libraries(libvlc-control "${CMAKE_THREAD_LIBS_INIT}")
264 set_target_properties(libvlc libvlc-control vlc PROPERTIES COMPILE_FLAGS
265 "-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wmissing-prototypes -I${CMAKE_BINARY_DIR}/src -I${CMAKE_BINARY_DIR}/include" )
267 ##########################################################
270 add_executable(testapi control/testapi.c)
271 add_executable(i18n_atof test/i18n_atof.c)
272 add_executable(url test/url.c)
273 add_executable(utf8 test/utf8.c)
275 target_link_libraries(testapi libvlc-control)
276 target_link_libraries(i18n_atof libvlc)
277 target_link_libraries(url libvlc)
278 target_link_libraries(utf8 libvlc)
280 add_test(testapi ${EXECUTABLE_OUTPUT_PATH}/testapi)
281 add_test(i18n_atof ${EXECUTABLE_OUTPUT_PATH}/i18n_atof)
282 add_test(url ${EXECUTABLE_OUTPUT_PATH}/url)
283 add_test(utf8 ${EXECUTABLE_OUTPUT_PATH}/utf8)