Github user jcrist commented on a diff in the pull request: https://github.com/apache/orc/pull/192#discussion_r152660084 --- Diff: cmake_modules/ThirdpartyToolchain.cmake --- @@ -10,19 +10,46 @@ # See the License for the specific language governing permissions and # limitations under the License. +set (LZ4_VERSION "1.7.5") +set (SNAPPY_VERSION "1.1.4") +set (ZLIB_VERSION "1.2.11") +set (GTEST_VERSION "1.8.0") +set (PROTOBUF_VERSION "2.6.0") + set (THIRDPARTY_DIR "${CMAKE_BINARY_DIR}/c++/libs/thirdparty") string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE) +if (DEFINED ENV{SNAPPY_HOME}) + set (SNAPPY_HOME "$ENV{SNAPPY_HOME}") +endif () + +if (DEFINED ENV{ZLIB_HOME}) + set (ZLIB_HOME "$ENV{ZLIB_HOME}") +endif () + +if (DEFINED ENV{LZ4_HOME}) + set (LZ4_HOME "$ENV{LZ4_HOME}") +endif () + +if (DEFINED ENV{PROTOBUF_HOME}) + set (PROTOBUF_HOME "$ENV{PROTOBUF_HOME}") +endif () + +if (DEFINED ENV{GTEST_HOME}) + set (GTEST_HOME "$ENV{GTEST_HOME}") +endif () + # ---------------------------------------------------------------------- # Snappy -set (SNAPPY_HOME "$ENV{SNAPPY_HOME}") -find_package (Snappy) -if (NOT SNAPPY_FOUND) +if (NOT "${SNAPPY_HOME}" STREQUAL "") + find_package (Snappy REQUIRED) + set(SNAPPY_VENDORED FALSE) +else () --- End diff -- As I wrote it, we error out if `SNAPPY_HOME` is set but not found (since `REQUIRED` is set). I think this makes more sense - as a user if I specify `SNAPPY_HOME` I'd rather get an error than silently download and build a new version if it fails to find it.
---