@sleve_mcdichael said in Is there a guide somewhere to create install scripts if you can get a game to compile?:
What is the significance of the CMakeLists.txt param in ...
The correct way to invoke cmake is
cmake <PARAMS> <path_to_folder_containing_CMakeLists.txt>`
... the && cd build part didn't do anything, so it tried to cmake & make from the wrong dir and, predictably, failed.
Don't use && then, just have the 2 commands separately.
.. this one just built it right there in the main tmp/build/module folder. Do I want to leave it in or out? Does it make a difference?
No, but some programs enforce a separate build folder (out-of-tree build) so you may get an error when building directly in the source folder.
Also, it still made the same file, but it put it in the wrong place. So if I were to use retropie_packages.sh <module> install after this, it would be installing the old one from the "build" dir and not the new one I just built in the wrong place, so this isn't a solution.
If you change the build parameters, then do a cleanup first.
I think I could begin the build function with a [[ -d build ]] && rm -rf build to remove the dir if it exists?
I don't think that when building with cmake this step is necessary, so that's why is not enforced. This is an issue only when repeatedly re-building without cleaning up, so it's more of an artifact of re-trying the build with a 'dirty' state.
You should first compile the program separately - not as a scriptmodule - to get the cmake build options right, then add it to the build function and try it from retropie_packages.sh.