From 9dc346fa53cb68ee9ff57ff67b5d3596dcb183e5 Mon Sep 17 00:00:00 2001 From: Igor Rondarev Date: Fri, 26 Mar 2021 13:52:03 +0300 Subject: [PATCH 1/3] try to find pcre.h for HAVE_RULES in any case it may be not available using default system search paths (e.g. during cross-compilation), thus have to be bootstrapped using CMAKE_STAGING_PREFIX/CMAKE_FIND_ROOT_PATH --- lib/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c193125f0a9..46a0ca4f105 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -8,6 +8,11 @@ include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) file(GLOB_RECURSE hdrs "*.h") file(GLOB_RECURSE srcs "*.cpp") +if (HAVE_RULES) + find_path(PCRE_INCLUDE pcre.h) + include_directories(${PCRE_INCLUDE}) +endif() + function(build_src output filename) get_filename_component(file ${filename} NAME) set(outfile ${CMAKE_CURRENT_BINARY_DIR}/build/mc_${file}) From c3129215dd65d38c191157ceebd418fb32fc64fc Mon Sep 17 00:00:00 2001 From: Igor Rondarev Date: Mon, 29 Mar 2021 10:50:17 +0300 Subject: [PATCH 2/3] find pcre.h using findDependencies.cmake --- cmake/findDependencies.cmake | 5 ++++- lib/CMakeLists.txt | 5 ----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index db2608b845a..8564a90b100 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -7,9 +7,12 @@ if (BUILD_GUI) endif() if (HAVE_RULES) + find_path(PCRE_INCLUDE pcre.h) find_library(PCRE_LIBRARY pcre) - if (NOT PCRE_LIBRARY) + if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) message(FATAL_ERROR "pcre dependency for RULES has not been found") + else + include_directories(${PCRE_INCLUDE}) endif() endif() diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 46a0ca4f105..c193125f0a9 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -8,11 +8,6 @@ include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) file(GLOB_RECURSE hdrs "*.h") file(GLOB_RECURSE srcs "*.cpp") -if (HAVE_RULES) - find_path(PCRE_INCLUDE pcre.h) - include_directories(${PCRE_INCLUDE}) -endif() - function(build_src output filename) get_filename_component(file ${filename} NAME) set(outfile ${CMAKE_CURRENT_BINARY_DIR}/build/mc_${file}) From 1f95283267db828377009ed2298b92bc2f94f5ba Mon Sep 17 00:00:00 2001 From: Igor Rondarev Date: Mon, 29 Mar 2021 11:00:10 +0300 Subject: [PATCH 3/3] else -> else() fix --- cmake/findDependencies.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index 8564a90b100..a5a4c67a9cd 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -11,7 +11,7 @@ if (HAVE_RULES) find_library(PCRE_LIBRARY pcre) if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) message(FATAL_ERROR "pcre dependency for RULES has not been found") - else + else() include_directories(${PCRE_INCLUDE}) endif() endif()