Commit f42ab7ba authored by Jan Möbius's avatar Jan Möbius
Browse files

Handle plugin collections

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15690 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 24079c86
......@@ -38,6 +38,7 @@ function (of_add_plugins)
GLOB _plugins_in
RELATIVE "${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/Plugin-*/CMakeLists.txt"
"${CMAKE_SOURCE_DIR}/PluginCollection-*/Plugin-*/CMakeLists.txt"
)
foreach (_plugin ${_plugins_in})
......@@ -46,6 +47,16 @@ function (of_add_plugins)
endforeach ()
endfunction ()
macro(_get_plugin_name _path _name)
# Only get the plugins name:
string (REGEX MATCH "Plugin-.+[/\\]?$" ${_name} ${${_path}})
# Strip the Plugin- Prefix
string (REPLACE "Plugin-" "" ${_name} ${${_name}})
endmacro()
# print plugin statistics
function (of_print_plugin_stats)
......@@ -54,13 +65,32 @@ function (of_print_plugin_stats)
GLOB _plugins_in
RELATIVE "${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/Plugin-*"
"${CMAKE_SOURCE_DIR}/PluginCollection-*/Plugin-*"
)
list (SORT _plugins_in)
foreach (_plugin ${_plugins_in})
string (REPLACE "Plugin-" "" _plugin_name ${_plugin})
# Extract plugin name from path
_get_plugin_name( _plugin _plugin_name )
# Possibly get the collection name
string (REGEX MATCH "PluginCollection-.+[/\\]" collection_name ${_plugin})
# If plugin belongs to a selection, we check that here
if ( collection_name )
# Strip the Plugin- Prefix
string (REPLACE "PluginCollection-" "" collection_name ${collection_name})
string (REPLACE "/" "" collection_name ${collection_name})
endif()
# TODO Group the plugins by selection!
# TODO Correctly sort plugins by their name
# We need the upper case name that is used for the plugin handling variables
string (TOUPPER ${_plugin_name} _PLUGIN)
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/${_plugin}/CMakeLists.txt AND DISABLE_QMAKE_BUILD)
list (APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_SOURCE_DIR}/${_plugin}")
elseif (DISABLE_PLUGIN_${_PLUGIN})
......@@ -76,31 +106,46 @@ function (of_print_plugin_stats)
set (PLUGINS_NO_CMAKE "")
foreach (_plugin ${_plugins_in})
string (REPLACE "Plugin-" "" _plugin_name ${_plugin})
# Extract plugin name from path
_get_plugin_name( _plugin _plugin_name )
# We need the upper case name that is used for the plugin handling variables
string (TOUPPER ${_plugin_name} _PLUGIN)
# Disable the problematic plugins in the cpack pass
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/${_plugin}/CMakeLists.txt AND DISABLE_QMAKE_BUILD)
list (APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_SOURCE_DIR}/${_plugin}")
elseif (DISABLE_PLUGIN_${_PLUGIN})
list (APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_SOURCE_DIR}/${_plugin}")
endif ()
acg_format_string (${_plugin_name} 25 _plugin_name)
if (DISABLE_PLUGIN_${_PLUGIN})
list( APPEND PLUGINS_DISABLED ${_plugin} )
list( APPEND PLUGINS_DISABLED ${_plugin_name} )
elseif (NOT EXISTS ${CMAKE_SOURCE_DIR}/${_plugin}/CMakeLists.txt)
list( APPEND PLUGINS_NO_CMAKE ${_plugin} )
list( APPEND PLUGINS_NO_CMAKE ${_plugin_name} )
else ()
if (OPENFLIPPER_${_PLUGIN}_BUILD)
list( APPEND PLUGINS_OK ${_plugin} )
list( APPEND PLUGINS_OK ${_plugin_name} )
else ()
list( APPEND PLUGINS_DEPENDENCIES ${_plugin} )
list( APPEND PLUGINS_DEPENDENCIES ${_plugin_name} )
endif ()
endif ()
endforeach ()
message ("")
# The minimal distance to the : to allow all plugin names to fit into the column
set (SPACING 30)
# Print all plugins, which have no cmake build system
acg_color_message ("\n${_escape}[4mPlugins without cmake build system:${_escape}[0m\n")
foreach (_plugin ${PLUGINS_NO_CMAKE})
string (REPLACE "Plugin-" "" _plugin_name ${_plugin})
string (TOUPPER ${_plugin_name} _PLUGIN)
acg_format_string (${_plugin_name} 25 _plugin_name)
acg_format_string (${_plugin_name} ${SPACING} _plugin_name)
acg_color_message (" ${_plugin_name}: ${_escape}[1;34mNo CMake build system${_escape}[0m")
endforeach ()
......@@ -111,8 +156,7 @@ function (of_print_plugin_stats)
acg_color_message ("\n${_escape}[4mPlugins configured successfully:${_escape}[0m\n")
foreach (_plugin ${PLUGINS_OK})
string (REPLACE "Plugin-" "" _plugin_name ${_plugin})
string (TOUPPER ${_plugin_name} _PLUGIN)
acg_format_string (${_plugin_name} 25 _plugin_name)
acg_format_string (${_plugin_name} ${SPACING} _plugin_name)
acg_color_message (" ${_plugin_name}: ${_escape}[1;32mYes${_escape}[0m")
endforeach ()
......@@ -124,22 +168,19 @@ function (of_print_plugin_stats)
acg_color_message ("\n${_escape}[4mPlugins disabled:${_escape}[0m\n")
foreach (_plugin ${PLUGINS_DISABLED})
string (REPLACE "Plugin-" "" _plugin_name ${_plugin})
string (TOUPPER ${_plugin_name} _PLUGIN)
acg_format_string (${_plugin_name} 25 _plugin_name)
acg_format_string (${_plugin_name} ${SPACING} _plugin_name)
acg_color_message (" ${_plugin_name}: ${_escape}[1;34mDisabled${_escape}[0m")
endforeach ()
message ("")
# Print all plugins, which have missing dependencies
acg_color_message ("\n${_escape}[4mPlugins with missing dependencies:${_escape}[0m\n")
foreach (_plugin ${PLUGINS_DEPENDENCIES})
string (REPLACE "Plugin-" "" _plugin_name ${_plugin})
string (TOUPPER ${_plugin_name} _PLUGIN)
acg_format_string (${_plugin_name} 25 _plugin_name)
acg_format_string (${_plugin_name} ${SPACING} _plugin_name)
acg_color_message (" ${_plugin_name}: ${_escape}[1;31mNo${_escape}[0m (Missing dependencies :${_${_PLUGIN}_MISSING_DEPS})")
endforeach ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment