Reputation: 347
Let's say I have a folder structure like:
CMakeLists.txt
/ProjThatShouldProduceLib/CMakeLists.txt
/ProjThatUsesLibShouldProduceExe/CMakeLists.txt
/AnotherProjThatUsesLibShouldProduceExe/CMakeLists.txt
How do I get the root CMakeLists.txt
to produce a visual studio .sln
that contains all the other directories as projects?
Upvotes: 0
Views: 118
Reputation: 20046
Very simple:
cmake_minimum_required(VERSION 3.22)
project(proj)
add_subdirectory(ProjThatShouldProduceLib)
add_subdirectory(ProjThatUsesLibShouldProduceExe)
add_subdirectory(AnotherProjThatUsesLibShouldProduceExe)
Upvotes: 1