From 67907af163354636ac1610d11e1b5feff0900311 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Fri, 15 Jun 2018 13:08:38 +0200 Subject: [PATCH] Check yaml-cpp version before build. Build it from github if it's < 0.5.3. --- SuperBuild/SuperBuild.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index e23f7fa7..35735797 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -28,7 +28,7 @@ if(USE_STATIC_RUNTIME) mark_as_advanced(STATIC_LIBCXX) if(NOT STATIC_LIBCXX) unset(STATIC_LIBCXX CACHE) - # only on some Centos/Redhat systems + # Only on some Centos/Redhat systems message(FATAL_ERROR "\"USE_STATIC_RUNTIME\" set to ON but \"libstdcxx.a\" not found! \ \"yum install libstdc++-static\" to resolve the error.") @@ -91,7 +91,8 @@ if(BATCH_VERSION) pkg_check_modules(YAML-CPP yaml-cpp) endif() - if(YAML-CPP_FOUND) + # Build from github if not found or version < 0.5.3 + if(YAML-CPP_FOUND AND NOT (YAML-CPP_VERSION VERSION_LESS "0.5.3")) set(YAML-CPP_DIR ${YAML-CPP_LIBDIR}/cmake/yaml-cpp CACHE PATH "Path to yaml-cpp configuration file" FORCE) message("-- Using yaml-cpp library from ${YAML-CPP_DIR}") else()