2006-06-15 15:11:25 +00:00
|
|
|
|
|
|
|
if (ICONV_INCLUDE_DIR)
|
|
|
|
# Already in cache, be silent
|
|
|
|
set(ICONV_FIND_QUIETLY TRUE)
|
|
|
|
endif (ICONV_INCLUDE_DIR)
|
|
|
|
|
|
|
|
FIND_PATH(ICONV_INCLUDE_DIR iconv.h
|
|
|
|
/usr/include
|
|
|
|
/usr/local/include
|
|
|
|
)
|
|
|
|
|
2006-09-03 13:46:47 +00:00
|
|
|
set(POTENTIAL_ICONV_LIBS iconv libiconv libiconv2)
|
2006-06-15 15:11:25 +00:00
|
|
|
FIND_LIBRARY(ICONV_LIBRARY NAMES ${POTENTIAL_ICONV_LIBS}
|
|
|
|
PATHS
|
|
|
|
/usr/lib
|
|
|
|
/usr/local/lib
|
|
|
|
)
|
|
|
|
|
|
|
|
if(WIN32)
|
2006-09-03 13:46:47 +00:00
|
|
|
set(ICONV_DLL_NAMES iconv.dll libiconv.dll libiconv2.dll)
|
|
|
|
FIND_FILE(ICONV_DLL
|
|
|
|
NAMES ${ICONV_DLL_NAMES}
|
|
|
|
PATHS ENV PATH
|
|
|
|
NO_DEFAULT_PATH)
|
2006-09-06 08:43:48 +00:00
|
|
|
FIND_FILE(ICONV_DLL_HELP
|
|
|
|
NAMES ${ICONV_DLL_NAMES}
|
|
|
|
PATHS ENV PATH
|
|
|
|
${ICONV_INCLUDE_DIR}/../bin)
|
2006-06-15 15:11:25 +00:00
|
|
|
IF(ICONV_FIND_REQUIRED)
|
|
|
|
IF(NOT ICONV_DLL AND NOT ICONV_DLL_HELP)
|
|
|
|
MESSAGE(FATAL_ERROR "Could not find iconv.dll, please add correct your PATH environment variable")
|
|
|
|
ENDIF(NOT ICONV_DLL AND NOT ICONV_DLL_HELP)
|
|
|
|
IF(NOT ICONV_DLL AND ICONV_DLL_HELP)
|
|
|
|
GET_FILENAME_COMPONENT(ICONV_DLL_HELP ${ICONV_DLL_HELP} PATH)
|
2006-09-06 08:43:48 +00:00
|
|
|
MESSAGE(STATUS)
|
|
|
|
MESSAGE(STATUS "Could not find iconv.dll in standard search path, please add ")
|
|
|
|
MESSAGE(STATUS "${ICONV_DLL_HELP}")
|
|
|
|
MESSAGE(STATUS "to your PATH environment variable.")
|
|
|
|
MESSAGE(STATUS)
|
|
|
|
MESSAGE(FATAL_ERROR "exit cmake")
|
2006-06-15 15:11:25 +00:00
|
|
|
ENDIF(NOT ICONV_DLL AND ICONV_DLL_HELP)
|
|
|
|
ENDIF(ICONV_FIND_REQUIRED)
|
|
|
|
ELSE(WIN32)
|
|
|
|
set(ICONV_DLL TRUE)
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
|
|
|
|
IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY AND ICONV_DLL)
|
|
|
|
SET(ICONV_FOUND TRUE)
|
|
|
|
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY AND ICONV_DLL)
|
|
|
|
|
|
|
|
IF (ICONV_FOUND)
|
|
|
|
IF (NOT ICONV_FIND_QUIETLY)
|
2006-09-03 13:46:47 +00:00
|
|
|
MESSAGE(STATUS "Found iconv library: ${ICONV_LIBRARY}")
|
|
|
|
#MESSAGE(STATUS "Found iconv dll : ${ICONV_DLL}")
|
2006-06-15 15:11:25 +00:00
|
|
|
ENDIF (NOT ICONV_FIND_QUIETLY)
|
|
|
|
ELSE (ICONV_FOUND)
|
|
|
|
IF (ICONV_FIND_REQUIRED)
|
|
|
|
MESSAGE(STATUS "Looked for iconv library named ${POTENTIAL_ICONV_LIBS}.")
|
|
|
|
MESSAGE(STATUS "Found no acceptable iconv library. This is fatal.")
|
2006-09-06 08:43:48 +00:00
|
|
|
MESSAGE(STATUS "iconv header: ${ICONV_INCLUDE_DIR}")
|
|
|
|
MESSAGE(STATUS "iconv lib : ${ICONV_LIBRARY}")
|
2006-06-15 15:11:25 +00:00
|
|
|
MESSAGE(FATAL_ERROR "Could NOT find iconv library")
|
|
|
|
ENDIF (ICONV_FIND_REQUIRED)
|
|
|
|
ENDIF (ICONV_FOUND)
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED(ICONV_LIBRARY ICONV_INCLUDE_DIR)
|