Skip to content

Commit 4d8af1a

Browse files
traversaroWumpf
andauthored
Support finding rerun_sdk via find_package (#23)
Co-authored-by: Andreas Reich <[email protected]>
1 parent 5a1273e commit 4d8af1a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
88
set(CMAKE_CXX_STANDARD 17)
99
endif()
1010

11-
include(FetchContent)
12-
FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/0.15.1/rerun_cpp_sdk.zip)
13-
FetchContent_MakeAvailable(rerun_sdk)
11+
set(RERUN_CPP_URL "https://github.com/rerun-io/rerun/releases/download/0.15.1/rerun_cpp_sdk.zip" CACHE STRING "URL to the rerun_cpp zip.")
12+
option(RERUN_FIND_PACKAGE "Whether to use find_package to find a preinstalled rerun package (instead of using FetchContent)." OFF)
13+
14+
if(RERUN_FIND_PACKAGE)
15+
find_package(rerun_sdk REQUIRED)
16+
else()
17+
# Download the rerun_sdk
18+
include(FetchContent)
19+
FetchContent_Declare(rerun_sdk URL ${RERUN_CPP_URL})
20+
FetchContent_MakeAvailable(rerun_sdk)
21+
endif()
1422

1523
find_package(Eigen3 REQUIRED)
1624
find_package(OpenCV REQUIRED)

0 commit comments

Comments
 (0)