From 997b4f91615bfeb3c5b4614011077b02030970c5 Mon Sep 17 00:00:00 2001 From: BtbN Date: Thu, 21 Aug 2014 02:06:39 +0200 Subject: [PATCH] Fix FindIconv naming consistency --- .../{Findiconv.cmake => FindIconv.cmake} | 26 ++++++++----------- plugins/text-freetype2/CMakeLists.txt | 23 ++++++++-------- 2 files changed, 23 insertions(+), 26 deletions(-) rename cmake/Modules/{Findiconv.cmake => FindIconv.cmake} (66%) diff --git a/cmake/Modules/Findiconv.cmake b/cmake/Modules/FindIconv.cmake similarity index 66% rename from cmake/Modules/Findiconv.cmake rename to cmake/Modules/FindIconv.cmake index b39544f27..ad0555cce 100644 --- a/cmake/Modules/Findiconv.cmake +++ b/cmake/Modules/FindIconv.cmake @@ -1,16 +1,12 @@ # Once done these will be defined: # -# LIBICONV_FOUND -# LIBICONV_INCLUDE_DIRS -# LIBICONV_LIBRARIES -# -# For use in OBS: -# -# ICONV_INCLUDE_DIR +# ICONV_FOUND +# ICONV_INCLUDE_DIRS +# ICONV_LIBRARIES # -if(LIBICONV_INCLUDE_DIRS AND LIBICONV_LIBRARIES) - set(LIBICONV_FOUND TRUE) +if(ICONV_INCLUDE_DIRS AND ICONV_LIBRARIES) + set(ICONV_FOUND TRUE) else() find_package(PkgConfig QUIET) if (PKG_CONFIG_FOUND) @@ -23,7 +19,7 @@ else() set(_lib_suffix 32) endif() - set(ICONV_PATH_ARCH IConvPath${_lib_suffix}) + set(ICONV_PATH_ARCH IconvPath${_lib_suffix}) find_path(ICONV_INCLUDE_DIR NAMES iconv.h @@ -31,7 +27,7 @@ else() ${_ICONV_INCLUDE_DIRS} "${CMAKE_SOURCE_DIR}/additional_install_files/include" "$ENV{obsAdditionalInstallFiles}/include" - ENV IConvPath + ENV IconvPath ENV ${ICONV_PATH_ARCH} PATHS /usr/include /usr/local/include /opt/local/include /sw/include) @@ -40,17 +36,17 @@ else() NAMES ${_ICONV_LIBRARIES} iconv libiconv HINTS ${_ICONV_LIBRARY_DIRS} - "${ICONV_INCLUDE_DIR}/../lib" "${ICONV_INCLUDE_DIR}/../lib${_lib_suffix}" + "${ICONV_INCLUDE_DIR}/../lib" "${ICONV_INCLUDE_DIR}/../libs${_lib_suffix}" "${ICONV_INCLUDE_DIR}/lib" "${ICONV_INCLUDE_DIR}/lib${_lib_suffix}" PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib) - set(LIBICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR} CACHE PATH "iconv include dir") - set(LIBICONV_LIBRARIES ${ICONV_LIB} CACHE STRING "iconv libraries") + set(ICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR} CACHE PATH "iconv include dir") + set(ICONV_LIBRARIES ${ICONV_LIB} CACHE STRING "iconv libraries") - find_package_handle_standard_args(Libiconv DEFAULT_MSG ICONV_LIB ICONV_INCLUDE_DIR) + find_package_handle_standard_args(Iconv DEFAULT_MSG ICONV_LIB ICONV_INCLUDE_DIR) mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIB) endif() diff --git a/plugins/text-freetype2/CMakeLists.txt b/plugins/text-freetype2/CMakeLists.txt index f8966abf7..b6c807b39 100644 --- a/plugins/text-freetype2/CMakeLists.txt +++ b/plugins/text-freetype2/CMakeLists.txt @@ -7,9 +7,9 @@ if(NOT LIBFREETYPE_FOUND) endif() if(APPLE) - find_package(iconv QUIET) - if(NOT LIBICONV_FOUND) - message(STATUS "IConv library not found, Freetype text plugin disabled") + find_package(Iconv QUIET) + if(NOT ICONV_FOUND) + message(STATUS "Iconv library not found, Freetype text plugin disabled") return() endif() @@ -20,11 +20,11 @@ if(APPLE) find-font-iconv.c) include_directories(${COCOA} - ${LIBICONV_INCLUDE_DIRS}) + ${ICONV_INCLUDE_DIRS}) set(text-freetype2_PLATFORM_DEPS ${COCOA} - ${LIBICONV_LIBRARIES}) + ${ICONV_LIBRARIES}) set_source_files_properties(find-font-cocoa.m PROPERTIES LANGUAGE C) @@ -35,16 +35,16 @@ else() message(STATUS "Linux-specific code has yet to be written for the text plugin, just needs load_os_font_list written.. which, er, may or may not be a pain. (My apologies in advance, please don't strangle me)") return() - find_package(iconv QUIET) - if(NOT LIBICONV_FOUND) - message(STATUS "IConv library not found, Freetype text plugin disabled") + find_package(Iconv QUIET) + if(NOT ICONV_FOUND) + message(STATUS "Iconv library not found, Freetype text plugin disabled") return() endif() set(text-freetype2_PLATFORM_SOURCES find-font-iconv.c) - include_directories(${LIBICONV_INCLUDE_DIR}) + include_directories(${ICONV_INCLUDE_DIR}) endif() include_directories(${LIBFREETYPE_INCLUDE_DIRS}) @@ -66,8 +66,9 @@ target_link_libraries(text-freetype2 libobs ${text-freetype2_PLATFORM_DEPS} ${LIBFREETYPE_LIBRARIES}) -if(UNIX AND LIBICONV_FOUND) - target_link_libraries(text-freetype2 ${LIBICONV_LIBRARIES}) + +if(UNIX AND ICONV_FOUND) + target_link_libraries(text-freetype2 ${ICONV_LIBRARIES}) endif() install_obs_plugin_with_data(text-freetype2 data)