I have a library that I need to add to the game, and while I have it working using a VS project file for Win32 and Android.mk (LOCAL_STATIC_LIBRARIES += mylib_static) for Android, I’m not quite sure how to add it the the new CMake build process in Cocos2d-x 3.17.
Would anyone be able to provide an example of how to add an external library to the game using the CMake build process?
The external library is my own, so I have full source code with it’s own CMakeLists.txt file. I can build it on it’s own perfectly fine using CMake, but I’m not sure how to include it in the game build process, or how to link the library.
I have almost no experience with CMake, and while I’ve made some attempts, I can’t seem to figure out how to do it. Looking through the CMakeLists.txt and .cmake files in the modules folder just caused more confusion, so I really would appreciate any help.
EDIT: I think I got it working, but any example of the correct way to do it would still be great in case the way I’ve set it up is not optimal.