forked from facebook/rocksdb
-
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.
cmake: cmake related cleanups (facebook#5662)
Summary: - cmake: use the builtin FindBzip2.cmake from CMake - cmake: require CMake v3.5.1 - cmake: add imported target for 3rd party libraries - cmake: extract ReadVersion.cmake out and refactor it Pull Request resolved: facebook#5662 Differential Revision: D16660974 Pulled By: maysamyabandeh fbshipit-source-id: 681594910e74253251fe14ad0befc41a4d0f4fd4
- Loading branch information
1 parent
f4a616e
commit cc9fa7f
Showing
9 changed files
with
132 additions
and
112 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
# - Find JeMalloc library | ||
# Find the native JeMalloc includes and library | ||
# | ||
# JEMALLOC_INCLUDE_DIR - where to find jemalloc.h, etc. | ||
# JEMALLOC_LIBRARIES - List of libraries when using jemalloc. | ||
# JEMALLOC_FOUND - True if jemalloc found. | ||
# JeMalloc_INCLUDE_DIRS - where to find jemalloc.h, etc. | ||
# JeMalloc_LIBRARIES - List of libraries when using jemalloc. | ||
# JeMalloc_FOUND - True if jemalloc found. | ||
|
||
find_path(JEMALLOC_INCLUDE_DIR | ||
find_path(JeMalloc_INCLUDE_DIRS | ||
NAMES jemalloc/jemalloc.h | ||
HINTS ${JEMALLOC_ROOT_DIR}/include) | ||
|
||
find_library(JEMALLOC_LIBRARIES | ||
find_library(JeMalloc_LIBRARIES | ||
NAMES jemalloc | ||
HINTS ${JEMALLOC_ROOT_DIR}/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(jemalloc DEFAULT_MSG JEMALLOC_LIBRARIES JEMALLOC_INCLUDE_DIR) | ||
find_package_handle_standard_args(JeMalloc DEFAULT_MSG JeMalloc_LIBRARIES JeMalloc_INCLUDE_DIRS) | ||
|
||
mark_as_advanced( | ||
JEMALLOC_LIBRARIES | ||
JEMALLOC_INCLUDE_DIR) | ||
JeMalloc_LIBRARIES | ||
JeMalloc_INCLUDE_DIRS) | ||
|
||
if(JeMalloc_FOUND AND NOT (TARGET JeMalloc::JeMalloc)) | ||
add_library (JeMalloc::JeMalloc UNKNOWN IMPORTED) | ||
set_target_properties(JeMalloc::JeMalloc | ||
PROPERTIES | ||
IMPORTED_LOCATION ${JeMalloc_LIBRARIES} | ||
INTERFACE_INCLUDE_DIRECTORIES ${JeMalloc_INCLUDE_DIRS}) | ||
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
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,25 +1,33 @@ | ||
# - Find TBB | ||
# Find the Thread Building Blocks library and includes | ||
# | ||
# TBB_INCLUDE_DIR - where to find tbb.h, etc. | ||
# TBB_INCLUDE_DIRS - where to find tbb.h, etc. | ||
# TBB_LIBRARIES - List of libraries when using TBB. | ||
# TBB_FOUND - True if TBB found. | ||
|
||
if(NOT DEFINED TBB_ROOT_DIR) | ||
set(TBB_ROOT_DIR "$ENV{TBBROOT}") | ||
endif() | ||
|
||
find_path(TBB_INCLUDE_DIR | ||
NAMES tbb/tbb.h | ||
HINTS ${TBB_ROOT_DIR}/include) | ||
find_path(TBB_INCLUDE_DIRS | ||
NAMES tbb/tbb.h | ||
HINTS ${TBB_ROOT_DIR}/include) | ||
|
||
find_library(TBB_LIBRARIES | ||
NAMES tbb | ||
HINTS ${TBB_ROOT_DIR}/lib ENV LIBRARY_PATH) | ||
NAMES tbb | ||
HINTS ${TBB_ROOT_DIR}/lib ENV LIBRARY_PATH) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(TBB DEFAULT_MSG TBB_LIBRARIES TBB_INCLUDE_DIR) | ||
find_package_handle_standard_args(TBB DEFAULT_MSG TBB_LIBRARIES TBB_INCLUDE_DIRS) | ||
|
||
mark_as_advanced( | ||
TBB_LIBRARIES | ||
TBB_INCLUDE_DIR) | ||
TBB_LIBRARIES | ||
TBB_INCLUDE_DIRS) | ||
|
||
if(TBB_FOUND AND NOT (TARGET TBB::TBB)) | ||
add_library (TBB::TBB UNKNOWN IMPORTED) | ||
set_target_properties(TBB::TBB | ||
PROPERTIES | ||
IMPORTED_LOCATION ${TBB_LIBRARIES} | ||
INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS}) | ||
endif() |
This file was deleted.
Oops, something went wrong.
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,21 +1,29 @@ | ||
# - Find Lz4 | ||
# Find the lz4 compression library and includes | ||
# | ||
# LZ4_INCLUDE_DIR - where to find lz4.h, etc. | ||
# LZ4_LIBRARIES - List of libraries when using lz4. | ||
# LZ4_FOUND - True if lz4 found. | ||
# lz4_INCLUDE_DIRS - where to find lz4.h, etc. | ||
# lz4_LIBRARIES - List of libraries when using lz4. | ||
# lz4_FOUND - True if lz4 found. | ||
|
||
find_path(LZ4_INCLUDE_DIR | ||
find_path(lz4_INCLUDE_DIRS | ||
NAMES lz4.h | ||
HINTS ${LZ4_ROOT_DIR}/include) | ||
HINTS ${lz4_ROOT_DIR}/include) | ||
|
||
find_library(LZ4_LIBRARIES | ||
find_library(lz4_LIBRARIES | ||
NAMES lz4 | ||
HINTS ${LZ4_ROOT_DIR}/lib) | ||
HINTS ${lz4_ROOT_DIR}/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(lz4 DEFAULT_MSG LZ4_LIBRARIES LZ4_INCLUDE_DIR) | ||
find_package_handle_standard_args(lz4 DEFAULT_MSG lz4_LIBRARIES lz4_INCLUDE_DIRS) | ||
|
||
mark_as_advanced( | ||
LZ4_LIBRARIES | ||
LZ4_INCLUDE_DIR) | ||
lz4_LIBRARIES | ||
lz4_INCLUDE_DIRS) | ||
|
||
if(lz4_FOUND AND NOT (TARGET lz4::lz4)) | ||
add_library(lz4::lz4 UNKNOWN IMPORTED) | ||
set_target_properties(lz4::lz4 | ||
PROPERTIES | ||
IMPORTED_LOCATION ${lz4_LIBRARIES} | ||
INTERFACE_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIRS}) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
# - Find Snappy | ||
# Find the snappy compression library and includes | ||
# | ||
# SNAPPY_INCLUDE_DIR - where to find snappy.h, etc. | ||
# SNAPPY_LIBRARIES - List of libraries when using snappy. | ||
# SNAPPY_FOUND - True if snappy found. | ||
# snappy_INCLUDE_DIRS - where to find snappy.h, etc. | ||
# snappy_LIBRARIES - List of libraries when using snappy. | ||
# snappy_FOUND - True if snappy found. | ||
|
||
find_path(SNAPPY_INCLUDE_DIR | ||
find_path(snappy_INCLUDE_DIRS | ||
NAMES snappy.h | ||
HINTS ${SNAPPY_ROOT_DIR}/include) | ||
HINTS ${snappy_ROOT_DIR}/include) | ||
|
||
find_library(SNAPPY_LIBRARIES | ||
NAMES snappy | ||
HINTS ${SNAPPY_ROOT_DIR}/lib) | ||
HINTS ${snappy_ROOT_DIR}/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(snappy DEFAULT_MSG SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR) | ||
find_package_handle_standard_args(snappy DEFAULT_MSG snappy_LIBRARIES snappy_INCLUDE_DIRS) | ||
|
||
mark_as_advanced( | ||
SNAPPY_LIBRARIES | ||
SNAPPY_INCLUDE_DIR) | ||
snappy_LIBRARIES | ||
snappy_INCLUDE_DIRS) | ||
|
||
if(snappy_FOUND AND NOT (TARGET snappy::snappy)) | ||
add_library (snappy::snappy UNKNOWN IMPORTED) | ||
set_target_properties(snappy::snappy | ||
PROPERTIES | ||
IMPORTED_LOCATION ${snappy_LIBRARIES} | ||
INTERFACE_INCLUDE_DIRECTORIES ${snappy_INCLUDE_DIRS}) | ||
endif() |
Oops, something went wrong.