-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What * Depends on #4313 * Fixes #4207 Support and document use of CMake install. Minimal example has a switch to use `find_package`. Not rolling it out to others because it's just not as ergonomic, don't want to advertise it all that much. However, the minimal example is used in the sdk package script to test that install is in order before uploading the package script (runs locally). I manually tested the case of a rerun install depend on an arrow system install. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/4326) (if applicable) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4326) - [Docs preview](https://rerun.io/preview/78027bcbca31e62a27bdea34b563070eda817187/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/78027bcbca31e62a27bdea34b563070eda817187/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
- Loading branch information
Showing
6 changed files
with
215 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/rerun_sdkTargets.cmake") | ||
|
||
set(RERUN_LIB_DIR "${CMAKE_CURRENT_LIST_DIR}/../..") | ||
|
||
# Setup `rerun_c` (imported libraries can't be exported!) | ||
add_library(rerun_c STATIC IMPORTED GLOBAL) | ||
get_filename_component(RERUN_C_LIB_NAME @RERUN_C_LIB_LOCATION@ NAME) | ||
set_target_properties(rerun_c PROPERTIES IMPORTED_LOCATION "${RERUN_LIB_DIR}/${RERUN_C_LIB_NAME}") | ||
if(APPLE) | ||
target_link_libraries(rerun_c INTERFACE "-framework CoreFoundation" "-framework IOKit") | ||
elseif(UNIX) # if(LINUX) # CMake 3.25 | ||
target_link_libraries(rerun_c INTERFACE "-lm -ldl -pthread") | ||
elseif(WIN32) | ||
target_link_libraries(rerun_c INTERFACE ws2_32.dll Bcrypt.dll Userenv.dll ntdll.dll) | ||
endif() | ||
|
||
# Setup `rerun_arrow_target` (imported libraries can't be exported and package dependencies need to be re-declared) | ||
# if(@RERUN_DOWNLOAD_AND_BUILD_ARROW@ AND NOT @RERUN_ARROW_LINK_SHARED@) | ||
if(@RERUN_DOWNLOAD_AND_BUILD_ARROW@ AND NOT @RERUN_ARROW_LINK_SHARED@) | ||
message(STATUS "Rerun is using bundled arrow library.") | ||
|
||
add_library(rerun_arrow_target STATIC IMPORTED GLOBAL) | ||
get_filename_component(RERUN_ARROW_LIB_NAME @RERUN_ARROW_LIBRARY_FILE@ NAME) | ||
set_target_properties(rerun_arrow_target PROPERTIES IMPORTED_LOCATION "${RERUN_LIB_DIR}/${RERUN_ARROW_LIB_NAME}") | ||
|
||
# We have to explicitly opt in the arrow bundled dependencies, otherwise we're missing the symbols for mimalloc. | ||
add_library(arrow_targetBundledDeps STATIC IMPORTED) | ||
get_filename_component(RERUN_ARROW_DEPS_LIB_NAME @RERUN_ARROW_BUNDLED_DEPENDENCIES_FILE@ NAME) | ||
set_target_properties(arrow_targetBundledDeps PROPERTIES IMPORTED_LOCATION "${RERUN_LIB_DIR}/${RERUN_ARROW_DEPS_LIB_NAME}") | ||
target_link_libraries(rerun_arrow_target INTERFACE arrow_targetBundledDeps) | ||
else() | ||
if(@RERUN_ARROW_LINK_SHARED@) | ||
message(WARNING | ||
"Rerun got built with an automatically downloaded version of libArrow," | ||
"but it was not bundled as part of the install since export of shared libArrow is not supported yet." | ||
"Set RERUN_ARROW_LINK_SHARED to OFF during install or make sure find_package succeeds for Arrow." | ||
) | ||
endif() | ||
|
||
find_package(Arrow REQUIRED) | ||
|
||
message(STATUS "Rerun is using a system installed libArrow.") | ||
option(RERUN_ARROW_LINK_SHARED "Link to the Arrow shared library" @RERUN_ARROW_LINK_SHARED_DEFAULT@) | ||
|
||
if(RERUN_ARROW_LINK_SHARED) | ||
add_library(rerun_arrow_target ALIAS Arrow::arrow_shared) | ||
else() | ||
add_library(rerun_arrow_target ALIAS Arrow::arrow_static) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters