I've tested this patch on Ubuntu 20.04 daily for Enchant 2.x, and on
Ubuntu 19.10 for Enchant 1.x.

Kornel, any thoughts?

Scott
From 1314d3885ec6c477db18d2ef6628e4e217c6c089 Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Thu, 12 Mar 2020 22:36:49 -0400
Subject: [PATCH] CMake build: find enchant 2.x binary and lib

For example, see the Debian Sid file lists for the packages
libenchant-2-dev [1] and enchant-2 [2]. The packages for Ubuntu
20.04 are similar.

[1] https://packages.debian.org/sid/amd64/libenchant-2-dev/filelist
[2] https://packages.debian.org/sid/amd64/enchant-2/filelist
---
 development/cmake/modules/FindENCHANT.cmake | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/development/cmake/modules/FindENCHANT.cmake b/development/cmake/modules/FindENCHANT.cmake
index d7548a84fc..2b4dfa3961 100644
--- a/development/cmake/modules/FindENCHANT.cmake
+++ b/development/cmake/modules/FindENCHANT.cmake
@@ -2,11 +2,14 @@ if(WIN32)
 	find_library(ENCHANT_LIBRARY "libenchant")
 	find_path(ENCHANT_INCLUDE_DIR "enchant++.h")
 else()
-  find_library(ENCHANT_LIBRARY "enchant"  
+  find_library(ENCHANT_LIBRARY NAMES "enchant-2" "enchant"
 	"/usr/local/lib" 
 	${SYSTEM_LIB_DIRS}
 	"/opt/local/lib")
   find_path(ENCHANT_INCLUDE_DIR "enchant++.h" PATHS 
+		/usr/local/include/enchant-2
+		/usr/include/enchant-2
+		/opt/local/include/enchant-2
 		/usr/local/include
 		/usr/local/include/enchant
 		/usr/include
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to