Alexey Polyudov | e7b6988 | 2020-06-04 16:00:11 -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(securemessage) |
| 18 | |
| 19 | option(securemessage_USE_LOCAL_PROTOBUF |
| 20 | "Use local copy of protobuf library and compiler" OFF) |
| 21 | |
suetfei | 4142f47 | 2022-02-11 00:17:45 -0800 | [diff] [blame] | 22 | # Do not install gtest since we are embedding googletest. |
| 23 | option(INSTALL_GTEST "Do not install gtest since we are embedding googletest" OFF) |
| 24 | option(BYPASS_TESTING "Do not build or run tests" OFF) |
| 25 | |
Alexey Polyudov | e7b6988 | 2020-06-04 16:00:11 -0700 | [diff] [blame] | 26 | include(cmake/proto_defs.cmake) |
| 27 | include(cmake/local_build_setup.cmake) |
| 28 | |
| 29 | if (securemessage_USE_LOCAL_PROTOBUF) |
| 30 | include(cmake/local_build_protobuf.cmake) |
| 31 | endif() |
| 32 | |
| 33 | find_package(Protobuf REQUIRED) |
| 34 | find_package(OpenSSL REQUIRED) |
| 35 | |
| 36 | enable_testing() |
| 37 | |
| 38 | add_subdirectory(cpp) |
| 39 | add_subdirectory(proto) |
suetfei | 4142f47 | 2022-02-11 00:17:45 -0800 | [diff] [blame] | 40 | |
| 41 | if (NOT BYPASS_TESTING) |
| 42 | if (NOT TARGET gtest) |
| 43 | add_subdirectory(third_party/gtest) |
| 44 | endif() |
Alexey Polyudov | e7b6988 | 2020-06-04 16:00:11 -0700 | [diff] [blame] | 45 | endif() |
suetfei | 4142f47 | 2022-02-11 00:17:45 -0800 | [diff] [blame] | 46 | |