Bungles
Bungles

Reputation: 2257

How to find AGDK GameTextInput package in CMakeLists?

I'm trying to follow the instructions here for integrating GameTextInput from the AGDK (Android Game Development Kit), but am having trouble with the CMakeLists part.

Adding this line as instructed:

find_package(game-text-input REQUIRED CONFIG)

Results in this error when the project syncs.

CMake Error at CMakeLists.txt:14 (find_package):
Could not find a package configuration file provided by "game-text-input"
with any of the following names:

There are no names printed. Above is the ONLY output.

I don't know what filename it's looking for, nor where it's looking. Do I need to manually install something or is it supposed to automatically work?

Upvotes: 0

Views: 209

Answers (1)

Gerry
Gerry

Reputation: 1233

probably something is missed. Try with the steps in the instruction:

  1. enable prefab in your build
    *) in gradle.properties, ensure the followings are there:
     android.enableJetifier=true
     android.useAndroidX=true
     # optional: pick the latest prefab version at https://github.com/google/prefab/releases/
     android.prefabVersion=2.0.0
    
    *) enable prefab in you module gradle file(app/build.gradle)
      android {
          buildFeatures {
             prefab true
          }
          ...
      }
    
    • add the the latest game-text-input into the dependencies in the same app/build.gradle file:
          implementation "androidx.games:games-text-input:1.1.2-alpha01"
      
      
  2. C++ source code & static lib releases are packed inside the AAR's module include directory. Add them into your build system, for CMakeLists.txt:
        find_package(game-text-input REQUIRED CONFIG)
        target_link_libraries(${PROJECT_NAME}
            # other libs
            game-text-input::game-text-input
            android log)
    
  3. Do a build with Android Studio and it should go through. Then double check a couple of related places in terminal(you can map to windows' locations):
     cd $your-project-dir/app/.cxx
     find .  | grep game-text-inputConfig.cmake
     # open one of the found cmake config files to observe, no need to change
     cd ~/.gradle/caches
     find .  | grep game-text-input
     # go to the directory find out above, and observe the contents, might be in:
     # ~/.gradle/caches/transforms-3/3b2fce467ba34a9f9822795f41da04ae/transformed/jetified-games-text-input-1.1.2-alpha01/prefab
     # you can see the source file release and also the static lib release modules there.
    
  4. Follow the instructions to integrate C++ source files to your project.

Upvotes: 0

Related Questions