From 73dcba5181e6dd7937aa83958a54cabaea8c3576 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 9 Apr 2015 08:02:40 -0400 Subject: [PATCH] Simplify logic to compute install prefix in OS X CMake.app Also avoid explicitly dereferencing a variable in an if() condition. --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d86ae96cc..e979d4f38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -543,10 +543,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") # make sure CMAKE_INSTALL_PREFIX ends in / - string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) - math(EXPR LEN "${LEN} -1" ) - string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) - if(NOT "${ENDCH}" STREQUAL "/") + if(NOT CMAKE_INSTALL_PREFIX MATCHES "/$") set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") endif() set(CMAKE_INSTALL_PREFIX