Now, user can request add_subdirectories not to include some
directories.
Note that there is no change in the default behavior.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
function(add_subdirectories)
+ cmake_parse_arguments(ARG "" "" "EXCLUDES" ${ARGN})
+
file(GLOB PROJECT_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"*/CMakeLists.txt")
foreach(PROJECT_FILE IN ITEMS ${PROJECT_FILES})
get_filename_component(PROJECT_DIR ${PROJECT_FILE} DIRECTORY)
- add_subdirectory(${PROJECT_DIR})
+ list(FIND ARG_EXCLUDES ${PROJECT_DIR} PROJECT_INDEX)
+ if(${PROJECT_INDEX} EQUAL -1)
+ add_subdirectory(${PROJECT_DIR})
+ endif(${PROJECT_INDEX} EQUAL -1)
endforeach(PROJECT_FILE)
endfunction(add_subdirectories)