From 990695392130ad602e8b02d57579a88220a8d47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Thu, 12 May 2011 21:48:11 +0000 Subject: [PATCH] cmake on mac: precompiled libintl comes from ports, then also use iconv from ports, this is necessary to fix linker errors and removes the cmake warning git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38731 a592a061-630c-0410-9148-cb99ea01b6c8 --- CMakeLists.txt | 5 ++++- development/cmake/modules/FindICONV.cmake | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de0df1f4c1..f7bc7b0c4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -306,7 +306,6 @@ endif() find_package(Qt4 REQUIRED) -find_package(ICONV REQUIRED) find_package(ZLIB REQUIRED) include_directories(${TOP_BINARY_DIR} ${TOP_SRC_DIR}/src) @@ -340,6 +339,8 @@ if(LYX_EXTERNAL_LIBINTL) find_package(Libintl REQUIRED) # find getext when configuring list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBINTL_LIBRARIES}) + # on mac use iconv also form ports + get_filename_component(ICONV_RELATIVE_TO_LIBINTL ${LIBINTL_LIBRARIES} PATH) else() if(LYX_NLS) add_subdirectory(intl "${TOP_BINARY_DIR}/intl") @@ -348,6 +349,8 @@ else() endif() endif() +find_package(ICONV REQUIRED) + if(LYX_EXTERNAL_BOOST) message(STATUS "Searching for boost") find_package(Boost COMPONENTS signals regex) #TODO could REQUIRED be used diff --git a/development/cmake/modules/FindICONV.cmake b/development/cmake/modules/FindICONV.cmake index 3f2e7ce626..d4c166cdb4 100644 --- a/development/cmake/modules/FindICONV.cmake +++ b/development/cmake/modules/FindICONV.cmake @@ -38,8 +38,16 @@ find_path(ICONV_INCLUDE_DIR iconv.h set(POTENTIAL_ICONV_LIBS iconv libiconv libiconv2) + find_library(ICONV_LIBRARY NAMES ${POTENTIAL_ICONV_LIBS} - PATHS /usr/lib /usr/local/lib) + PATHS + ${ICONV_RELATIVE_TO_LIBINTL} + NO_DEFAULT_PATH) + +find_library(ICONV_LIBRARY NAMES ${POTENTIAL_ICONV_LIBS} + PATHS + /usr/lib + /usr/local/lib) if(WIN32) set(ICONV_DLL_NAMES iconv.dll libiconv.dll libiconv2.dll)