-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
58 lines (50 loc) · 1.63 KB
/
Copy pathCMakeLists.txt
File metadata and controls
58 lines (50 loc) · 1.63 KB
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
56
57
58
#[[
Copyright (c) 2026 Edward Boggis-Rolfe
All rights reserved.
]]
cmake_minimum_required(VERSION 3.24)
project(
canopy_json
VERSION 1.0.0
LANGUAGES C CXX)
# Record the CanopyJson source root so subdirectory CMakeLists.txt files can
# reference sibling directories correctly even when consumed via add_subdirectory().
set(CANOPY_JSON_SOURCE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}"
CACHE INTERNAL "Root of the CanopyJson source tree")
option(CANOPY_JSON_BUILD_TEST "Build CanopyJson tests" OFF)
if("${CMAKE_CURRENT_SOURCE_DIR}" PATH_EQUAL "${CMAKE_SOURCE_DIR}")
# Standalone build: pull in Canopy and configure output directories.
# CANOPY_BUILD_TEST must be ON when our tests are enabled so that Canopy
# builds googletest (GTest::gtest_main) which our test targets depend on.
set(CANOPY_BUILD_TEST
OFF
CACHE BOOL "" FORCE)
# CANOPY_BUILD_GTEST enables googletest without pulling in all of Canopy's own tests.
if(CANOPY_JSON_BUILD_TEST)
set(CANOPY_BUILD_GTEST
ON
CACHE BOOL "" FORCE)
else()
set(CANOPY_BUILD_GTEST
OFF
CACHE BOOL "" FORCE)
endif()
set(CANOPY_BUILD_DEMOS
OFF
CACHE BOOL "" FORCE)
set(CANOPY_BUILD_BENCHMARKING
OFF
CACHE BOOL "" FORCE)
set(CANOPY_BUILD_COROUTINE
OFF
CACHE BOOL "" FORCE)
add_subdirectory(../Canopy canopy_build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
endif()
add_subdirectory(interface)
if(CANOPY_JSON_BUILD_TEST)
add_subdirectory(c++/tests)
endif()