Browse Source

cmake: allows to build in source tree by filtering subdirs

Without it FTBFS and displays this error message :

  cmake . && make
  (...)
  The source directory
  (...) src/CMakeFiles
  does not contain a CMakeLists.txt file.

Change-Id: I08efc4667d1004a5d19575dd4464dcd89d03fb28
Bug: https://github.com/intel-iot-devkit/upm/pull/75
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Philippe Coval 10 years ago
parent
commit
a665b5d6f1
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/CMakeLists.txt

+ 3
- 1
src/CMakeLists.txt View File

@@ -128,5 +128,7 @@ endmacro(upm_module_init)
128 128
 
129 129
 subdirlist(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
130 130
 foreach(subdir ${SUBDIRS})
131
-    add_subdirectory(${subdir})
131
+    if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/CMakeLists.txt)
132
+        add_subdirectory(${subdir})
133
+    endif()
132 134
 endforeach()