From 2876b2156f354bac01e68d291f8fb2a0157ceb93 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Thu, 12 Mar 2020 22:36:49 -0400 Subject: [PATCH] CMake build: find enchant 2.x binary and lib For example, see the Fedora file lists for the package enchant2-devel [1] as well as the Debian Sid file lists for the packages libenchant-2-dev [2] and enchant-2 [3]. The packages for Ubuntu 20.04 are similar. Our autotools build has had support for finding enchant 2.x since 71977769. Searching for enchant-2 first is consistent with what we do for autotools (see 1ae537c5). This commit is related to #10986. [1] https://www.lyx.org/trac/ticket/10986#comment:28 [2] https://packages.debian.org/sid/amd64/libenchant-2-dev/filelist [3] 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.39.5