diff options
author | Tink Team <tink-dev@google.com> | 2019-03-19 08:37:20 -0700 |
---|---|---|
committer | Tink Team <noreply@google.com> | 2019-03-20 11:40:44 -0400 |
commit | c3ef5a791cccff0334da45aa92b7aea3df3a35b9 (patch) | |
tree | 6a224fa1b7a7573f96acc477edab77cabfb22117 | |
parent | 352147898b85a4e17c46c9e4a7d3d8a39a2939a3 (diff) | |
download | tink-c3ef5a791cccff0334da45aa92b7aea3df3a35b9.tar.gz |
Organize Tink CMake targets into folders for IDEs that support them.
PiperOrigin-RevId: 239196179
GitOrigin-RevId: 8fd030372e78c13ca4535cf25b2c41fd7af4304a
-rw-r--r-- | cmake/TinkBuildRules.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/TinkBuildRules.cmake b/cmake/TinkBuildRules.cmake index d540a7747..59af78871 100644 --- a/cmake/TinkBuildRules.cmake +++ b/cmake/TinkBuildRules.cmake @@ -51,6 +51,8 @@ endif() list(APPEND TINK_INCLUDE_DIRS "${TINK_GENFILE_DIR}") +set(TINK_IDE_FOLDER "Tink") + # Declare the beginning of a new Tink library namespace. # # As a rule of thumb, every CMakeLists.txt should be a different module, named @@ -121,6 +123,13 @@ function(tink_cc_library) target_link_libraries(${_target_name} PUBLIC ${tink_cc_library_DEPS}) set_property(TARGET ${_target_name} PROPERTY CXX_STANDARD ${TINK_CXX_STANDARD}) set_property(TARGET ${_target_name} PROPERTY CXX_STANDARD_REQUIRED true) + if (tink_cc_library_PUBLIC) + set_property(TARGET ${_target_name} + PROPERTY FOLDER "${TINK_IDE_FOLDER}") + else() + set_property(TARGET ${_target_name} + PROPERTY FOLDER "${TINK_IDE_FOLDER}/Internal") + endif() else() add_library(${_target_name} INTERFACE) target_include_directories(${_target_name} INTERFACE ${TINK_INCLUDE_DIRS}) @@ -168,6 +177,9 @@ function(tink_cc_test) ${tink_cc_test_DEPS} ) + set_property(TARGET ${_target_name} + PROPERTY FOLDER "${TINK_IDE_FOLDER}/Tests") + if (${CMAKE_VERSION} VERSION_LESS 3.10) gtest_add_tests(TARGET ${_target_name}) else() |