Revision 2d8799b9dfc1a2288f5c256cbd176e377ba9c885 authored by ckl on 26 May 2021, 13:41:17 UTC, committed by Charles Lee on 09 July 2021, 20:46:45 UTC
PiperOrigin-RevId: 375930429
(cherry picked from commit 5e109a01376c7ca307a546d58ab7a4a195c59205)
1 parent 91d941a
Raw File
CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(Tink CXX)

# Deviate from the naming convention for consistency with tink_version.bzl.
include(tink_version.cmake)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

option(TINK_BUILD_TESTS "Build Tink tests" OFF)

set(CPACK_GENERATOR TGZ)
set(CPACK_PACKAGE_VERSION ${TINK_VERSION_LABEL})

include(CPack)
include(TinkWorkspace)
include(TinkBuildRules)
include(TinkUtil)

# Bazel rewrites import paths so that "cc/example/foo.h" can be included as
# "tink/example/foo.h". The following lines simulate this behaviour by creating
# a symlink to cc/ called tink/, and placing it in a separate subdirectory,
# which is then specified as a global include path.
#
# It's important to create a separate directory and not just drop the link in
# CMAKE_CURRENT_BINARY_DIR, since adding that to the include paths will
# make the whole contents of that directory visible to the compiled files,
# which may result in undeclared dependencies that nevertheless happen to work.
#
set(TINK_INCLUDE_ALIAS_DIR "${CMAKE_CURRENT_BINARY_DIR}/__include_alias")
add_directory_alias(
  "${CMAKE_CURRENT_SOURCE_DIR}/cc" "${TINK_INCLUDE_ALIAS_DIR}/tink")
list(APPEND TINK_INCLUDE_DIRS "${TINK_INCLUDE_ALIAS_DIR}")

add_subdirectory(cc)
add_subdirectory(proto)
back to top