Building with Package-Tree-Override and Git not working

Hi,
I wanted to compile my package with my git repository + cmake.

Something like this:

include $(TOPDIR)/rules.mk

PKG_NAME:=example
PKG_VERSION:=1.1
PKG_REV:=master
PKG_RELEASE:=1
PKG_MAINTAINER:=maintainer <main@main.com>

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/maintaiiiner/example-test.git

PKG_SOURCE_VERSION:=$(PKG_REV)

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/example
	SECTION:=utils
	CATEGORY:=Utilities
	TITLE:= title.
	MAINTAINER:= main...
	DEPENDS:=$(DRV_DEPENDS) +libubus +libubox +libblobmsg-json +libconfig #+ljson +ljson-c
endef

define Package/example/description
	example description
endef

define Package/example/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/example $(1)/usr/sbin/

	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN) files/example.init $(1)/etc/init.d/example
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_CONF) files/example.config $(1)/etc/config/example
endef

$(eval $(call BuildPackage,example))

Package structure
CmakeList.txt
--> /src
----->CmakeList.txt
-----> *.c, *.h

cmake_minimum_required(VERSION 2.6)
PROJECT(example)

ADD_SUBDIRECTORY(src)

cmake_minimum_required(VERSION 2.6)
PROJECT(example)

ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-unknown-warning-option -Wno-format-truncation)

SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")

SET(SOURCES
	main.c )

SET(LIBS
	ubox ubus json-c blobmsg_json config)

ADD_EXECUTABLE(example ${SOURCES})

TARGET_LINK_LIBRARIES(example ${LIBS})

INSTALL(TARGETS example
	RUNTIME DESTINATION /usr/bin/
)

I enabled package-tree-override...

The target gets build and linked

[100%] Linking C executable example

But after this:

install: cannot stat '/home/nick/lede/source/build_dir/target-mips_24kc_musl/example-1.1/example': No such file or directory

And no ipkg package is created.


Everything works just fine if I have my Makefile without git and this structure:

CmakeList.txt
Makefile
-->/src
....


Sorry for asking but I really don't see what I'm doing wrong. :confused:

Can you please clarify your exact file and directory structure? Best use lested bullt lists for this.
Where is your LEDE Makefile exactly and where is the source getting cloned to?

Maybe provide a complete output of make package/example/{clean,compile} V=sc

Thanks for the answer I found the mistake:

define Package/dawn/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/example $(1)/usr/sbin/example
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/example.init $(1)/etc/init.d/example
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_CONF) $(PKG_BUILD_DIR)/files/example.config $(1)/etc/config/example
endef