Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 59FAD200C29 for ; Tue, 28 Feb 2017 22:25:50 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 58A67160B82; Tue, 28 Feb 2017 21:25:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A1A9A160B59 for ; Tue, 28 Feb 2017 22:25:49 +0100 (CET) Received: (qmail 24651 invoked by uid 500); 28 Feb 2017 21:25:48 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 24626 invoked by uid 99); 28 Feb 2017 21:25:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2017 21:25:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AD027DFDE6; Tue, 28 Feb 2017 21:25:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: todd@apache.org To: commits@kudu.apache.org Date: Tue, 28 Feb 2017 21:25:48 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/5] kudu git commit: cmake: don't incorporate filenames in regexp patterns archived-at: Tue, 28 Feb 2017 21:25:50 -0000 Repository: kudu Updated Branches: refs/heads/master 50274c8f8 -> 368f4f734 cmake: don't incorporate filenames in regexp patterns It leads to incorrect match failures when the filenames contain regexp metacharacters, the worst offender being '+'. I couldn't find a cmake equivalent to java.util.regex.Pattern's \Q and \E control characters, so I rewrote the matching logic with FIND and REPLACE instead. With this change, building from within a directory like kudu-1.2.0+cdh6.x+0/build/fastdebug correctly creates the 'latest' link. Change-Id: Iffbb9cb377625b537212e8244976ffc1b898840b Reviewed-on: http://gerrit.cloudera.org:8080/6161 Tested-by: Adar Dembo Reviewed-by: Todd Lipcon Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/8f54f604 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/8f54f604 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/8f54f604 Branch: refs/heads/master Commit: 8f54f6049434196e80f3f4adeb450348a013bad4 Parents: 50274c8 Author: Adar Dembo Authored: Sun Feb 26 19:29:21 2017 -0800 Committer: Todd Lipcon Committed: Tue Feb 28 06:43:32 2017 +0000 ---------------------------------------------------------------------- CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/8f54f604/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ec3917..84329a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,11 +45,15 @@ endif() # build/ # build/ # ... -if ("${CMAKE_CURRENT_BINARY_DIR}" MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}/build/[^/]+$") - if ("${CMAKE_CURRENT_BINARY_DIR}" MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}/build/latest") - message(FATAL_ERROR "Should not run cmake inside the build/latest symlink. " - "First change directories into the destination of the symlink.") - endif() +if ("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL + "${CMAKE_CURRENT_SOURCE_DIR}/build/latest") + message(FATAL_ERROR "Should not run cmake inside the build/latest symlink. " + "First change directories into the destination of the symlink.") +endif() +string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/build/" "" + BLESSED_BUILD_SUBDIR "${CMAKE_CURRENT_BINARY_DIR}") +string(FIND "${BLESSED_BUILD_SUBDIR}" "/" SLASH_POS) +if (SLASH_POS EQUAL -1) if (NOT APPLE) set(MORE_ARGS "-T") endif()