diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-02-12 14:38:04 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-02-12 14:38:04 +0000 |
commit | 75a07dd38b4a491a9d16d24492bea5c6ba90a8ff (patch) | |
tree | 0a65094e22bba335545b8ffe4a33fe7790edb21c /modules/FindKDEWIN32.cmake | |
parent | bce40e0de3b22a291ecaa2b75358e6a998e1579b (diff) | |
download | extra-cmake-modules-75a07dd38b4a491a9d16d24492bea5c6ba90a8ff.tar.gz extra-cmake-modules-75a07dd38b4a491a9d16d24492bea5c6ba90a8ff.tar.bz2 |
-moved the cmake code to find kdewin32 out of FindKDE4.cmake and into its own FindKDEWIN32.cmake file
-added a new FindGNUWIN32.cmake file, which tries to find the gnuwin32 base directory
-changed all "FOO_LIBRARY" variable names to "FOO_LIBRARIES" to be more consistent with the other cmake modules
-added a macro_getenv_win_path() which replaces all backslahes with slashes from environment variables
-modified the kde4_add_kcfg_files() command, so that the generated header is also processed by moc
-all tests compile and link
Alex
CCMAIL:kde-buildsystem@kde.org
The changes to the windows stuff are untested, since I don't have a windows box.
Please check that everything still works. Please have a look at FindGNUWIN32.cmake,
there are probably ways to improve this. The resulting GNUWIN32_DIR variable is used in other
cmake modules as default path to search for headers and libraries.
svn path=/trunk/KDE/kdelibs/; revision=508648
Diffstat (limited to 'modules/FindKDEWIN32.cmake')
-rw-r--r-- | modules/FindKDEWIN32.cmake | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/modules/FindKDEWIN32.cmake b/modules/FindKDEWIN32.cmake new file mode 100644 index 00000000..131c0354 --- /dev/null +++ b/modules/FindKDEWIN32.cmake @@ -0,0 +1,58 @@ +# - Try to find the KDEWIN32 library +# Once done this will define +# +# KDEWIN32_FOUND - system has KDEWIN32 +# KDEWIN32_INCLUDES - the KDEWIN32 include directories +# KDEWIN32_LIBRARIES - The libraries needed to use KDEWIN32 + +IF (WIN32) + +INCLUDE(MacroGetenvWinPath) + +MACRO_GETENV_WIN_PATH(_program_FILES_DIR PROGRAMFILES) + +FIND_PACKAGE(Qt4 REQUIRED) + +FIND_PATH(KDEWIN32_INCLUDE_DIR winposix_export.h + ${_program_FILES_DIR}/kdewin32/include +) + + +# at first find the kdewin32 library, this has to be compiled and installed before kdelibs/ +# search for kdewin32 in the default install directory for applications (default of (n)make install) +FIND_LIBRARY(KDEWIN32_LIBRARY NAMES kdewin32 + PATHS + ${_program_FILES_DIR}/kdewin32/lib +) + + +# kdelibs/win/ has to be built before the rest of kdelibs/ +# eventually it will be moved out from kdelibs/ +IF (KDEWIN32_LIBRARY AND KDEWIN32_INCLUDE_DIR) + SET(KDEWIN32_FOUND TRUE) + # add the winsock2 library, using find_library or something like this would probably be better + SET(KDEWIN32_LIBRARIES ${KDEWIN32_LIBRARY} user32 shell32 ws2_32) + + IF(MINGW) + #mingw compiler + SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/mingw ${QT_INCLUDES}) + ELSE(MINGW) + # msvc compiler + # add the MS SDK include directory if available + MACRO_GETENV_WIN_PATH(MSSDK_DIR MSSDK) + SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/msvc ${QT_INCLUDES} ${MSSDK_DIR}) + ENDIF(MINGW) + +ENDIF (KDEWIN32_LIBRARY AND KDEWIN32_INCLUDE_DIR) + +IF (KDEWIN32_FOUND) + IF (NOT KDEWIN32_FIND_QUIETLY) + MESSAGE(STATUS "Found KDEWIN32: ${KDEWIN32_LIBRARY}") + ENDIF (NOT KDEWIN32_FIND_QUIETLY) +ELSE (KDEWIN32_FOUND) + IF (KDEWIN32_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find KDEWIN32 library") + ENDIF (KDEWIN32_FIND_REQUIRED) +ENDIF (KDEWIN32_FOUND) + +ENDIF (WIN32) |