mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
This can be used for example to organize all following targets into one
Visual Studio folder:
set(CMAKE_FOLDER Libraries)
add_subdirectory(libA)
add_subdirectory(libB)
set(CMAKE_FOLDER Executables)
add_subdirectory(progA)
Another possibility is using the current directory name for all
following targets in subdirectories:
get_filename_component(dirname "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
string(APPEND CMAKE_FOLDER "/${dirname}")
14 lines
495 B
ReStructuredText
14 lines
495 B
ReStructuredText
FOLDER
|
|
------
|
|
|
|
Set the folder name. Use to organize targets in an IDE.
|
|
|
|
Targets with no FOLDER property will appear as top level entities in
|
|
IDEs like Visual Studio. Targets with the same FOLDER property value
|
|
will appear next to each other in a folder of that name. To nest
|
|
folders, use FOLDER values such as 'GUI/Dialogs' with '/' characters
|
|
separating folder levels.
|
|
|
|
This property is initialized by the value of the variable
|
|
:variable:`CMAKE_FOLDER` if it is set when a target is created.
|