Migrating small projects
We define small projects as any project that contains only a few targets and which 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 the 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.txtfile inside the root of the projects.
- Identify the targets and associated files in the project, and create...