c++ examples: cmake now honors MODULE_LIST

If MODULE_LIST is set, cmake will only create examples that can be built
with avaialble modules. There has been significant change to cmake file.
Comments show you how to add new examples.

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Henry Bruce
2015-11-19 15:49:18 -08:00
committed by Mihai Tudor Panu
parent a96a2ff44c
commit 01700b0d49
4 changed files with 248 additions and 445 deletions

View File

@ -202,7 +202,12 @@ macro(upm_module_init)
endif()
endmacro(upm_module_init)
subdirlist(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
if (MODULE_LIST)
set(SUBDIRS ${MODULE_LIST})
set(SUBDIRS ${SUBDIRS} upm)
else()
subdirlist(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
endif()
foreach(subdir ${SUBDIRS})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/CMakeLists.txt)
add_subdirectory(${subdir})