From c11fc5de759fa645e301e50fbb4e794c80d1a117 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 7 Feb 2006 20:16:28 +0000 Subject: -move the find_package(PCRE) from kdelibs/CMakeLists.txt to kdelibs/kjs/CMakeLists.txt -add a check for regex.h in kjs/CMakeLists.txt and error out if neither PCRE nor regex.h have been found build kdelibs/win independent from the rest of kdelibs/ this means 1) run cmake on kdelibs/win/ 2) make kdelibs/win 3) install kdelibs/win 4) run cmake in kdelibs/ -> point it to the place where kdewin32 has been installed to 5) make kdelibs/ 6) make install Peter, can you please check that kdelibs/win/ builds and also installs this way ? It might still be possible that somewhere stuff from kdelibs/ is included directly. Also eventually $ENV{MSSDK}/include might have to be added in kdelibs/win/ ConfigureChecksWin.cmake is not used anymore, we can remove it if it works this way. Please check also that kdelibs/ configures correctly again. It is required that the include dir of kdewin32 is set. If all the HAVE_FOO_PROTO checks still fail, please post the error messages from CMakeError.log Alex CCMAIL: kde-buildsystem@kde.org CCMAIL: syntheticpp@gmx.net CCMAIL: bill.hoffman@kitware.com svn path=/trunk/KDE/kdelibs/; revision=506872 --- modules/FindKDE4.cmake | 69 ++++++++++++++++++++++++---------- modules/MacroOptionalFindPackage.cmake | 6 +++ 2 files changed, 55 insertions(+), 20 deletions(-) diff --git a/modules/FindKDE4.cmake b/modules/FindKDE4.cmake index d30e31f8..3a9b2dcf 100644 --- a/modules/FindKDE4.cmake +++ b/modules/FindKDE4.cmake @@ -81,7 +81,8 @@ IF(EXISTS ${CMAKE_SOURCE_DIR}/kdecore/kglobal.h) IF (WIN32) SET(KDE4_DCOPIDL_EXECUTABLE call ${CMAKE_SOURCE_DIR}/dcop/dcopidlng/dcopidl.bat ) - SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib ) + SET(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH} ) +# SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib ) # todo: copy Dlls only to ${CMAKE_BINARY_DIR}/lib ELSE (WIN32) SET(KDE4_DCOPIDL_EXECUTABLE ${CMAKE_SOURCE_DIR}/dcop/dcopidlng/dcopidl ) @@ -161,26 +162,54 @@ IF(UNIX AND NOT APPLE) ENDIF(UNIX AND NOT APPLE) -IF(CYGWIN) - MESSAGE(FATAL_ERROR "Support for Cygwin not yet implemented, please edit FindKDE4.cmake to enable it") -ENDIF(CYGWIN) - - -# windows, mingw -IF(MINGW) - SET( QT_AND_KDECORE_LIBS ${QT_AND_KDECORE_LIBS} kdewin32 ) - SET(_KDE4_PLATFORM_INCLUDE_DIRS ${KDE4_INCLUDE_DIR}/win/include ${KDE4_INCLUDE_DIR}/include/mingw ) - SET( CMAKE_INCLUDE_PATH ${KDE4_INCLUDE_DIR}/win/include ${KDE4_INCLUDE_DIR}/win/include/mingw ) -ENDIF(MINGW) - -# windows, microsoft compiler -IF(MSVC) - SET( QT_AND_KDECORE_LIBS ${QT_AND_KDECORE_LIBS} kdewin32 ) - SET( _KDE4_PLATFORM_INCLUDE_DIRS ${KDE4_INCLUDE_DIR}/win/include ${KDE4_INCLUDE_DIR}/win/include/msvc ) - SET( _KDE4_PLATFORM_DEFINITIONS -DKDE_FULL_TEMPLATE_EXPORT_INSTANTIATION -DWIN32_LEAN_AND_MEAN -DUNICODE ) - SET( CMAKE_INCLUDE_PATH ${KDE4_INCLUDE_DIR}/win/include ${KDE4_INCLUDE_DIR}/win/include/msvc ) -ENDIF(MSVC) +IF (WIN32) + + IF(CYGWIN) + MESSAGE(FATAL_ERROR "Support for Cygwin not yet implemented, please edit FindKDE4.cmake to enable it") + ENDIF(CYGWIN) + + + # at first find the kdewin32 library, this has to be compiled and installed before kdelibs/ + FIND_LIBRARY(KDEWIN32_LIBRARY NAMES kdewin32) + FIND_PATH(KDEWIN32_INCLUDE_DIR winposix_export.h) + + # kdelibs/win/ has to be built before the rest of kdelibs/ + # eventually it will be moved out from kdelibs/ + IF (NOT KDEWIN32_LIBRARY OR NOT KDEWIN32_INCLUDE_DIR) + MESSAGE(FATAL_ERROR "Could not find kdewin32 library, build and install kdelibs/win/ before building kdelibs/") + ENDIF (NOT KDEWIN32_LIBRARY OR NOT KDEWIN32_INCLUDE_DIR) + + IF(MINGW) + #mingw compiler + SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/mingw ${QT_INCLUDES}) + ELSE(MINGW) + # msvc compiler + SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/msvc ${QT_INCLUDES} ) + + # add the MS SDK include directory if available + SET(MS_SDK_DIR $ENV{MSSdk}) + IF (MS_SDK_DIR) + SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDES} ${MS_SDK_DIR}/include ) + ENDIF (MS_SDK_DIR) + + ENDIF(MINGW) + + SET( _KDE4_PLATFORM_INCLUDE_DIRS ${KDEWIN32_INCLUDES}) + SET( QT_AND_KDECORE_LIBS ${QT_AND_KDECORE_LIBS} ${KDEWIN32_LIBRARY} ) + SET( CMAKE_INCLUDE_PATH ${KDEWIN32_INCLUDES} ) + + # windows, mingw + IF(MINGW) + #hmmm, something special to do here ? + ENDIF(MINGW) + + # windows, microsoft compiler + IF(MSVC) + SET( _KDE4_PLATFORM_DEFINITIONS -DKDE_FULL_TEMPLATE_EXPORT_INSTANTIATION -DWIN32_LEAN_AND_MEAN -DUNICODE ) + ENDIF(MSVC) + +ENDIF (WIN32) # only on linux, but not e.g. on FreeBSD: diff --git a/modules/MacroOptionalFindPackage.cmake b/modules/MacroOptionalFindPackage.cmake index 4ad64a41..1b0cf1e7 100644 --- a/modules/MacroOptionalFindPackage.cmake +++ b/modules/MacroOptionalFindPackage.cmake @@ -11,6 +11,12 @@ MACRO(MACRO_OPTIONAL_FIND_PACKAGE _name ) OPTION(WITH_${_name} "Search for ${_name} package" ON) IF (WITH_${_name}) FIND_PACKAGE(${_name} ${ARGN}) + ELSE (WITH_${_name}) + SET(${_name}_FOUND) + SET(${_name}_INCLUDE_DIR) + SET(${_name}_INCLUDES) + SET(${_name}_LIBRARY) + SET(${_name}_LIBRARIES) ENDIF (WITH_${_name}) ENDMACRO(MACRO_OPTIONAL_FIND_PACKAGE) -- cgit v1.2.1