diff options
author | Tink Team <tink-dev@google.com> | 2019-03-28 03:35:29 -0700 |
---|---|---|
committer | Charles Lee <ckl@google.com> | 2019-05-02 00:33:33 -0700 |
commit | d259176cd4e460f6d0682a02ee5f0cddecd321e6 (patch) | |
tree | 4eb70dcc85d59d758d9a342500e2c58857f74a03 /CMakeLists.txt | |
parent | 0e8585f951c43bd834579c20dfa0b091e3e43bd0 (diff) | |
download | tink-d259176cd4e460f6d0682a02ee5f0cddecd321e6.tar.gz |
Simplify CMake dependencies for the example project.
PiperOrigin-RevId: 240743681
GitOrigin-RevId: 0a954e59e277c7dcc323503361dd40f8a7884086
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5978aa364..db48ab696 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,32 +50,30 @@ list(APPEND TINK_INCLUDE_DIRS "${TINK_INCLUDE_ALIAS_DIR}") add_subdirectory(cc) add_subdirectory(proto) -install(FILES README.md LICENSE DESTINATION "share/doc/tink") +if (TINK_BUILD_SHARED_LIB) + install(FILES README.md LICENSE DESTINATION "share/doc/tink") -# The trailing slash in a directory name is used to strip it from the paths -# being installed. Do not add or remove it just for style reasons. -install( - DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}/cc/" - "${TINK_GENFILE_DIR}/tink/" - "${TINK_GENFILE_DIR}/proto" - DESTINATION "include/tink" - FILES_MATCHING PATTERN "*.h" -) + # The trailing slash in a directory name is used to strip it from the paths + # being installed. Do not add or remove it just for style reasons. + install( + DIRECTORY + "${CMAKE_CURRENT_SOURCE_DIR}/cc/" + "${TINK_GENFILE_DIR}/tink/" + "${TINK_GENFILE_DIR}/proto" + DESTINATION "include/tink" + FILES_MATCHING PATTERN "*.h" + ) -# Bundle Abseil and BoringSSL headers with Tink. -install( - DIRECTORY - "${com_google_absl_SOURCE_DIR}/absl" - "${com_google_protobuf_SOURCE_DIR}/src/google" - DESTINATION "include" - FILES_MATCHING - REGEX "\\.(h|inc)$" - PATTERN "testdata" EXCLUDE -) + # Bundle Abseil and BoringSSL headers with Tink. + install( + DIRECTORY + "${com_google_absl_SOURCE_DIR}/absl" + "${com_google_protobuf_SOURCE_DIR}/src/google" + DESTINATION "include" + FILES_MATCHING + REGEX "\\.(h|inc)$" + PATTERN "testdata" EXCLUDE + ) -# At the moment we only mark libtink for export, so we need to wrap this in a -# if(). Otherwise we get error when TINK_BUILD_SHARED_LIB is OFF. -if (TINK_BUILD_SHARED_LIB) export(EXPORT Tink FILE TinkConfig.cmake) endif() |