TensorFlow Lite - CMake build installable package fail
@algat There could be the following reasons for this specific build failure such as;
a. The dependencies would be missing - the libraries such as Flatbuffers, and XNNPACK should be installed properly
b. Incompatible dependencies - the version would be mismatched sometimes which will cause this failure
c. CMake configuration-  The right version of CMake along  with configuration set up for this should be correct.

By seeing your error log we are assuming that the CMake build system is trying to include the header file and to fix this error, you need to set the `INTERFACE_INCLUDE_DIRECTORIES` property to an absolute path. 
Hope it helps?
Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. I confirm that compilation to an installable package on Ubuntu 23.10 is not possible.

```bash
$ cmake ../tensorflow/tensorflow/lite -DTFLITE_ENABLE_INSTALL=ON \
      -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
      -DSYSTEM_FARMHASH=ON \
      -DSYSTEM_PTHREADPOOL=ON \
      -Dabsl_DIR=/usr/lib/x86_64-linux-gnu/cmake/absl \
      -DEigen3_DIR=/usr/share/eigen3/cmake \
      -DFlatBuffers_DIR=/usr/lib/x86_64-linux-gnu/cmake/flatbuffers \
      -Dgemmlowp_DIR=/usr/lib/x86_64-linux-gnu/cmake/gemmlowp \
      -DNEON_2_SSE_DIR=/usr/lib/cmake/NEON_2_SSE \
      -Dcpuinfo_DIR=/usr/lib/x86_64-linux-gnu/cmake/cpuinfo \
      -Druy_DIR=/usr/lib/x86_64-linux-gnu/cmake/ruy
```

produces the following:

