]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
pcre: do not explode if pcre is missing
authorMatthew Barr <matthew.barr@intel.com>
Fri, 19 Jan 2018 04:20:39 +0000 (15:20 +1100)
committerXiang Wang <xiang.w.wang@intel.com>
Fri, 19 Jan 2018 12:07:32 +0000 (07:07 -0500)
cmake/pcre.cmake
tools/hscollider/CMakeLists.txt

index 30b33b88f0083788ecb970aebfefc10c675b5132..acad45bddc5830e239876c8aae80275300f4b39c 100644 (file)
@@ -35,7 +35,8 @@ if (PCRE_BUILD_SOURCE)
 
     if (NOT CORRECT_PCRE_VERSION)
         unset(CORRECT_PCRE_VERSION CACHE)
-        message(FATAL_ERROR "Incorrect version of pcre - version ${PCRE_REQUIRED_VERSION} is required")
+        message(STATUS "Incorrect version of pcre - version ${PCRE_REQUIRED_VERSION} is required")
+        return ()
     else()
         message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} - building from source.")
     endif()
@@ -55,7 +56,8 @@ else ()
     if (PCRE_FOUND)
         message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION}")
     else ()
-        message(FATAL_ERROR "PCRE version ${PCRE_REQUIRED_VERSION} not found")
+        message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} not found")
+        return ()
     endif ()
 endif (PCRE_BUILD_SOURCE)
 
index 7efcef42dfd994d4abe561521d47f02736cc1ae6..f05b444fb86f67dd02f08f28fdc8d516ff393415 100644 (file)
@@ -4,6 +4,10 @@ set(PCRE_REQUIRED_MINOR_VERSION 41)
 set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION})
 
 include (${CMAKE_MODULE_PATH}/pcre.cmake)
+if (NOT CORRECT_PCRE_VERSION)
+    message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} not found, not building hscollider")
+    return()
+endif()
 
 include_directories(${PCRE_INCLUDE_DIRS})