diff options
Diffstat (limited to 'modules/FindKDEWin.cmake')
-rw-r--r-- | modules/FindKDEWin.cmake | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/modules/FindKDEWin.cmake b/modules/FindKDEWin.cmake index 354ecb91..2c420b55 100644 --- a/modules/FindKDEWin.cmake +++ b/modules/FindKDEWin.cmake @@ -14,9 +14,10 @@ if (WIN32) - if (NOT KDEWIN_LIBRARIES) + if (NOT KDEWIN_LIBRARY) find_path(KDEWIN_INCLUDE_DIR kdewin_export.h + ${KDE4_INCLUDE_DIR} ${CMAKE_INCLUDE_PATH} ${CMAKE_INSTALL_PREFIX}/include ) @@ -24,50 +25,54 @@ if (WIN32) # search for kdewin in the default install directory for applications (default of (n)make install) FILE(TO_CMAKE_PATH "${CMAKE_LIBRARY_PATH}" _cmakeLibraryPathCmakeStyle) - if (CMAKE_BUILD_TYPE STREQUAL "Debug") + string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) + if (CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug") set (LIBRARY_NAME kdewind) - else (CMAKE_BUILD_TYPE STREQUAL "Debug") + else(CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug") set (LIBRARY_NAME kdewin) - endif (CMAKE_BUILD_TYPE STREQUAL "Debug") + endif (CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug") + if (MSVC_IDE ) + set (LIBRARY_NAME "kdewind") + endif (MSVC_IDE) find_library(KDEWIN_LIBRARY NAMES ${LIBRARY_NAME} PATHS + ${KDE4_LIB_DIR} ${_cmakeLibraryPathCmakeStyle} ${CMAKE_INSTALL_PREFIX}/lib NO_SYSTEM_ENVIRONMENT_PATH ) + endif (NOT KDEWIN_LIBRARY) - if (KDEWIN_LIBRARY AND KDEWIN_INCLUDE_DIR) - set(KDEWIN_FOUND TRUE) - # add needed system libs - set(KDEWIN_LIBRARIES ${KDEWIN_LIBRARY} user32 shell32 ws2_32 netapi32 userenv) - - if (MINGW) - #mingw compiler - set(KDEWIN_INCLUDES ${KDEWIN_INCLUDE_DIR} ${KDEWIN_INCLUDE_DIR}/mingw ${QT_INCLUDES}) - else (MINGW) - # msvc compiler - # add the MS SDK include directory if available - file(TO_CMAKE_PATH "$ENV{MSSDK}" MSSDK_DIR) - set(KDEWIN_INCLUDES ${KDEWIN_INCLUDE_DIR} ${KDEWIN_INCLUDE_DIR}/msvc ${QT_INCLUDES} ${MSSDK_DIR}) - endif (MINGW) - - endif (KDEWIN_LIBRARY AND KDEWIN_INCLUDE_DIR) - # required for configure - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN_INCLUDES}) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${KDEWIN_LIBRARIES}) + if (KDEWIN_LIBRARY AND KDEWIN_INCLUDE_DIR) + set(KDEWIN_FOUND TRUE) + # add needed system libs + set(KDEWIN_LIBRARIES ${KDEWIN_LIBRARY} user32 shell32 ws2_32 netapi32 userenv) - endif (NOT KDEWIN_LIBRARIES) + if (MINGW) + #mingw compiler + set(KDEWIN_INCLUDES ${KDEWIN_INCLUDE_DIR} ${KDEWIN_INCLUDE_DIR}/mingw ${QT_INCLUDES}) + else (MINGW) + # msvc compiler + # add the MS SDK include directory if available + file(TO_CMAKE_PATH "$ENV{MSSDK}" MSSDK_DIR) + set(KDEWIN_INCLUDES ${KDEWIN_INCLUDE_DIR} ${KDEWIN_INCLUDE_DIR}/msvc ${QT_INCLUDES} ${MSSDK_DIR}) + endif (MINGW) + + endif (KDEWIN_LIBRARY AND KDEWIN_INCLUDE_DIR) + # required for configure + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN_INCLUDES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${KDEWIN_LIBRARIES}) if (KDEWIN_FOUND) - if (NOT KDEWIN_FIND_QUIETLY) - message(STATUS "Found KDEWIN library: ${KDEWIN_LIBRARY}") - endif (NOT KDEWIN_FIND_QUIETLY) + if (NOT KDEWin_FIND_QUIETLY) + message(STATUS "Found KDEWin library: ${KDEWIN_LIBRARY}") + endif (NOT KDEWin_FIND_QUIETLY) else (KDEWIN_FOUND) - if (KDEWIN_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find KDEWIN library\nPlease install it first") - endif (KDEWIN_FIND_REQUIRED) + if (KDEWin_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find KDEWin library\nPlease install it first") + endif (KDEWin_FIND_REQUIRED) endif (KDEWIN_FOUND) endif (WIN32) |