summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmol Bhave2018-09-24 17:39:19 +0000
committerHauke Mehrtens2018-09-29 15:23:11 +0000
commit366e6ef5c342f5926d9ab07166b8a40734393dc2 (patch)
tree46b0625bc7880a6ae2d835aea161af3cb2da3871
parentbbf46c9f8feea755ceb8e33ccf91733c1c2b2a34 (diff)
downloadopenwrt-366e6ef5c342f5926d9ab07166b8a40734393dc2.tar.gz
build: use CMAKE_SOURCE_SUBDIR variable to cmake.mk
Sometimes, the CMakeLists.txt file is not in the root directory of a repo. In those cases, the CMAKE_SOURCE_SUBDIR variable can be specified to use CMakeLists.txt from a subdirectory instead. Signed-off-by: Amol Bhave <ambhave@fb.com>
-rw-r--r--include/cmake.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/cmake.mk b/include/cmake.mk
index 900dae1d4a..b66665d20a 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -7,8 +7,8 @@ ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
endif
CMAKE_BINARY_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_BINARY_SUBDIR),/$(CMAKE_BINARY_SUBDIR))
-CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR)
-HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)
+CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR))
+HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR))
MAKE_PATH = $(firstword $(CMAKE_BINARY_SUBDIR) .)
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)