summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-28 13:02:09 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-28 13:02:09 +0200
commit6cd7467fbe20534d26440b4c374ff960efbdf835 (patch)
tree63dfaa599fca19e437c006f70f7a4407904367ea
parent0c4659c67fa3758298421d268534416f32b8372c (diff)
Fix:use first optional argument in adding subdir macro
Change-Id: Id09128836df86ade96036359e125e4ce4f23a124 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--cmake/common.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmake/common.cmake b/cmake/common.cmake
index a78d246..9904692 100644
--- a/cmake/common.cmake
+++ b/cmake/common.cmake
@@ -253,11 +253,13 @@ macro(project_package_build)
endmacro(project_package_build)
macro(project_subdirs_add)
- if(${ARGV0})
+ set (ARGSLIST ${ARGN})
+ list(LENGTH ARGSLIST ARGSNUM)
+ if(${ARGSNUM} GREATER 0)
file(GLOB filelist "${ARGV0}")
else()
- file(GLOB filelist "*")
- endif(${ARGV0})
+ file(GLOB filelist "*")
+ endif()
foreach(filename ${filelist})
if(EXISTS "${filename}/CMakeLists.txt")