Currently, I use these steps to compile my own versions of OpenXCom (sometimes Extended, sometimes normal, sometimes old versions for some mods, sometimes patched versions with extra features, etc. So I'll leave out the git stuff).
0. make installation directory (called "srcdir" in these notes)
1. git clone git@github.com:SupSuper/OpenXcom.git srcdir
2. {copy XCOM1 assets into srcdir/bin/data}
2* For new data structure: cp -rp ../PatchedData/* srcdir/bin/UFO
3. mkdir srcdir/build
4. cd srcdir/build
5. cmake ..
6. ccmake ..
7. {set CMAKE_BUILD_TYPE to Release (or Debug if you want useful stack traces)}
8. {set CMAKE_INSTALL_PREFIX to /home/yourusername/bin/OpenXcom (or wherever you want OpenXCom to be installed: /home/jpaucl/XCom/OpenXCom/ThisBuild)}
9. {set DATADIR to define folder in which OpenXCom will look for the data subfolder}
10. {configure, generate, and exit}
11. make -j3
12. make install
I think there is a method to make that into a script that will take care of most things, but I don't remember how to replace the definition of build type, prefix and datadir in a script.
Another thing is, as soon as I change a little thing (say add a few lines in one of the .cpp files), the "make -j3" command will recompile the whole thing (which takes forever on my crappy laptop), but that is quite unlike other makefiles I have seen, which only recompile the files that changed. What am I doing wrong?