Phil CK

CMake - Solution Names

Last updated on

I quite often have multiple clones of a project on my drive both for work and personal projects. If I’m working on a particular issue I might do something like …

git clone my_proj issue_123

This can make the open recent button in IDE’s quite annoying. As there are multiple solutions with the same name.

So instead what I’ve started todo is base the solution name off the root dir.

get_filename_component(PROJ_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) 

project(${PROJ_NAME})

This gives me a nice list in Visual Studio and others that make a little more sense to me.