diff options
author | Milan Crha <mcrha@redhat.com> | 2016-12-01 11:09:14 +0100 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2016-12-01 11:10:10 +0100 |
commit | 90fa2f856f6214fc6401aaec722b20f63addff8b (patch) | |
tree | 391c99b19e8efdc10e11310b34640c972baffd8d /cmake | |
parent | 1f0d42ed5ccb4e6fb4f5f08bc20ec5bc64f745f0 (diff) | |
download | evolution-90fa2f856f6214fc6401aaec722b20f63addff8b.tar.gz |
Bug 775363 - Fails to build with minimum CMake version
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindLDAP.cmake | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cmake/modules/FindLDAP.cmake b/cmake/modules/FindLDAP.cmake index 6dde4b8af1..abbc3280d7 100644 --- a/cmake/modules/FindLDAP.cmake +++ b/cmake/modules/FindLDAP.cmake @@ -29,14 +29,24 @@ if((NOT WITH_OPENLDAP) AND (NOT WITH_SUNLDAP)) endif((NOT WITH_OPENLDAP) AND (NOT WITH_SUNLDAP)) string(LENGTH "${CMAKE_BINARY_DIR}" bindirlen) -string(SUBSTRING "${WITH_OPENLDAP}" 0 ${bindirlen} substr) +string(LENGTH "${WITH_OPENLDAP}" maxlen) +if(maxlen LESS bindirlen) + set(substr "***") +else(maxlen LESS bindirlen) + string(SUBSTRING "${WITH_OPENLDAP}" 0 ${bindirlen} substr) +endif(maxlen LESS bindirlen) string(TOUPPER "${WITH_OPENLDAP}" optupper) if(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}")) set(WITH_OPENLDAP "/usr") endif(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}")) -string(SUBSTRING "${WITH_SUNLDAP}" 0 ${bindirlen} substr) +string(LENGTH "${WITH_SUNLDAP}" maxlen) +if(maxlen LESS bindirlen) + set(substr "***") +else(maxlen LESS bindirlen) + string(SUBSTRING "${WITH_SUNLDAP}" 0 ${bindirlen} substr) +endif(maxlen LESS bindirlen) string(TOUPPER "${WITH_SUNLDAP}" optupper) if(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}")) @@ -44,6 +54,7 @@ if(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}") endif(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}")) unset(bindirlen) +unset(maxlen) unset(substr) unset(optupper) |