From a33dfc5961b7f4c1027be8cd208a23df8324bacd Mon Sep 17 00:00:00 2001 From: Dimitriy Ryazantcev Date: Thu, 18 Oct 2012 20:46:18 +0300 Subject: [PATCH 2/5] Win32: Some cmake script fixes. --- .../plugins/rosenthal/cmake/FindHunspell.cmake | 41 +++++++++++++++++++--- .../azoth/plugins/xoox/cmake/FindQXmpp.cmake | 18 +++------- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/plugins/azoth/plugins/rosenthal/cmake/FindHunspell.cmake b/src/plugins/azoth/plugins/rosenthal/cmake/FindHunspell.cmake index 1e9c59f..3dd0d07 100644 --- a/src/plugins/azoth/plugins/rosenthal/cmake/FindHunspell.cmake +++ b/src/plugins/azoth/plugins/rosenthal/cmake/FindHunspell.cmake @@ -12,14 +12,47 @@ IF (HUNSPELL_INCLUDE_DIR AND HUNSPELL_LIBRARIES) SET(HUNSPELL_FIND_QUIETLY TRUE) ENDIF (HUNSPELL_INCLUDE_DIR AND HUNSPELL_LIBRARIES) -FIND_PATH(HUNSPELL_INCLUDE_DIR hunspell/hunspell.hxx ) +INCLUDE(FindPackageHandleStandardArgs) + +IF (WIN32) + IF (MSVC) + #MSVS 2010 + IF (MSVC_VERSION LESS 1600) + MESSAGE(FATAL_ERROR "We currently support only MSVC 2010 or greater version") + ENDIF (MSVC_VERSION LESS 1600) + ENDIF (MSVC) + IF (NOT DEFINED HUNSPELL_DIR) + IF (HUNSPELL_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Please set HUNSPELL_DIR variable") + ELSE (HUNSPELL_FIND_REQUIRED) + MESSAGE(STATUS "Please set HUNSPELL_DIR variable for HUNSPELL support") + ENDIF (HUNSPELL_FIND_REQUIRED) + ENDIF (NOT DEFINED HUNSPELL_DIR) + SET (HUNSPELL_INCLUDE_WIN32 ${HUNSPELL_DIR}/src/) + + SET (PROBE_DIR + ${HUNSPELL_DIR}/src/win_api/Release_dll/libhunspell) + + FIND_LIBRARY (HUNSPELL_LIBRARIES NAMES libhunspell.lib PATHS ${PROBE_DIR}) +ELSE (WIN32) + FIND_LIBRARY (HUNSPELL_LIBRARIES NAMES hunspell-1.3 hunspell-1.2 HINTS ${HUNSPELL_DIR}) +ENDIF (WIN32) + +FIND_PATH (HUNSPELL_INCLUDE_DIR hunspell/hunspell.hxx HINTS ${HUNSPELL_DIR} ${HUNSPELL_INCLUDE_WIN32}) -FIND_LIBRARY(HUNSPELL_LIBRARIES NAMES hunspell-1.3 hunspell-1.2) # handle the QUIETLY and REQUIRED arguments and set HUNSPELL_FOUND to TRUE if # all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(HUNSPELL DEFAULT_MSG HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS (HUNSPELL DEFAULT_MSG HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIR) +if (HUNSPELL_FOUND) + if (NOT HUNSPELL_FIND_QUIETLY AND HUNSPELLCONFIG_EXECUTABLE) + message(STATUS "Hunspell found: ${HUNSPELL_LIBRARIES}") + endif(NOT HUNSPELL_FIND_QUIETLY AND HUNSPELLCONFIG_EXECUTABLE) +else(HUNSPELL_FOUND) + if(HUNSPELL_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Hunspell") + endif(HUNSPELL_FIND_REQUIRED) +endif(HUNSPELL_FOUND) MARK_AS_ADVANCED(HUNSPELL_INCLUDE_DIR HUNSPELL_LIBRARIES) diff --git a/src/plugins/azoth/plugins/xoox/cmake/FindQXmpp.cmake b/src/plugins/azoth/plugins/xoox/cmake/FindQXmpp.cmake index e000202..069e032 100644 --- a/src/plugins/azoth/plugins/xoox/cmake/FindQXmpp.cmake +++ b/src/plugins/azoth/plugins/xoox/cmake/FindQXmpp.cmake @@ -1,4 +1,4 @@ -# Find gloox library +# Find QXmpp library # # QXMPP_INCLUDE_DIR @@ -8,37 +8,30 @@ # Copyright (c) 2010-2012 Georg Rudoy <0xd34df00d@gmail.com> # Copyright (c) 2012 Minh Ngo # Win32 additions by Eugene Mamin +# Win32 fixes by Dimtriy Ryazantcev FIND_PATH(QXMPP_INCLUDE_DIR NAMES - qxmpp-dev/QXmppClient.h qxmpp/QXmppClient.h PATH ENV ) FIND_LIBRARY(QXMPP_LIBRARIES NAMES - qxmpp-dev + qxmpp0 qxmpp ) IF(QXMPP_LOCAL) FIND_PATH(QXMPP_INCLUDE_DIR client/QXmppClient.h "${QXMPP_LOCAL}/src") IF(QXMPP_INCLUDE_DIR) - IF(WIN32 AND MSVC) - SET(QXMPP_LIBRARY_RELEASE "${QXMPP_LOCAL}/lib/qxmpp.lib") - SET(QXMPP_LIBRARY_DEBUG "${QXMPP_LOCAL}/lib/qxmpp_d.lib") - win32_tune_libs_names (QXMPP) - ELSE(WIN32 AND MSVC) - SET(QXMPP_LIBRARIES ${QXMPP_LOCAL}/build/src/libqxmpp0.a) - ENDIF(WIN32 AND MSVC) + SET(QXMPP_LIBRARIES ${QXMPP_LOCAL}/build/src/libqxmpp0.a) ENDIF(QXMPP_INCLUDE_DIR) ENDIF(QXMPP_LOCAL) IF(QXMPP_LIBRARIES AND QXMPP_INCLUDE_DIR) IF(NOT QXMPP_LOCAL) SET(QXMPP_INCLUDE_DIR - ${QXMPP_INCLUDE_DIR}/qxmpp-dev ${QXMPP_INCLUDE_DIR}/qxmpp ) ENDIF(NOT QXMPP_LOCAL) @@ -48,9 +41,6 @@ ENDIF(QXMPP_LIBRARIES AND QXMPP_INCLUDE_DIR) IF(QXMPP_FOUND) MESSAGE(STATUS "Found QXmpp libraries at ${QXMPP_LIBRARIES}") MESSAGE(STATUS "Found QXmpp headers at ${QXMPP_INCLUDE_DIR}") - IF(WIN32) - MESSAGE(STATUS ${_WIN32_ADDITIONAL_MESS}) - ENDIF(WIN32) ELSE(QXMPP_FOUND) IF(QXMPP_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could NOT find required QXmpp library, aborting") -- 1.7.11.msysgit.1