vlc_module_funcs.cmake 1.88 KB
Newer Older
1
2
3
4
include( ${CMAKE_SOURCE_DIR}/cmake/vlc_add_compile_flag.cmake )

MACRO(vlc_add_module module_name)
    if(ENABLE_VLC_MODULE_${module_name})
5
        add_library( ${module_name}_plugin MODULE ${ARGN} )
6
        set(VLC_${module_name}_LINK_LIBRARIES "${VLC_${module_name}_LINK_LIBRARIES};libvlc")
7
        set_target_properties( ${module_name}_plugin PROPERTIES COMPILE_FLAGS
8
                "-D__PLUGIN__ -DMODULE_NAME=${module_name} -DMODULE_NAME_IS_${module_name} -I${CMAKE_CURRENT_SOURCE_DIR} ${VLC_${module_name}_COMPILE_FLAG}" )
9
        if (VLC_${module_name}_LINK_LIBRARIES)
10
            target_link_libraries( ${module_name}_plugin ${VLC_${module_name}_LINK_LIBRARIES})
11
        endif (VLC_${module_name}_LINK_LIBRARIES)
12
        install_targets(/modules ${module_name}_plugin)
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    endif(ENABLE_VLC_MODULE_${module_name})
ENDMACRO(vlc_add_module)

MACRO(vlc_register_modules state)
    foreach( module_name ${ARGN} )
        OPTION( ENABLE_VLC_MODULE_${module_name} "Enable the ${module_name} module" ${state} )
    endforeach( module_name )
ENDMACRO(vlc_register_modules)

MACRO(vlc_enable_modules module_names)
    vlc_register_modules( ON ${ARGV} )
ENDMACRO(vlc_enable_modules)

MACRO(vlc_disable_modules module_names)
    vlc_register_modules( OFF ${ARGV} )
ENDMACRO(vlc_disable_modules)

MACRO(vlc_set_module_properties module_name)
31
    set_target_properties(${module_name}_plugin ${ARGN})
32
33
34
ENDMACRO(vlc_set_module_properties)

MACRO(vlc_set_module_properties module_name)
35
    set_target_properties(${module_name}_plugin ${ARGN})
36
37
38
39
40
41
ENDMACRO(vlc_set_module_properties)

MACRO(vlc_module_add_link_libraries module_name)
    set(VLC_${module_name}_LINK_LIBRARIES ${VLC_${module_name}_LINK_LIBRARIES} ${ARGN})
ENDMACRO(vlc_module_add_link_libraries)

42
43
44
45
MACRO(vlc_add_module_compile_flag module_name)
    set(VLC_${module_name}_COMPILE_FLAG ${VLC_${module_name}_LINK_LIBRARIES} ${ARGN})
ENDMACRO(vlc_add_module_compile_flag)