From 5ef180842c65b775f503a0e6ae617a43da4f1afc Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sat, 2 Jul 2016 11:09:26 +0200 Subject: [PATCH] Ensure that iconv and zlib are always found If the included thirdparty libs are requested, use them, even on unix. This is consistent with autotools (but the recommended way is of course to use the system libs). If the included thirdparty libs are not requested then try to find libiconv and zlib also on windows. This will lead to an error unless the libs are found via manually added include and link paths, but this is wanted since libiconv and zlib are not optional. --- CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 667f76e24b..3c9ab63bc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -706,15 +706,13 @@ if(LYX_NLS) endif() endif() -if(UNIX) - find_package(ICONV REQUIRED) - find_package(ZLIB REQUIRED) -else() - if(LYX_3RDPARTY_BUILD) +if(LYX_3RDPARTY_BUILD) add_subdirectory(3rdparty/libiconv) set(HAVE_ICONV_CONST 1) add_subdirectory(3rdparty/zlib) - endif() +else() + find_package(ICONV REQUIRED) + find_package(ZLIB REQUIRED) endif() if(LYX_EXTERNAL_BOOST)