forked from meekrosoft/fff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
34 lines (27 loc) · 842 Bytes
/
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
# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
project(fff)
set(CMAKE_CXX_STANDARD 11)
# Add the gtest library which will be used below
add_subdirectory(gtest)
# Enable ctest
enable_testing()
# Generate fff.h if fakegen.rb changed
add_custom_command(
OUTPUT
${CMAKE_CURRENT_LIST_DIR}/fff.h
COMMAND
ruby ${CMAKE_CURRENT_LIST_DIR}/fakegen.rb >> ${CMAKE_CURRENT_LIST_DIR}/fff.h
DEPENDS
${CMAKE_CURRENT_LIST_DIR}/fakegen.rb
${CMAKE_CURRENT_LIST_DIR}/LICENSE
)
add_custom_target(fff_h DEPENDS ${CMAKE_CURRENT_LIST_DIR}/fff.h)
# Add an interface library for fff.h
add_library(fff INTERFACE)
add_dependencies(fff fff_h)
target_include_directories(fff INTERFACE ${CMAKE_CURRENT_LIST_DIR})
# Add tests and samples
add_subdirectory(test)
add_subdirectory(examples)