vlc_module_funcs.cmake 1.92 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
7
8
        if( NOT ENABLE_NO_SYMBOL_CHECK )
            vlc_module_add_link_libraries( libvlc )
        endif( NOT ENABLE_NO_SYMBOL_CHECK )
9
        set_target_properties( ${module_name}_plugin PROPERTIES COMPILE_FLAGS
10
                "-D__PLUGIN__ -DMODULE_NAME=${module_name} -DMODULE_NAME_IS_${module_name} -I${CMAKE_CURRENT_SOURCE_DIR} ${VLC_${module_name}_COMPILE_FLAG}" )
11
        if (VLC_${module_name}_LINK_LIBRARIES)
12
            target_link_libraries( ${module_name}_plugin ${VLC_${module_name}_LINK_LIBRARIES})
13
        endif (VLC_${module_name}_LINK_LIBRARIES)
14
        install_targets(/modules ${module_name}_plugin)
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
    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)
33
    set_target_properties(${module_name}_plugin ${ARGN})
34
35
36
ENDMACRO(vlc_set_module_properties)

MACRO(vlc_set_module_properties module_name)
37
    set_target_properties(${module_name}_plugin ${ARGN})
38
39
40
41
42
43
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)

44
45
46
47
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)