diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2007-06-14 07:56:47 +0000 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2007-06-14 07:56:47 +0000 |
commit | e26ed1576a5f82dec72b13d1c6619f83237f6236 (patch) | |
tree | 8f72a1c29de9af99ae8c9fa8ca02366432ecd3fd /cmake/modules/FindKDEWIN.cmake | |
parent | 62f09b8bc6ca258a54a316b452d28f1c590d51c1 (diff) |
* cmake/modules/FindKDEWIN.cmake, cmake/modules/FindKDEWIN_Packager.cmake cmake/modules/Win32Macros.cmake: new files from the kdewin32 project
* cmake/CMakeLists.txt: cleaned support for kdewin installer and win32 explorer wrapper
Diffstat (limited to 'cmake/modules/FindKDEWIN.cmake')
-rw-r--r-- | cmake/modules/FindKDEWIN.cmake | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/cmake/modules/FindKDEWIN.cmake b/cmake/modules/FindKDEWIN.cmake new file mode 100644 index 00000000..3e40fd37 --- /dev/null +++ b/cmake/modules/FindKDEWIN.cmake @@ -0,0 +1,56 @@ +# - Try to find the KDEWIN library +# +# used environment vars +# KDEWIN_DIR - kdewin root dir +# +# this will define +# KDEWIN_FOUND - system has KDEWIN +# KDEWIN_DIR - the KDEWIN root installation dir +# +# Copyright (c) 2007, Ralf Habacker, <ralf.habacker@freenet.de> +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (WIN32) + IF (NOT KDEWIN_DIR) + # check for enviroment variable + file(TO_CMAKE_PATH "$ENV{KDEWIN_DIR}" KDEWIN_DIR) + if(NOT KDEWIN_DIR) + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _progFiles) + if (MINGW) + set (DIR "kdewin-mingw") + else (MINGW) + set (DIR "kdewin-msvc") + endif (MINGW) + + # search in the default program install folder + find_file(KDEWIN_DIR_tmp ${DIR} kdewin kdewin32 gnuwin32 + PATHS + "${_progFiles}" + ) + set (KDEWIN_DIR ${KDEWIN_DIR_tmp}) + endif (NOT KDEWIN_DIR) + if (KDEWIN_DIR) + message(STATUS "Found windows supplementary package location: ${KDEWIN_DIR}") + endif (KDEWIN_DIR) + endif (NOT KDEWIN_DIR) + + # this must be set every time + if (KDEWIN_DIR) + # add include path and library to all targets, this is required because + # cmake's 2.4.6 FindZLib.cmake does not use CMAKE_REQUIRED... vars + set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${KDEWIN_DIR}/include) + set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${KDEWIN_DIR}/lib) + + set (KDEWIN_FOUND 1) + else(KDEWIN_DIR) + message(STATUS "Could not find the location of the windows supplementary packages which is \n" + "\t\tenvironment variable KDEWIN_DIR\n" + "\t\t<ProgramFiles>/${DIR}\n" + "\t\t<ProgramFiles>/kdewin\n" + "\t\t<ProgramFiles>/kdewin32\n" + "\t\t<ProgramFiles>/gnuwin32\n") + endif(KDEWIN_DIR) + +endif (WIN32) |