CMake: make the project compatible with building as a subproject