# No rule to make target 'install'

**URL:** <https://discourse.cmake.org/t/no-rule-to-make-target-install/3170>\
**Category:** Code\
**Created:** [April 17, 2021, 8:09pm UTC](https://discourse.cmake.org/t/no-rule-to-make-target-install/3170 "2021-04-17T20:09:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ardtrkc](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ardtrkc/32/1389_2.png) [@ardtrkc](https://discourse.cmake.org/u/ardtrkc)\
**Post date:** [April 17, 2021, 8:09pm UTC](https://discourse.cmake.org/t/no-rule-to-make-target-install/3170/1 "2021-04-17T20:09:57Z")

</div>

While compiling the [minimal.cpp](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/examples/minimal) example of TensorFlow Lite with cmake on Yocto platform, we are having error as follows:

```
    Log data follows:
| DEBUG: Executing shell function do_install
| NOTE: make -j 4 DESTDIR=/home/student/fsl-release-bsp/build-analytics-tflite/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/minimal/1.0-r0/image install
| ERROR: oe_runmake failed
| make: *** No rule to make target 'install'. Stop.
| ERROR: Function failed: do_install (log file is located at /home/student/fsl-release-bsp/build-analytics-tflite/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/minimal/1.0-r0/temp/log.do_install.2654)
ERROR: Task (/home/student/fsl-release-bsp/sources/meta-analytics-tflite/recipes-hello/patch/minimal.bb:do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1787 tasks of which 1786 didn't need to be rerun and 1 failed.

```

On the install line of our _CMakeLists.txt_ file the idea is not clear in our mind about “TARGETS”. If you brighten up our mind it would be perfect.

- The CMakeLists.txt file is as follows:

```auto
cmake_minimum_required(VERSION 3.6)

project(patch)

add_executable(minimal minimal.cc)

target_include_directories(minimal PUBLIC /home/student/fsl-release-bsp/build-analytics-tflite/tmp/sysroots/analytics/usr/include/tensorflow/contrib/lite/tools/make/downloads/flatbuffers/include)

target_link_libraries(minimal tensorflow-lite pthread ${CMAKE_DL_LIBS})

install(TARGETS patch DESTINATION git)

```

Your guidance and clarifications are important for us.

Thank you in advance !

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [April 18, 2021, 12:42pm UTC](https://discourse.cmake.org/t/no-rule-to-make-target-install/3170/2 "2021-04-18T12:42:05Z")

</div>

You don’t have a `patch` target. Did you mean `TARGETS minimal`?

---

<div class="post-metadata">

**Author:** ![ardtrkc](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ardtrkc/32/1389_2.png) [@ardtrkc](https://discourse.cmake.org/u/ardtrkc)\
**Post date:** [April 18, 2021, 2:51pm UTC](https://discourse.cmake.org/t/no-rule-to-make-target-install/3170/3 "2021-04-18T14:51:30Z")

</div>

Exactly ! We fixed that but still having the same error.  
About the `DESTINATION` should we address the full path of new created file ?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [April 18, 2021, 4:42pm UTC](https://discourse.cmake.org/t/no-rule-to-make-target-install/3170/4 "2021-04-18T16:42:43Z")

</div>

`DESTINATION` is the directory under `${CMAKE_INSTALL_PREFIX}` to place the artifact(s). So you’ll have `/usr/local/git/minimal` (using the default `CMAKE_INSTALL_PREFIX`) here.

By commenting out the `target_include_directories` and `target_link_libraries` lines with a very minimal `minimal.cc`, I get an install target at least. Is there a `cmake_install.cmake` file in your build tree? What generator are you using?

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [April 18, 2021, 4:44pm UTC](https://discourse.cmake.org/t/no-rule-to-make-target-install/3170/5 "2021-04-18T16:44:32Z")

</div>

Oh, I just read it much closer. Your minimal example is not representative of your error.

> [@ardtrkc](#):
>
> ```auto
> | DEBUG: Executing shell function do_install
> | NOTE: make -j 4 DESTDIR=/home/student/fsl-release-bsp/build-analytics-tflite/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/minimal/1.0-r0/image install
> | ERROR: oe_runmake failed
> | make: *** No rule to make target 'install'. Stop.
> 
> ```

Somewhere in your build, you have an `oe_runmake` with a `do_install` target. There’s a `Makefile` in `/home/student/…` that doesn’t have an `install` target. Wherever that is specified needs more investigation as to what is trying to do that and/or why it isn’t available.

---

<div class="post-metadata">

**Author:** ![ardtrkc](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ardtrkc/32/1389_2.png) [@ardtrkc](https://discourse.cmake.org/u/ardtrkc)\
**Post date:** [April 18, 2021, 7:48pm UTC](https://discourse.cmake.org/t/no-rule-to-make-target-install/3170/6 "2021-04-18T19:48:55Z")

</div>

First of all thank you for your kind effort, we are working on Yocto platform and we have recipe(.bb) files which also includes `do_install` target. In our bitbake file we did not put `do_install` because we assume `inherit cmake` covers that tasks. Maybe the reason of error is that. Below you can find our .bb file;

```
SUMMARY = "Recipe for the Hello World program"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

DEPENDS += "opencv"
DEPENDS += "libconfig"
DEPENDS += "tensorflow-lite"

SRC_URI = "git://github.com/aniladar/patch.git;protocol=https;branch=main"

SRCREV = "${AUTOREV}"

# Here we specify the source directory, where we do all the building and expect sources to be placed
S = "${WORKDIR}/git"

inherit cmake
```

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [April 18, 2021, 10:07pm UTC](https://discourse.cmake.org/t/no-rule-to-make-target-install/3170/7 "2021-04-18T22:07:17Z")

</div>

I’m not familiar with bitbake or Yocto myself. I’d track down other users of `inherit cmake` and try and strip them down to see what you’re missing. Other than that, the Yocto development lists are likely to be more helpful (though others might know some Yocto here, this feels more like a Yocto-using-CMake kind of question).
