@@ -65,6 +65,17 @@ set_target_properties(service PROPERTIES OUTPUT_NAME ${BINARY})
6565# DRIVERS / PLUGINS - support for parent cmake list specification
6666#
6767
68+ # Add extra drivers defined from command line
69+ set (DRIVERS ${DRIVERS} ${EXTRA_DRIVERS} )
70+ if (DRIVERS)
71+ list (REMOVE_DUPLICATES DRIVERS) # Remove duplicate drivers
72+ endif ()
73+ # Add extra plugins defined from command line
74+ set (PLUGINS ${PLUGINS} ${EXTRA_PLUGINS} )
75+ if (PLUGINS)
76+ list (REMOVE_DUPLICATES PLUGINS) # Remove duplicate plugins
77+ endif ()
78+
6879# Function:
6980# Add plugin / driver as library, set link options
7081function (configure_plugin type plugin_name path )
@@ -134,6 +145,12 @@ foreach(DEP ${DEPENDENCIES})
134145 add_dependencies (service ${DEP_NAME} )
135146endforeach ()
136147
148+ # Add extra libraries defined from command line
149+ set (LIBRARIES ${LIBRARIES} ${EXTRA_LIBRARIES} )
150+ if (LIBRARIES)
151+ list (REMOVE_DUPLICATES LIBRARIES) # Remove duplicate libraries
152+ endif ()
153+
137154# add all extra libs
138155foreach (LIBR ${LIBRARIES} )
139156 # if relative path but not local, use includeos lib.
@@ -267,8 +284,9 @@ function(add_memdisk DISK)
267284endfunction ()
268285
269286# automatically build memdisk from folder
270- function (diskbuilder FOLD )
287+ function (build_memdisk FOLD )
271288 get_filename_component (REL_PATH "${FOLD} " REALPATH BASE_DIR "${CMAKE_SOURCE_DIR} " )
289+ message (STATUS ${REL_PATH} )
272290 add_custom_command (
273291 OUTPUT memdisk.fat
274292 COMMAND ${INSTALL_LOC} /bin/diskbuilder -o memdisk.fat ${REL_PATH}
@@ -279,6 +297,18 @@ function(diskbuilder FOLD)
279297 add_memdisk ("${CMAKE_BINARY_DIR} /memdisk.fat" )
280298endfunction ()
281299
300+ # build memdisk if defined
301+ if (MEMDISK)
302+ build_memdisk (${MEMDISK} )
303+ endif ()
304+
305+ # call build_memdisk only if MEMDISK is not defined from command line
306+ function (diskbuilder FOLD )
307+ if (NOT MEMDISK)
308+ build_memdisk (${FOLD} )
309+ endif ()
310+ endfunction ()
311+
282312if (TARFILE)
283313 get_filename_component (TAR_RELPATH "${TARFILE} "
284314 REALPATH BASE_DIR "${CMAKE_SOURCE_DIR} " )
0 commit comments