3 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
9 ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
10 cmake_tool=$(TOOLCHAIN_DIR)/bin/$(1)
12 cmake_tool=$(shell which $(1))
15 ifeq ($(CONFIG_CCACHE),)
16 CMAKE_C_COMPILER:=$(call cmake_tool,$(TARGET_CC))
17 CMAKE_CXX_COMPILER:=$(call cmake_tool,$(TARGET_CXX))
18 CMAKE_C_COMPILER_ARG1:=
19 CMAKE_CXX_COMPILER_ARG1:=
21 CCACHE:=$(shell which ccache)
23 CCACHE:=$(STAGING_DIR_HOST)/bin/ccache
25 CMAKE_C_COMPILER:=$(CCACHE)
26 CMAKE_C_COMPILER_ARG1:=$(TARGET_CC_NOCACHE)
27 CMAKE_CXX_COMPILER:=$(CCACHE)
28 CMAKE_CXX_COMPILER_ARG1:=$(TARGET_CXX_NOCACHE)
30 CMAKE_AR:=$(call cmake_tool,$(TARGET_CROSS)ar)
31 CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_CROSS)ranlib)
33 define Build/Configure/Default
34 (cd $(PKG_BUILD_DIR); \
35 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
36 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
37 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
39 -DCMAKE_SYSTEM_NAME=Linux \
40 -DCMAKE_SYSTEM_VERSION=1 \
41 -DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \
42 -DCMAKE_BUILD_TYPE=Release \
43 -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
44 -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
45 -DCMAKE_C_COMPILER="$(CMAKE_C_COMPILER)" \
46 -DCMAKE_C_COMPILER_ARG1="$(CMAKE_C_COMPILER_ARG1)" \
47 -DCMAKE_CXX_COMPILER="$(CMAKE_CXX_COMPILER)" \
48 -DCMAKE_CXX_COMPILER_ARG1="$(CMAKE_CXX_COMPILER_ARG1)" \
49 -DCMAKE_EXE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
50 -DCMAKE_MODULE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
51 -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
52 -DCMAKE_AR="$(CMAKE_AR)" \
53 -DCMAKE_RANLIB="$(CMAKE_RANLIB)" \
54 -DCMAKE_FIND_ROOT_PATH="$(STAGING_DIR);$(TOOLCHAIN_DIR)" \
55 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH \
56 -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
57 -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
59 -DCMAKE_INSTALL_PREFIX=/usr \
60 -DDL_LIBRARY=$(STAGING_DIR) \
61 -DCMAKE_PREFIX_PATH=$(STAGING_DIR) \
67 define Build/InstallDev/cmake
69 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
72 Build/InstallDev = $(if $(CMAKE_INSTALL),$(Build/InstallDev/cmake))