Skip to content

Commit

Permalink
Organize Tink CMake targets into folders for IDEs that support them.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 239196179
GitOrigin-RevId: 8fd030372e78c13ca4535cf25b2c41fd7af4304a
  • Loading branch information
ise-crypto authored and Tink Team committed Mar 20, 2019
1 parent 3521478 commit c3ef5a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmake/TinkBuildRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit c3ef5a7

Please sign in to comment.