```bash
-- Setting build type to Release, for debug builds use'-DCMAKE_BUILD_TYPE=Debug'.
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found farmhash: /usr/lib/x86_64-linux-gnu/libfarmhash.so  
CMake Warning (dev) at /usr/share/cmake-3.27/Modules/FetchContent.cmake:1316 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  tools/cmake/modules/OverridableFetchContent.cmake:398 (FetchContent_Declare)
  tools/cmake/modules/fft2d.cmake:22 (OverridableFetchContent_Declare)
  tools/cmake/modules/Findfft2d.cmake:18 (include)
  CMakeLists.txt:150 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Downloading cpuinfo to /home/me/Documents/GitHub/tflite_build/cpuinfo-source (define CPUINFO_SOURCE_DIR to avoid it)
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/me/Documents/GitHub/tflite_build/cpuinfo-download
[ 11%] Creating directories for 'cpuinfo'
[ 22%] Performing download step (download, verify and extract) for 'cpuinfo'
-- Downloading...
   dst='/home/me/Documents/GitHub/tflite_build/cpuinfo-download/cpuinfo-prefix/src/959002f82d7962a473d8bf301845f2af720e0aa4.zip'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/pytorch/cpuinfo/archive/959002f82d7962a473d8bf301845f2af720e0aa4.zip'
-- [download 0% complete]
-- [download 1% complete]
-- [download 2% complete]
-- [download 3% complete]
-- [download 4% complete]
-- [download 5% complete]
-- [download 6% complete]
-- [download 7% complete]
-- [download 8% complete]
-- [download 9% complete]
-- [download 10% complete]
-- [download 11% complete]
-- [download 12% complete]
-- [download 13% complete]
-- [download 14% complete]
-- [download 15% complete]
-- [download 16% complete]
-- [download 17% complete]
-- [download 18% complete]
-- [download 19% complete]
-- [download 20% complete]
-- [download 21% complete]
-- [download 22% complete]
-- [download 23% complete]
-- [download 24% complete]
-- [download 25% complete]
-- [download 26% complete]
-- [download 27% complete]
-- [download 28% complete]
-- [download 29% complete]
-- [download 30% complete]
-- [download 31% complete]
-- [download 32% complete]
-- [download 33% complete]
-- [download 34% complete]
-- [download 35% complete]
-- [download 36% complete]
-- [download 37% complete]
-- [download 38% complete]
-- [download 39% complete]
-- [download 40% complete]
-- [download 41% complete]
-- [download 42% complete]
-- [download 43% complete]
-- [download 44% complete]
-- [download 45% complete]
-- [download 46% complete]
-- [download 47% complete]
-- [download 48% complete]
-- [download 49% complete]
-- [download 50% complete]
-- [download 51% complete]
-- [download 52% complete]
-- [download 53% complete]
-- [download 54% complete]
-- [download 55% complete]
-- [download 56% complete]
-- [download 57% complete]
-- [download 58% complete]
-- [download 59% complete]
-- [download 60% complete]
-- [download 61% complete]
-- [download 62% complete]
-- [download 63% complete]
-- [download 64% complete]
-- [download 65% complete]
-- [download 66% complete]
-- [download 67% complete]
-- [download 68% complete]
-- [download 69% complete]
-- [download 70% complete]
-- [download 71% complete]
-- [download 72% complete]
-- [download 73% complete]
-- [download 74% complete]
-- [download 75% complete]
-- [download 76% complete]
-- [download 77% complete]
-- [download 78% complete]
-- [download 79% complete]
-- [download 80% complete]
-- [download 81% complete]
-- [download 82% complete]
-- [download 83% complete]
-- [download 84% complete]
-- [download 85% complete]
-- [download 86% complete]
-- [download 87% complete]
-- [download 88% complete]
-- [download 89% complete]
-- [download 90% complete]
-- [download 91% complete]
-- [download 92% complete]
-- [download 93% complete]
-- [download 94% complete]
-- [download 95% complete]
-- [download 96% complete]
-- [download 97% complete]
-- [download 98% complete]
-- [download 99% complete]
-- [download 100% complete]
-- verifying file...
       file='/home/me/Documents/GitHub/tflite_build/cpuinfo-download/cpuinfo-prefix/src/959002f82d7962a473d8bf301845f2af720e0aa4.zip'
-- Downloading... done
-- extracting...
     src='/home/me/Documents/GitHub/tflite_build/cpuinfo-download/cpuinfo-prefix/src/959002f82d7962a473d8bf301845f2af720e0aa4.zip'
     dst='/home/me/Documents/GitHub/tflite_build/cpuinfo-source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No update step for 'cpuinfo'
[ 44%] No patch step for 'cpuinfo'
[ 55%] No configure step for 'cpuinfo'
[ 66%] No build step for 'cpuinfo'
[ 77%] No install step for 'cpuinfo'
[ 88%] No test step for 'cpuinfo'
[100%] Completed 'cpuinfo'
[100%] Built target cpuinfo
-- Downloading FP16 to /home/me/Documents/GitHub/tflite_build/FP16-source (define FP16_SOURCE_DIR to avoid it)
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/me/Documents/GitHub/tflite_build/FP16-download
[ 11%] Creating directories for 'fp16'
[ 22%] Performing download step (download, verify and extract) for 'fp16'
-- Downloading...
   dst='/home/me/Documents/GitHub/tflite_build/FP16-download/fp16-prefix/src/0a92994d729ff76a58f692d3028ca1b64b145d91.zip'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/Maratyszcza/FP16/archive/0a92994d729ff76a58f692d3028ca1b64b145d91.zip'
-- [download 14% complete]
-- [download 45% complete]
-- [download 88% complete]
-- [download 99% complete]
-- [download 100% complete]
-- verifying file...
       file='/home/me/Documents/GitHub/tflite_build/FP16-download/fp16-prefix/src/0a92994d729ff76a58f692d3028ca1b64b145d91.zip'
-- Downloading... done
-- extracting...
     src='/home/me/Documents/GitHub/tflite_build/FP16-download/fp16-prefix/src/0a92994d729ff76a58f692d3028ca1b64b145d91.zip'
     dst='/home/me/Documents/GitHub/tflite_build/FP16-source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No update step for 'fp16'
[ 44%] No patch step for 'fp16'
[ 55%] No configure step for 'fp16'
[ 66%] No build step for 'fp16'
[ 77%] No install step for 'fp16'
[ 88%] No test step for 'fp16'
[100%] Completed 'fp16'
[100%] Built target fp16
-- Downloading FXdiv to /home/me/Documents/GitHub/tflite_build/FXdiv-source (define FXDIV_SOURCE_DIR to avoid it)
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/me/Documents/GitHub/tflite_build/FXdiv-download
[ 11%] Creating directories for 'fxdiv'
[ 22%] Performing download step (download, verify and extract) for 'fxdiv'
-- Downloading...
   dst='/home/me/Documents/GitHub/tflite_build/FXdiv-download/fxdiv-prefix/src/b408327ac2a15ec3e43352421954f5b1967701d1.zip'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/Maratyszcza/FXdiv/archive/b408327ac2a15ec3e43352421954f5b1967701d1.zip'
-- [download 65% complete]
-- [download 100% complete]
-- verifying file...
       file='/home/me/Documents/GitHub/tflite_build/FXdiv-download/fxdiv-prefix/src/b408327ac2a15ec3e43352421954f5b1967701d1.zip'
-- Downloading... done
-- extracting...
     src='/home/me/Documents/GitHub/tflite_build/FXdiv-download/fxdiv-prefix/src/b408327ac2a15ec3e43352421954f5b1967701d1.zip'
     dst='/home/me/Documents/GitHub/tflite_build/FXdiv-source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No update step for 'fxdiv'
[ 44%] No patch step for 'fxdiv'
[ 55%] No configure step for 'fxdiv'
[ 66%] No build step for 'fxdiv'
[ 77%] No install step for 'fxdiv'
[ 88%] No test step for 'fxdiv'
[100%] Completed 'fxdiv'
[100%] Built target fxdiv
-- Downloading pthreadpool to /home/me/Documents/GitHub/tflite_build/pthreadpool-source (define PTHREADPOOL_SOURCE_DIR to avoid it)
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/me/Documents/GitHub/tflite_build/pthreadpool-download
[ 11%] Creating directories for 'pthreadpool'
[ 22%] Performing download step (download, verify and extract) for 'pthreadpool'
-- Downloading...
   dst='/home/me/Documents/GitHub/tflite_build/pthreadpool-download/pthreadpool-prefix/src/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/Maratyszcza/pthreadpool/archive/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip'
-- [download 18% complete]
-- [download 37% complete]
-- [download 56% complete]
-- [download 87% complete]
-- [download 95% complete]
-- [download 100% complete]
-- verifying file...
       file='/home/me/Documents/GitHub/tflite_build/pthreadpool-download/pthreadpool-prefix/src/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip'
-- Downloading... done
-- extracting...
     src='/home/me/Documents/GitHub/tflite_build/pthreadpool-download/pthreadpool-prefix/src/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip'
     dst='/home/me/Documents/GitHub/tflite_build/pthreadpool-source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No update step for 'pthreadpool'
[ 44%] No patch step for 'pthreadpool'
[ 55%] No configure step for 'pthreadpool'
[ 66%] No build step for 'pthreadpool'
[ 77%] No install step for 'pthreadpool'
[ 88%] No test step for 'pthreadpool'
[100%] Completed 'pthreadpool'
[100%] Built target pthreadpool
CMake Deprecation Warning at /home/me/Documents/GitHub/tflite_build/FP16-source/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Downloading PSimd to /home/me/Documents/GitHub/tflite_build/psimd-source (define PSIMD_SOURCE_DIR to avoid it)
CMake Deprecation Warning at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/me/Documents/GitHub/tflite_build/psimd-download
[ 11%] Creating directories for 'psimd'
[ 22%] Performing download step (git clone) for 'psimd'
Klone nach 'psimd-source' …
Ihr Branch ist auf demselben Stand wie 'origin/master'.
Bereits auf 'master'
[ 33%] Performing update step for 'psimd'
[ 44%] No patch step for 'psimd'
[ 55%] No configure step for 'psimd'
[ 66%] No build step for 'psimd'
[ 77%] No install step for 'psimd'
[ 88%] No test step for 'psimd'
[100%] Completed 'psimd'
[100%] Built target psimd
CMake Deprecation Warning at /home/me/Documents/GitHub/tflite_build/psimd-source/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done (35.6s)
CMake Error in tools/cmake/modules/ml_dtypes/CMakeLists.txt:
  Target "ml_dtypes" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/me/Documents/GitHub/tflite_build/ml_dtypes"

  which is prefixed in the build directory.


CMake Error in tools/cmake/modules/ml_dtypes/CMakeLists.txt:
  Target "ml_dtypes" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/me/Documents/GitHub/tflite_build/ml_dtypes/ml_dtypes"

  which is prefixed in the build directory.


CMake Error: install(EXPORT "tensorflow-liteTargets" ...) includes target "tensorflow-lite" which requires target "pthreadpool" that is not in any export set.
CMake Error: install(EXPORT "tensorflow-liteTargets" ...) includes target "tensorflow-lite" which requires target "XNNPACK" that is not in any export set.
-- Generating done (0.4s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
``` @algat 
This issue is effectively a duplicate of  #62381 .
Can we close this issue here as it is already being tracked there?

 Thank You This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62147">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62147">No</a>

### Issue type

Build/Install

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.14

### Custom code

No

### OS platform and distribution

Mac Ventura

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

When following https://www.tensorflow.org/lite/guide/build_cmake#build_installable_package to build TensorFlow Lite with CMake, using the flag `-DTFLITE_ENABLE_INSTALL=ON`, a CMake error happens, saying that `the Target ml_dtypes INTERFACE_INCLUDE_DIRECTORIES property contains path: which is prefixed in the build directory.`



### Standalone code to reproduce the issue

```shell
git clone https://github.com/tensorflow/tensorflow.git tensorflow_src
mkdir tflite_build
cd tflite_build
cmake ../tensorflow_src/tensorflow/lite -DTFLITE_ENABLE_INSTALL=ON
```


### Relevant log output

```shell
CMake Error in tools/cmake/modules/ml_dtypes/CMakeLists.txt:
  Target "ml_dtypes" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/Users/me/tf_build/ml_dtypes"

  which is prefixed in the build directory.


CMake Error in tools/cmake/modules/ml_dtypes/CMakeLists.txt:
  Target "ml_dtypes" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/Users/me/tf_build/ml_dtypes/ml_dtypes"

  which is prefixed in the build directory.
```
