taichi-dev / taichi-unity2

Apache License 2.0
22 stars 6 forks source link

CMake Error #13

Open sarahhaha opened 1 year ago

sarahhaha commented 1 year ago

I am trying to build with cmake .. -DTAICHI_C_API_INSTALL_DIR="$env:TAICHI_REPO_DIR/build", but I am getting the following error.

CMake Error at CMakeLists.txt:50 (target_link_libraries): Target "taichi_unity" links to:

Taichi::Runtime

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

I have tried with CMake Integration in VisualStudio 2022 as well but I'm still getting the same error. Is there anything I can look into?

PENGUINLIONG commented 1 year ago

I wonder how you built Taichi? If you installed Taichi with setup.py you should find the C-API installation in something like _skbuild/macosx-13.0-arm64-3.10/cmake-install/c_api and that's TAICHI_C_API_INSTALL_DIR.

sarahhaha commented 1 year ago

I don't exactly recall how I built taichi, but I have set TAICHI_C_API_INSTALL_DIR to be something like .../taichi/c_api but I am still getting the same error. I have also tried running FindTaichi.cmake and it seems like it finds Taichi Runtime but Taichi_Runtime_Library is still missing. Do I need to rebuild taichi_c_api and set it as a cache variable for this?

PENGUINLIONG commented 1 year ago

I guess you built Taichi Runtime with msbuild or something alike. FindTaichi.cmake currently doesn't support multiconfig build system. Try ninja build in stead