abseil-cpp icon indicating copy to clipboard operation
abseil-cpp copied to clipboard

cmake visual studio source_group

Open f00kat opened this issue 3 years ago • 1 comments

Hi. I added abseil in my project using add_subdirectory(third_party/abseil-cpp). But now there are a lot of abseil projects in my solution and it's hard to find my owns. Is there are a method(like soure_group()) to move abseil projects to the folder using cmake?

f00kat avatar Dec 14 '21 11:12 f00kat

To enable IDE folders in CMake, you need to set USE_FOLDERS global property first:

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

Then you normally have to set CMAKE_FOLDER before adding a subdirectory:

set(CMAKE_FOLDER third_party/gtest)
add_subdirectory(googletest)

For Abseil, you have to set ABSL_IDE_FOLDER variable instead:

set(ABSL_IDE_FOLDER third_party/abseil)
add_subdirectory(abseil-cpp)

anpol avatar Jan 08 '22 20:01 anpol