Skip to content

Commit f3dbe94

Browse files
committed
move fetchContent location
1 parent 29aa073 commit f3dbe94

File tree

4 files changed

+35
-31
lines changed

4 files changed

+35
-31
lines changed

third-party/realsense-file/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
4949
)
5050

5151
target_link_libraries(${PROJECT_NAME} PUBLIC
52-
yaml-cpp::yaml-cpp
52+
yaml-cpp
5353
SQLite3
5454
)
5555

@@ -60,7 +60,7 @@ set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Library)
6060
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/../cmake/realsense2")
6161

6262
install(TARGETS ${PROJECT_NAME}
63-
#yaml-cpp # for testing it compiles on GHA
63+
yaml-cpp
6464
EXPORT realsense2Targets
6565
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
6666
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

third-party/realsense-file/config.cmake

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,37 @@ add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/rosbag2
88
# Include rosbag2 configuration
99
#include(${ROSBAG_DIR}2/config.cmake)
1010

11+
12+
# ---- FetchContent for direct library dependencies ----
13+
include(FetchContent)
14+
15+
# yaml-cpp
16+
FetchContent_Declare(
17+
yaml-cpp
18+
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
19+
GIT_TAG a83cd31548b19d50f3f983b069dceb4f4d50756d # need any commit/tag after tag 0.8.0 - we need YAML_CPP_DISABLE_UNINSTALL flag
20+
)
21+
# Disable yaml-cpp's uninstall target
22+
set(YAML_CPP_DISABLE_UNINSTALL ON CACHE BOOL "" FORCE)
23+
24+
FetchContent_MakeAvailable(yaml-cpp)
25+
26+
# Force SQLite to export all symbols on Windows so the .lib is generated
27+
# There's probably a better way to do it but it works for now - either have the folder on the repo, or pass the flag
28+
# if there's no better way, we can and should restore the old flag
29+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
30+
31+
FetchContent_Declare(
32+
sqlite3
33+
GIT_REPOSITORY https://github.com/sjinks/sqlite3-cmake
34+
GIT_TAG v3.49.1
35+
)
36+
FetchContent_MakeAvailable(sqlite3)
37+
38+
# Reset it so it doesn't affect other libraries
39+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF) # TODO restore previous value instead of forcing OFF
40+
41+
1142
list(APPEND ROSBAG_HEADER_DIRS ${ROSBAG2_HEADER_DIRS})
1243
list(APPEND SOURCE_FILES_ROSBAG ${SOURCE_FILES_ROSBAG2})
1344
list(APPEND HEADER_FILES_ROSBAG ${HEADER_FILES_ROSBAG2})

third-party/realsense-file/rosbag2/CMakeLists.txt

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,6 @@ endif()
1414

1515
set(CMAKE_CXX_STANDARD 14)
1616

17-
# ---- FetchContent for direct library dependencies ----
18-
include(FetchContent)
19-
20-
# yaml-cpp
21-
FetchContent_Declare(
22-
yaml-cpp
23-
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
24-
GIT_TAG a83cd31548b19d50f3f983b069dceb4f4d50756d # need any commit/tag after tag 0.8.0 - we need YAML_CPP_DISABLE_UNINSTALL flag
25-
)
26-
# Disable yaml-cpp's uninstall target
27-
set(YAML_CPP_DISABLE_UNINSTALL ON CACHE BOOL "" FORCE)
28-
29-
FetchContent_MakeAvailable(yaml-cpp)
30-
31-
# Force SQLite to export all symbols on Windows so the .lib is generated
32-
# There's probably a better way to do it but it works for now - either have the folder on the repo, or pass the flag
33-
# if there's no better way, we can and should restore the old flag
34-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
35-
36-
FetchContent_Declare(
37-
sqlite3
38-
GIT_REPOSITORY https://github.com/sjinks/sqlite3-cmake
39-
GIT_TAG v3.49.1
40-
)
41-
FetchContent_MakeAvailable(sqlite3)
42-
43-
# Reset it so it doesn't affect other libraries
44-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
45-
4617
# -- zstd --
4718
file(GLOB_RECURSE ZSTD_SOURCES
4819
"${CMAKE_CURRENT_LIST_DIR}/zstd/zstd.c"

third-party/realsense-file/rosbag2/config.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ set(HEADER_FILES_ROSBAG2
2020
${HEADER_FILES_ROSBAG2_STORAGE}
2121
${HEADER_FILES_ROSBAG2_STORAGE_DEFAULT_PLUGINS}
2222
${HEADER_FILES_TINYXML2}
23+
${ZSTD_HEADERS}
2324
)
2425

2526

@@ -32,6 +33,7 @@ set(SOURCE_FILES_ROSBAG2
3233
${SOURCE_FILES_ROSBAG2_STORAGE}
3334
${SOURCE_FILES_ROSBAG2_STORAGE_DEFAULT_PLUGINS}
3435
${SOURCE_FILES_TINYXML2}
36+
${ZSTD_SOURCES}
3537
)
3638

3739
set(ROSBAG2_HEADER_DIRS

0 commit comments

Comments
 (0)