Modernize CMake scripts
Though we have made an effort to write newer CMake scripts using "Modern CMake" (i.e. using targets), there are still some scripts that are still using old-style CMake (notably the main CMakeLists.txt). We should make an effort to modernize the remaining scripts to simplify maintenance.