forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request microsoft#7695 from longhuan2018/Fix-osgearth-with…
…-rocksdbrocksdb(lz4,snappy,zlib,tbb,zstd)-failed [osgearth]Fix osgearth rocksdb plugin build falied
- Loading branch information
Showing
3 changed files
with
89 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Source: osgearth | ||
Version: 2.10.1 | ||
Version: 2.10.2 | ||
Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping. | ||
Build-Depends: osg |
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,84 @@ | ||
diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake | ||
index 109b383..8382ed9 100644 | ||
--- a/CMakeModules/FindRocksDB.cmake | ||
+++ b/CMakeModules/FindRocksDB.cmake | ||
@@ -40,5 +40,49 @@ find_package_handle_standard_args(ROCKSDB | ||
"Could NOT find ROCKSDB" | ||
) | ||
|
||
+if(ROCKSDB_FOUND) | ||
+ FIND_PACKAGE(ZLIB REQUIRED) | ||
+ | ||
+ include(SelectLibraryConfigurations) | ||
+ # Find Snappy library | ||
+ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) | ||
+ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) | ||
+ select_library_configurations(SNAPPY) | ||
+ find_package_handle_standard_args(SNAPPY | ||
+ FOUND_VAR | ||
+ SNAPPY_FOUND | ||
+ REQUIRED_VARS | ||
+ SNAPPY_LIBRARY | ||
+ FAIL_MESSAGE | ||
+ "Could NOT find SNAPPY" | ||
+ ) | ||
+ | ||
+ # Find LZ4 library | ||
+ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) | ||
+ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) | ||
+ select_library_configurations(LZ4) | ||
+ find_package_handle_standard_args(LZ4 | ||
+ FOUND_VAR | ||
+ LZ4_FOUND | ||
+ REQUIRED_VARS | ||
+ LZ4_LIBRARY | ||
+ FAIL_MESSAGE | ||
+ "Could NOT find LZ4" | ||
+ ) | ||
+ | ||
+ # Find ZSTD library | ||
+ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) | ||
+ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) | ||
+ select_library_configurations(ZSTD) | ||
+ find_package_handle_standard_args(ZSTD | ||
+ FOUND_VAR | ||
+ ZSTD_FOUND | ||
+ REQUIRED_VARS | ||
+ ZSTD_LIBRARY | ||
+ FAIL_MESSAGE | ||
+ "Could NOT find ZSTD_" | ||
+ ) | ||
+endif(ROCKSDB_FOUND) | ||
+ | ||
set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) | ||
set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) | ||
- | ||
- | ||
|
||
diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt | ||
index 68ad85d..86bb18a 100644 | ||
--- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt | ||
+++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt | ||
@@ -16,7 +16,19 @@ SET(TARGET_SRC | ||
RocksDBCacheDriver.cpp | ||
) | ||
|
||
-SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) | ||
+if(SNAPPY_FOUND) | ||
+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) | ||
+endif(SNAPPY_FOUND) | ||
+ | ||
+if(LZ4_FOUND) | ||
+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) | ||
+endif(LZ4_FOUND) | ||
+ | ||
+if(ZSTD_FOUND) | ||
+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) | ||
+endif(ZSTD_FOUND) | ||
+ | ||
+SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) | ||
|
||
IF(MSVC) | ||
SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) | ||
- | ||
- |
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