Example that builds an executable (editor) and links a library (highlight) to it. Project structure is straightforward, it needs a master CMakeLists and a directory for each subproject:
CMakeLists.txt
editor/
CMakeLists.txt
src/
editor.cpp
highlight/
CMakeLists.txt
in...