tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.23k stars 1.47k forks source link

Cmake error for java #501

Closed nekzabirov closed 5 years ago

nekzabirov commented 5 years ago

I have this error

`CMake Error at CMakeLists.txt:5 (find_package): By not providing "FindTd.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Td", but CMake did not find one.

Could not find a package configuration file provided by "Td" with any of the following names:

TdConfig.cmake
td-config.cmake

Add the installation prefix of "Td" to CMAKE_PREFIX_PATH or set "Td_DIR" to a directory containing one of the above files. If "Td" provides a separate development package or SDK, be sure it has been installed.`

what i have to do ?

levlam commented 5 years ago

This error usually means that a wrong path to TDLib install directory is specified to CMake via -DTd_DIR= option. It can be a relative path instead of a full path or a typo, like was in https://github.com/tdlib/td/issues/351. Could you show the whole CMake invocation command?

nekzabirov commented 5 years ago

@levlam cmake -DCMAKE_BUILD_TYPE=Release -DTd_DIR=/Users/nekzabirov/Desktop/td-master/example/java/td/lib/cmake/Td -DCMAKE_INSTALL_PREFIX:PATH=.. ..

nekzabirov commented 5 years ago

@levlam cmake -DCMAKE_BUILD_TYPE=Release -DTd_DIR=/Users/nekzabirov/Desktop/td-master/example/java/td/lib/cmake/Td -DCMAKE_INSTALL_PREFIX:PATH=.. .. -DTd_DIR=/Users/nekzabirov/Desktop/td-master

now i have this error

`CMake Error at /Users/nekzabirov/Desktop/td-master/TdConfig.cmake:3 (include):
  include could not find load file:

    /Users/nekzabirov/Desktop/td-master/TdTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)`
levlam commented 5 years ago

@nekadevmaster The path looks fine for me. You need to remove second -DTd_DIR=/Users/nekzabirov/Desktop/td-master option.

Then it must be an error during initial TDLib build. Could you show output of initial cmake --build . --target install invocation in jnibuild directory?

nekzabirov commented 5 years ago

@levlam -- Install configuration: "Release" -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdjson.dylib -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdjson_static.a -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdjson_private.a -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdclient.a -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdcore.a -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/cmake/Td/TdTargets.cmake -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/cmake/Td/TdTargets-release.cmake -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/telegram/td_json_client.h -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/telegram/td_log.h -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/telegram/tdjson_export.h -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/telegram/Client.h -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/telegram/Log.h -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/tl/TlObject.h -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/telegram/td_api.h -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/telegram/td_api.hpp -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/include/td/tl/tl_jni_object.h -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/cmake/Td/TdConfig.cmake -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/cmake/Td/TdConfigVersion.cmake -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdutils.a -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/bin/td_generate_java_api -- Up-to-date: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/bin/td/generate/JavadocTlDocumentationGenerator.php -- Up-to-date: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/bin/td/generate/TlDocumentationGenerator.php -- Up-to-date: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/bin/td/generate/scheme/td_api.tlo -- Up-to-date: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/bin/td/generate/scheme/td_api.tl -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdactor.a -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdnet.a -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtdsqlite.a -- Installing: /Users/nekzabirov/Desktop/td-master/jnibuild/../example/java/td/lib/libtddb.a

nekzabirov commented 5 years ago

Done. just do cmake --build . --target install again for jnibuild