-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathCMakeLists.txt
55 lines (47 loc) · 1.76 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# ~~~
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ~~~
cmake_minimum_required(VERSION 3.10...3.26)
option(BUILD_TESTING "Enable tests" ON)
if (BUILD_TESTING)
list(APPEND VCPKG_MANIFEST_FEATURES "tests")
endif ()
option(FUNCTIONS_FRAMEWORK_CPP_TEST_EXAMPLES "Enable testing for examples" ON)
mark_as_advanced(FUNCTIONS_FRAMEWORK_CPP_TEST_EXAMPLES)
if (FUNCTIONS_FRAMEWORK_CPP_TEST_EXAMPLES)
list(APPEND VCPKG_MANIFEST_FEATURES "examples")
endif ()
set(PACKAGE_BUGREPORT
"http://github.com/GoogleCloudPlatform/functions-framework-cpp")
project(
functions-framework-cpp
VERSION 1.3.0
DESCRIPTION "Functions Framework for C++"
LANGUAGES CXX)
# Configure the compiler options, we will be using C++17 features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
if (VCPKG_TARGET_TRIPLET MATCHES "-static$")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
else ()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif ()
include(CTest)
include(FunctionsFrameworkCppHelpers)
add_subdirectory(google/cloud/functions)
if (BUILD_TESTING AND FUNCTIONS_FRAMEWORK_CPP_TEST_EXAMPLES)
add_subdirectory(examples)
endif ()