cmake: allow binary directory to be specified

Extend the add_subdirectory_ifdef extension to allow specifying
the binary directory.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
This commit is contained in:
Rafał Kuźnia 2021-03-12 14:18:00 +01:00 committed by Carles Cufí
commit e68cfb5683

View file

@ -1311,9 +1311,9 @@ endfunction()
# ifdef functions are added on an as-need basis. See # ifdef functions are added on an as-need basis. See
# https://cmake.org/cmake/help/latest/manual/cmake-commands.7.html for # https://cmake.org/cmake/help/latest/manual/cmake-commands.7.html for
# a list of available functions. # a list of available functions.
function(add_subdirectory_ifdef feature_toggle dir) function(add_subdirectory_ifdef feature_toggle source_dir)
if(${${feature_toggle}}) if(${${feature_toggle}})
add_subdirectory(${dir}) add_subdirectory(${source_dir} ${ARGN})
endif() endif()
endfunction() endfunction()