-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Describe the bug
A prefab with a mixed casing name like name: "AwesomeSDK" in the prefab.json is triggering CMake errors when trying to find the module (in an Android Gradle + CMake project).
To Reproduce
Steps to reproduce the behavior:
- In a prefab.json, enter a name like
name: "AwesomeSDK" - Build the AAR in a folder, named
awesomesdk.aar. - In your Android project root
build.gradle, add a local repository to find your prefab. For example:
allprojects { repositories { flatDir { dirs '/usr/path/to/awesomesdk' } ... } } - In your Android project app
build.gradle, reference the AAR:implementation(name: 'awesomesdk', ext:'aar') - In your Android app
CMakeLists.txt, addfind_package(AwesomeSDK REQUIRED CONFIG)
Expected behavior
CMake should work without errors.
Instead, CMake complains about not being able to find the module:
/usr/path/to/project/app/CMakeLists.txt : C/C++ debug|armeabi-v7a : CMake Error at /usr/path/to/project/app/CMakeLists.txt:15 (find_package):
Could not find a package configuration file provided by "AwesomeSDK" with any
of the following names:
AwesomeSDKConfig.cmake
awesomesdk-config.cmake
Add the installation prefix of "AwesomeSDK" to CMAKE_PREFIX_PATH or set
"AwesomeSDK_DIR" to a directory containing one of the above files. If
"AwesomeSDK" provides a separate development package or SDK, be sure it has
been installed.
Taking a look at the generated file, I found it is called out/cmake/debug/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/AwesomeSDK/AwesomeSDK-config.cmake
Environment:
Prefab version: 1.0.0 (a --version or outputting the version number in --help would be helpful btw ;))
Host OS: Linux
Target platform: Android
Target ABI: armeabi-v7a
Target OS version: API level 21+
Build system: Gradle + CMake
Additional context
I worked around the issue by changing the name: "awesomesdk" (all lowercase) and referencing it as "awesomesdk" in CMake. Not sure if this is normal.