-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (43 loc) · 1.75 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
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
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 3.28)
project(xattrplaying_plugin C)
find_library(VLC_PULSE_PATH NAMES vlc_pulse
PATHS
/usr/lib
/usr/lib64
/usr/local/lib
/usr/local/lib64
PATH_SUFFIXES "vlc"
NO_CACHE REQUIRED)
get_filename_component(VLC_INSTALL_DIR "${VLC_PULSE_PATH}" DIRECTORY )
message(STATUS "VLC_INSTALL_DIR: ${VLC_INSTALL_DIR} from ${VLC_PULSE_PATH}")
# Set the source files for the extension
set(SOURCES
library.c
)
# Find VLC libraries and headers
find_path(VLC_INCLUDE_DIR vlc.h PATH_SUFFIXES include/vlc REQUIRED)
message(STATUS "VLC_INCLUDE_DIR: ${VLC_INCLUDE_DIR}")
# Include directories for VLC headers
include_directories(
${VLC_INCLUDE_DIR}
${VLC_INCLUDE_DIR}/plugins
)
add_definitions(-DMODULE_STRING=\"xattrplaystat\")
add_definitions(-D__PLUGIN__)
add_definitions(-D_REENTRANT)
add_definitions(-D_THREAD_SAFE)
add_definitions(-D_FILE_OFFSET_BITS=64)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
# Specify the output shared library name
add_library(xattrplaying_plugin MODULE ${SOURCES})
# Link against VLC libraries
target_link_libraries(xattrplaying_plugin ${VLC_LIBRARY})
# Set the output directory for the shared library
set_target_properties(xattrplaying_plugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib")
## Set installation directory for the shared library
#install(TARGETS xattrplaying_plugin LIBRARY DESTINATION ${VLC_INSTALL_DIR}/plugins/misc/)
#
## Optionally: Copy the plugin to VLC plugins directory for development/testing
#add_custom_command(TARGET xattrplaying_plugin POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:xattrplaying_plugin> ${VLC_INSTALL_DIR}/plugins/$<TARGET_FILE_NAME:xattrplaying_plugin>
#)