Author: kuemmel
Date: Thu May 12 23:48:11 2011
New Revision: 38731
URL: http://www.lyx.org/trac/changeset/38731

Log:
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

Modified:
   lyx-devel/trunk/CMakeLists.txt
   lyx-devel/trunk/development/cmake/modules/FindICONV.cmake

Modified: lyx-devel/trunk/CMakeLists.txt
==============================================================================
--- lyx-devel/trunk/CMakeLists.txt      Thu May 12 23:25:56 2011        (r38730)
+++ lyx-devel/trunk/CMakeLists.txt      Thu May 12 23:48:11 2011        (r38731)
@@ -306,7 +306,6 @@
 
 
 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 @@
        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 @@
        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

Modified: lyx-devel/trunk/development/cmake/modules/FindICONV.cmake
==============================================================================
--- lyx-devel/trunk/development/cmake/modules/FindICONV.cmake   Thu May 12 
23:25:56 2011        (r38730)
+++ lyx-devel/trunk/development/cmake/modules/FindICONV.cmake   Thu May 12 
23:48:11 2011        (r38731)
@@ -38,8 +38,16 @@
 
 set(POTENTIAL_ICONV_LIBS iconv libiconv libiconv2)
 
+
+find_library(ICONV_LIBRARY NAMES ${POTENTIAL_ICONV_LIBS}
+       PATHS
+       ${ICONV_RELATIVE_TO_LIBINTL}
+       NO_DEFAULT_PATH)
+       
 find_library(ICONV_LIBRARY NAMES ${POTENTIAL_ICONV_LIBS}
-       PATHS /usr/lib /usr/local/lib)
+       PATHS
+       /usr/lib 
+       /usr/local/lib)
 
 if(WIN32)
        set(ICONV_DLL_NAMES iconv.dll  libiconv.dll libiconv2.dll)

Reply via email to