Migrating small projects
We define small projects as any projects that contain only a few targets that are usually all deployed together. Small projects are self-contained inside a single repository, and usually, you can get a relatively quick overview of them. These might be projects that build a single library or an executable with a few external dependencies. In these cases, migrating to CMake is often relatively trivial. For small projects, in the first iteration, putting everything inside a single file will probably be the easiest way to go for a relatively quick and early result. Rearranging files and splitting up the CMakeLists.txt
file into multiple parts to be used with add_subdirectory()
is much easier if the project has already been built correctly.
A general approach for migrating to CMake could be the following:
- Create an empty
CMakeLists.txt
file inside the root of the project. - Identify the targets and associated files in the project and create the appropriate...