Alexey Polyudov | d0ef67a | 2020-06-04 16:31:35 -0700 | [diff] [blame] | 1 | # 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 | |
| 15 | cmake_minimum_required(VERSION 3.0.2) |
| 16 | |
| 17 | project(ukey2) |
| 18 | |
| 19 | option(ukey2_USE_LOCAL_PROTOBUF |
| 20 | "Use local copy of protobuf library and compiler" OFF) |
| 21 | |
Alexey Polyudov | 65a1750 | 2020-06-16 01:29:46 -0700 | [diff] [blame] | 22 | option(ukey2_USE_LOCAL_ABSL |
| 23 | "Use local copy of abseil-cpp library" OFF) |
| 24 | |
Alexey Polyudov | d0ef67a | 2020-06-04 16:31:35 -0700 | [diff] [blame] | 25 | include(cmake/proto_defs.cmake) |
| 26 | include(cmake/local_build_setup.cmake) |
| 27 | |
| 28 | if (ukey2_USE_LOCAL_PROTOBUF) |
| 29 | include(cmake/local_build_protobuf.cmake) |
| 30 | endif() |
| 31 | |
Alexey Polyudov | 65a1750 | 2020-06-16 01:29:46 -0700 | [diff] [blame] | 32 | if (ukey2_USE_LOCAL_ABSL) |
| 33 | if (NOT TARGET absl::base) |
| 34 | add_subdirectory(third_party/absl) |
| 35 | endif() |
| 36 | else() |
| 37 | find_package(absl REQUIRED) |
| 38 | endif() |
| 39 | |
Alexey Polyudov | d0ef67a | 2020-06-04 16:31:35 -0700 | [diff] [blame] | 40 | find_package(Protobuf REQUIRED) |
| 41 | |
| 42 | enable_testing() |
| 43 | |
| 44 | add_subdirectory(src/main) |
| 45 | if (NOT TARGET securemessage) |
| 46 | add_subdirectory(third_party/secure_message) |
| 47 | endif() |
| 48 | if (NOT TARGET gtest) |
| 49 | add_subdirectory(third_party/gtest) |
| 50 | endif() |