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

MACRO(vlc_add_module module_name)
    if(ENABLE_VLC_MODULE_${module_name})
        add_library( vlc_${module_name} MODULE ${ARGN} )
6
7
8
9
10
11
       # On win32 we need to have all the symbol resolved at link time
        if(WIN32)
            set(VLC_${module_name}_LINK_LIBRARIES "VLC_${module_name}_LINK_LIBRARIES libvlc")
        endif(WIN32)
        set_target_properties( vlc_${module_name} PROPERTIES COMPILE_FLAGS
                "-D__PLUGIN__ -DMODULE_NAME=${module_name} -DMODULE_NAME_IS_${module_name} -I${CMAKE_CURRENT_SOURCE_DIR}" )
12
        if (VLC_${module_name}_LINK_LIBRARIES)
13
            target_link_libraries( vlc_${module_name} ${VLC_${module_name}_LINK_LIBRARIES})
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
        endif (VLC_${module_name}_LINK_LIBRARIES)
    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)
    set_target_properties(vlc_${module_name} ${ARGN})
ENDMACRO(vlc_set_module_properties)

MACRO(vlc_set_module_properties module_name)
    set_target_properties(vlc_${module_name} ${ARGN})
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)