Skip to content
Snippets Groups Projects
Commit 950be290 authored by Petter Strandmark's avatar Petter Strandmark
Browse files

Set the FOLDER property for Abseil targets.

https://cmake.org/cmake/help/v3.0/prop_tgt/FOLDER.html
This only affects IDEs and will further only take effect if
  set_property(GLOBAL PROPERTY USE_FOLDERS ON)
is set in the main CMakeLists.txt of the project.

I found using this quite helpful when adding Abseil to larger CMake
projects.
parent 26b789f9
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,8 @@ function(absl_library)
PUBLIC ${ABSL_COMMON_INCLUDE_DIRS} ${ABSL_LIB_PUBLIC_INCLUDE_DIRS}
PRIVATE ${ABSL_LIB_PRIVATE_INCLUDE_DIRS}
)
# Add all Abseil targets to a a folder in the IDE for organization.
set_property(TARGET ${_NAME} PROPERTY FOLDER Abseil)
if(ABSL_LIB_EXPORT_NAME)
add_library(absl::${ABSL_LIB_EXPORT_NAME} ALIAS ${_NAME})
......@@ -92,6 +94,8 @@ function(absl_header_library)
PUBLIC ${ABSL_COMMON_INCLUDE_DIRS} ${ABSL_HO_LIB_PUBLIC_INCLUDE_DIRS}
PRIVATE ${ABSL_HO_LIB_PRIVATE_INCLUDE_DIRS}
)
# Add all Abseil targets to a a folder in the IDE for organization.
set_property(TARGET ${_NAME} PROPERTY FOLDER Abseil)
if(ABSL_HO_LIB_EXPORT_NAME)
add_library(absl::${ABSL_HO_LIB_EXPORT_NAME} ALIAS ${_NAME})
......@@ -138,6 +142,8 @@ function(absl_test)
PUBLIC ${ABSL_COMMON_INCLUDE_DIRS} ${ABSL_TEST_PUBLIC_INCLUDE_DIRS}
PRIVATE ${GMOCK_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
)
# Add all Abseil targets to a a folder in the IDE for organization.
set_property(TARGET ${_NAME}_bin PROPERTY FOLDER Abseil)
add_test(${_NAME} ${_NAME}_bin)
endif(BUILD_TESTING)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment