Improve avoiding C++ linkage, definition creation and cmake tests (#710)

6 files changed