Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Wohlstand committed Sep 28, 2018
2 parents e678ada + 4cf3a53 commit 204c483
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -507,27 +507,30 @@ if(WITH_VLC_PLUGIN)
list(APPEND adlmidi_vlc_src
${libADLMIDI_SOURCE_DIR}/utils/vlc_codec/libadlmidi.c)

add_library(adlmidi_plugin MODULE ${adlmidi_vlc_src})
target_compile_options(adlmidi_plugin PUBLIC
add_library(adlmidi_vlc_plugin MODULE ${adlmidi_vlc_src})
set_target_properties(adlmidi_vlc_plugin PROPERTIES OUTPUT_NAME adlmidi_plugin)
target_compile_options(adlmidi_vlc_plugin PUBLIC
"-DVLC_MODULE_COPYRIGHT=\"Copyright \(c\) Vitaly Novichkov\""
"-DVLC_MODULE_LICENSE=\"GPLv3\""
"-DMODULE_STRING=\"adlmidi\""
${VLCPLUGIN_DEFINITIONS})
target_include_directories(adlmidi_plugin PRIVATE
target_include_directories(adlmidi_vlc_plugin PRIVATE
${LIBVLC_INCLUDE_DIR}/vlc/plugins
${LIBVLC_INCLUDE_DIR}/vlc)
target_link_libraries(adlmidi_plugin ADLMIDI_IF vlccore m stdc++)
# target_link_libraries(adlmidi_plugin INTERFACE "-export-symbol-regex ^vlc_entry")
target_link_libraries(adlmidi_vlc_plugin ADLMIDI_IF vlccore m stdc++)
# target_link_libraries(adlmidi_vlc_plugin INTERFACE "-export-symbol-regex ^vlc_entry")

install(TARGETS adlmidi_vlc_plugin DESTINATION "${VLCPLUGIN_CODEC_INSTALL_PATH}")

if(libADLMIDI_SHARED)
add_dependencies(adlmidi_plugin ADLMIDI_shared)
add_dependencies(adlmidi_vlc_plugin ADLMIDI_shared)
# ========= WIP =========
# set_target_properties(adlmidiplay PROPERTIES COMPILE_FLAGS "-Wl,-rpath='$$ORIGIN/../lib'")
else()
if(NOT libADLMIDI_STATIC)
message(FATAL_ERROR "libADLMIDI is required to be built!")
endif()
add_dependencies(adlmidi_plugin ADLMIDI_static)
add_dependencies(adlmidi_vlc_plugin ADLMIDI_static)
endif()

endif()
Expand Down
27 changes: 24 additions & 3 deletions cmake/FindLIBVLC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,34 @@ endif(NOT LIBVLC_MIN_VERSION)
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
# searching for the same item do nothing.

if (NOT WIN32)
if(NOT WIN32)
find_package(PkgConfig)
pkg_check_modules(PC_LIBVLC libvlc)
set(LIBVLC_DEFINITIONS ${PC_LIBVLC_CFLAGS_OTHER})
set(LIBVLC_INCLUDE_DIRS ${PC_LIBVLC_INCLUDEDIR} ${PC_LIBVLC_INCLUDE_DIRS})

pkg_check_modules(PC_VLCPLUGIN vlc-plugin)
set(VLCPLUGIN_DEFINITIONS ${PC_VLCPLUGIN_CFLAGS_OTHER})
endif (NOT WIN32)
set(VLCPLUGIN_INCLUDE_DIRS ${PC_VLCPLUGIN_INCLUDEDIR} ${PC_VLCPLUGIN_INCLUDE_DIRS})

pkg_get_variable(PC_VLCPLUGIN_PLUGINS_PATH vlc-plugin pluginsdir)
set(VLCPLUGIN_CODEC_INSTALL_PATH ${PC_VLCPLUGIN_PLUGINS_PATH}/codec)

message("-- VLC Lib include path is \"${LIBVLC_INCLUDE_DIRS}\" ==")
message("-- VLC Plugins include path is \"${VLCPLUGIN_INCLUDE_DIRS}\" ==")
message("-- VLC Plugins path is \"${VLCPLUGIN_CODEC_INSTALL_PATH}\" ==")
else()
set(LIBVLC_DEFINITIONS)
# FIXME: Is "_FILE_OFFSET_BITS=64" correct for Windows?
set(VLCPLUGIN_DEFINITIONS
-D__PLUGIN__
-D_FILE_OFFSET_BITS=64
-D_REENTRANT
-D_THREAD_SAFE
)
# FIXME: Put the proper install path here
set(VLCPLUGIN_CODEC_INSTALL_PATH "C:/Program Files/vlc/plugins/codec")
endif()

#Put here path to custom location
#example: /home/user/vlc/include etc..
Expand All @@ -42,7 +63,7 @@ PATHS
#mingw
c:/msys/local/include
)
find_path(LIBVLC_INCLUDE_DIR PATHS "${CMAKE_INCLUDE_PATH}/vlc" NAMES vlc.h
find_path(LIBVLC_INCLUDE_DIR PATHS "${CMAKE_INCLUDE_PATH}/vlc" NAMES vlc.h
HINTS ${PC_LIBVLC_INCLUDEDIR} ${PC_LIBVLC_INCLUDE_DIRS})

#Put here path to custom location
Expand Down

0 comments on commit 204c483

Please sign in to comment.