1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-30 01:00:13 +02:00

Branding and download manager updates

This commit is contained in:
Dominik Schmidt
2015-09-06 20:37:16 +02:00
parent 37512055e1
commit aafff617e5
46 changed files with 637 additions and 311 deletions

View File

@@ -19,37 +19,50 @@ function(tomahawk_add_plugin)
# message("NO_INSTALL: ${PLUGIN_NO_INSTALL}")
# create target name once for convenience
set(target "tomahawk_${PLUGIN_TYPE}_${PLUGIN_NAME}")
set(target "${TOMAHAWK_TARGET_NAME}_${PLUGIN_TYPE}_${PLUGIN_NAME}")
# determine target type
if(NOT ${PLUGIN_SHARED_LIB})
set(target_type "MODULE")
else()
set(target_type "SHARED")
# create option to disable plugins
string(TOUPPER "${PLUGIN_TYPE}" PLUGIN_TYPE_UPPER)
string(TOUPPER "${PLUGIN_NAME}" PLUGIN_NAME_UPPER)
set(PLUGIN_OPTION "BUILD_${PLUGIN_TYPE_UPPER}_${PLUGIN_NAME_UPPER}")
if(NOT DEFINED ${PLUGIN_OPTION})
set(${PLUGIN_OPTION} ON)
endif()
list(APPEND tomahawk_add_library_args
"${target}"
"EXPORT_MACRO" "${PLUGIN_EXPORT_MACRO}"
"TARGET_TYPE" "${target_type}"
"SOURCES" "${PLUGIN_SOURCES}"
)
option(${PLUGIN_OPTION} "Build Tomahawk with the ${PLUGIN_NAME} ${PLUGIN_TYPE}" ${${PLUGIN_OPTION}})
if(PLUGIN_UI)
list(APPEND tomahawk_add_library_args "UI" "${PLUGIN_UI}")
if(${PLUGIN_OPTION})
# determine target type
if(NOT ${PLUGIN_SHARED_LIB})
set(target_type "MODULE")
else()
set(target_type "SHARED")
endif()
list(APPEND tomahawk_add_library_args
"${target}"
"EXPORT_MACRO" "${PLUGIN_EXPORT_MACRO}"
"TARGET_TYPE" "${target_type}"
"SOURCES" "${PLUGIN_SOURCES}"
)
if(PLUGIN_UI)
list(APPEND tomahawk_add_library_args "UI" "${PLUGIN_UI}")
endif()
if(PLUGIN_LINK_LIBRARIES)
list(APPEND tomahawk_add_library_args "LINK_LIBRARIES" "${PLUGIN_LINK_LIBRARIES}")
endif()
if(PLUGIN_COMPILE_DEFINITIONS)
list(APPEND tomahawk_add_library_args "COMPILE_DEFINITIONS" ${PLUGIN_COMPILE_DEFINITIONS})
endif()
list(APPEND tomahawk_add_library_args "NO_VERSION")
list(APPEND tomahawk_add_library_args "INSTALL_BINDIR" "${CMAKE_INSTALL_LIBDIR}")
tomahawk_add_library(${tomahawk_add_library_args})
endif()
if(PLUGIN_LINK_LIBRARIES)
list(APPEND tomahawk_add_library_args "LINK_LIBRARIES" "${PLUGIN_LINK_LIBRARIES}")
endif()
if(PLUGIN_COMPILE_DEFINITIONS)
list(APPEND tomahawk_add_library_args "COMPILE_DEFINITIONS" ${PLUGIN_COMPILE_DEFINITIONS})
endif()
list(APPEND tomahawk_add_library_args "NO_VERSION")
list(APPEND tomahawk_add_library_args "INSTALL_BINDIR" "${CMAKE_INSTALL_LIBDIR}")
tomahawk_add_library(${tomahawk_add_library_args})
endfunction()