cmake will compile source files into object files first and link them by linker, so you need to add -stack-size option to linker option. (When you run eosio-cpp in command-line, passing -stack-size to compile options is allowed, because eosio-cpp will pass linker options to eosio-ld)
add_contract(test test test.cpp)
target_link_options(test PUBLIC -stack-...
a few things to consider:
it is not advisable to compile on your servers. you need tbe full blown dev environment to be set up correctly (all dependencies) in order to compile successfuly; when eosio-ccp was reported as hanging in the past it was because there was some dependencies missing or not version aligned (clang, submodules, etc). if you try to ...
If you want to build a single contract with eosio.cdt you would need to modify the code.
Just use the build-script build.sh (located in the eosio.contracts-directory) to compile all system-contracts at once, without the need to modify any of them.
I wasn't getting an abi file, but it was compiling fine.
I finally noticed that I had the file named: widgets.cpp but the class was widget. Watch out for missing "S"s.
Ran again and the abi file appeared.