You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2017/05/12 00:13:16 UTC
arrow git commit: ARROW-29: [C++] FindRe2 cmake module
Repository: arrow
Updated Branches:
refs/heads/master b0666609a -> a4f29f3a3
ARROW-29: [C++] FindRe2 cmake module
Author: Max Risuhin <ri...@gmail.com>
Closes #674 from MaxRis/ARROW-29 and squashes the following commits:
e2d5d72 [Max Risuhin] ARROW-29: [C++] FindRe2 cmake module
Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/a4f29f3a
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/a4f29f3a
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/a4f29f3a
Branch: refs/heads/master
Commit: a4f29f3a3ff1c64a6f547bfb0d5e4500142ea5ec
Parents: b066660
Author: Max Risuhin <ri...@gmail.com>
Authored: Thu May 11 20:13:10 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Thu May 11 20:13:10 2017 -0400
----------------------------------------------------------------------
cpp/cmake_modules/FindRe2.cmake | 69 ++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/arrow/blob/a4f29f3a/cpp/cmake_modules/FindRe2.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/FindRe2.cmake b/cpp/cmake_modules/FindRe2.cmake
new file mode 100644
index 0000000..6450b22
--- /dev/null
+++ b/cpp/cmake_modules/FindRe2.cmake
@@ -0,0 +1,69 @@
+##############################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+##############################################################################
+
+# - Find re2 headers and lib.
+# RE2_HOME hints the location
+# This module defines
+# RE2_INCLUDE_DIR, directory containing headers
+# RE2_STATIC_LIB, path to libre2.a
+# re2 imported static library
+# RE2_FOUND, whether re2 has been found
+
+set(RE2_SEARCH_HEADER_PATHS ${RE2_HOME}/include)
+
+set(RE2_SEARCH_LIB_PATHS ${RE2_HOME}/lib)
+
+find_path(RE2_INCLUDE_DIR re2/re2.h
+ PATHS ${RE2_SEARCH_HEADER_PATHS}
+ NO_DEFAULT_PATH
+ DOC "Google's re2 regex header path"
+)
+
+find_library(RE2_LIBS NAMES re2
+ PATHS ${RE2_SEARCH_LIB_PATHS}
+ NO_DEFAULT_PATH
+ DOC "Google's re2 regex library"
+)
+
+find_library(RE2_STATIC_LIB NAMES libre2${CMAKE_STATIC_LIBRARY_SUFFIX}
+ PATHS ${RE2_SEARCH_LIB_PATHS}
+ NO_DEFAULT_PATH
+ DOC "Google's re2 regex static library"
+)
+
+message(STATUS ${RE2_INCLUDE_DIR})
+
+if (NOT RE2_INCLUDE_DIR OR NOT RE2_LIBS OR
+ NOT RE2_STATIC_LIB)
+ set(RE2_FOUND FALSE)
+ message(FATAL_ERROR "Re2 includes and libraries NOT found. "
+ "Looked for headers in ${RE2_SEARCH_HEADER_PATHS}, "
+ "and for libs in ${RE2_SEARCH_LIB_PATHS}")
+else()
+ set(RE2_FOUND TRUE)
+ add_library(re2 STATIC IMPORTED)
+ set_target_properties(re2 PROPERTIES IMPORTED_LOCATION "${RE2_STATIC_LIB}")
+endif()
+
+mark_as_advanced(
+ RE2_INCLUDE_DIR
+ RE2_LIBS
+ RE2_STATIC_LIB
+ re2
+)