blob: 02ddda239c27dd4933d503a0aede5d06aa284510 [file] [log] [blame]
Alexey Polyudovd0ef67a2020-06-04 16:31:35 -07001# Copyright 2020 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15cmake_minimum_required(VERSION 3.0.2)
16
17project(ukey2)
18
19option(ukey2_USE_LOCAL_PROTOBUF
20 "Use local copy of protobuf library and compiler" OFF)
21
Alexey Polyudov65a17502020-06-16 01:29:46 -070022option(ukey2_USE_LOCAL_ABSL
23 "Use local copy of abseil-cpp library" OFF)
24
Alexey Polyudovd0ef67a2020-06-04 16:31:35 -070025include(cmake/proto_defs.cmake)
26include(cmake/local_build_setup.cmake)
27
28if (ukey2_USE_LOCAL_PROTOBUF)
29 include(cmake/local_build_protobuf.cmake)
30endif()
31
Alexey Polyudov65a17502020-06-16 01:29:46 -070032if (ukey2_USE_LOCAL_ABSL)
33 if (NOT TARGET absl::base)
34 add_subdirectory(third_party/absl)
35 endif()
36else()
37 find_package(absl REQUIRED)
38endif()
39
Alexey Polyudovd0ef67a2020-06-04 16:31:35 -070040find_package(Protobuf REQUIRED)
41
42enable_testing()
43
44add_subdirectory(src/main)
45if (NOT TARGET securemessage)
46add_subdirectory(third_party/secure_message)
47endif()
48if (NOT TARGET gtest)
49add_subdirectory(third_party/gtest)
50endif()