mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 23:19:58 -06:00
Add CMAKE_FOLDER variable to initialize FOLDER target property
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}")
This commit is contained in:
@@ -305,6 +305,7 @@ Variables that Control the Build
|
||||
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
|
||||
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT
|
||||
/variable/CMAKE_EXE_LINKER_FLAGS_INIT
|
||||
/variable/CMAKE_FOLDER
|
||||
/variable/CMAKE_Fortran_FORMAT
|
||||
/variable/CMAKE_Fortran_MODULE_DIRECTORY
|
||||
/variable/CMAKE_GNUtoMS
|
||||
|
||||
@@ -8,3 +8,6 @@ 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.
|
||||
|
||||
5
Help/release/dev/variable-CMAKE_FOLDER.rst
Normal file
5
Help/release/dev/variable-CMAKE_FOLDER.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
variable-CMAKE_FOLDER
|
||||
---------------------
|
||||
|
||||
* The :variable:`CMAKE_FOLDER` variable was added to initialize the
|
||||
:prop_tgt:`FOLDER` property on all targets.
|
||||
7
Help/variable/CMAKE_FOLDER.rst
Normal file
7
Help/variable/CMAKE_FOLDER.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
CMAKE_FOLDER
|
||||
------------
|
||||
|
||||
Set the folder name. Use to organize targets in an IDE.
|
||||
|
||||
This variable is used to initialize the :prop_tgt:`FOLDER` property on all the
|
||||
targets. See that target property for additional information.
|
||||
@@ -275,6 +275,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
this->SetPropertyDefault("CUDA_SEPARABLE_COMPILATION", nullptr);
|
||||
this->SetPropertyDefault("LINK_SEARCH_START_STATIC", nullptr);
|
||||
this->SetPropertyDefault("LINK_SEARCH_END_STATIC", nullptr);
|
||||
this->SetPropertyDefault("FOLDER", nullptr);
|
||||
}
|
||||
|
||||
// Collect the set of configuration types.
|
||||
|
||||
Reference in New Issue
Block a user