diff --git a/CMakeLists.txt b/CMakeLists.txt index 190b693321c8ac53abc2bbe4de69f744a0523d57..65d1e133d77018d1b940927d5414b3723af2ba7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,13 +36,13 @@ cat("${CMAKE_SUPPORT_DIR}/zlib_CMakeLists.txt.in" ${DEPS_TMP_FILE}) cat("${CMAKE_SUPPORT_DIR}/cjson_CMakeLists.txt.in" ${DEPS_TMP_FILE}) ## leveldb -option(BUILD_WITH_LEVELDB "If build with leveldb" ON) +option(BUILD_WITH_LEVELDB "If build with leveldb" OFF) if(${BUILD_WITH_LEVELDB}) cat("${CMAKE_SUPPORT_DIR}/leveldb_CMakeLists.txt.in" ${DEPS_TMP_FILE}) endif(${BUILD_WITH_LEVELDB}) ## rocksdb -option(BUILD_WITH_ROCKSDB "If build with rocksdb" ON) +option(BUILD_WITH_ROCKSDB "If build with rocksdb" OFF) if(${BUILD_WITH_ROCKSDB}) cat("${CMAKE_SUPPORT_DIR}/rocksdb_CMakeLists.txt.in" ${DEPS_TMP_FILE}) endif(${BUILD_WITH_ROCKSDB}) diff --git a/cmake/EnableCMP0048.txt.in b/cmake/EnableCMP0048.txt.in new file mode 100644 index 0000000000000000000000000000000000000000..1b59188fd7dc3865589430426b3501791c42281f --- /dev/null +++ b/cmake/EnableCMP0048.txt.in @@ -0,0 +1 @@ +cmake_policy(SET CMP0048 NEW) \ No newline at end of file diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index a872de5fb857ee6e27ad124deaa0f3b5fdbfd6b4..50225da82be544f639a150708e38c55c5fce44a9 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -4,12 +4,15 @@ if(${BUILD_TEST}) endif(${BUILD_TEST}) # cJson +# see https://stackoverflow.com/questions/37582508/silence-cmp0048-warnings-in-vendored-projects +set(CMAKE_PROJECT_INCLUDE_BEFORE "${CMAKE_SUPPORT_DIR}/EnableCMP0048.txt.in") add_subdirectory(cJson) target_include_directories( cjson # see https://stackoverflow.com/questions/25676277/cmake-target-include-directories-prints-an-error-when-i-try-to-add-the-source PUBLIC $ ) +unset(CMAKE_PROJECT_INCLUDE_BEFORE) # lz4 add_subdirectory(lz4/build/cmake) @@ -19,12 +22,14 @@ target_include_directories( ) # zlib +set(CMAKE_PROJECT_INCLUDE_BEFORE "${CMAKE_SUPPORT_DIR}/EnableCMP0048.txt.in") add_subdirectory(zlib) target_include_directories( zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/zlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/zlib ) +unset(CMAKE_PROJECT_INCLUDE_BEFORE) # leveldb if(${BUILD_WITH_LEVELDB})