[patch] fixes for compiling under mingw

2007-06-06 Thread Holger Schröder
Hi Alex, hi list,

i am trying to simplify compiling of kde on windows. for that i need to get 
some changed into kdelibs/cmake/modules.

most of them add a cmake variable for the prefix where to find a library, like 
gif, jpeg, etc.

and then there is a patch for findqt4.cmake.

the problem is, that the debug libs of qt 4 are nor found under windows, 
because they are named QFood4 for the debug libraries.

so for every Qfoo4 in a find_library statement i added an Qfood4 entry.


ok to commit ?

regards, Holger
Index: FindGIF.cmake
===
--- FindGIF.cmake	(Revision 672234)
+++ FindGIF.cmake	(Arbeitskopie)
@@ -14,11 +14,17 @@
   SET(GIF_FIND_QUIETLY TRUE)
 ENDIF (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
 
-FIND_PATH(GIF_INCLUDE_DIR gif_lib.h)
+FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
+  ${WIN32LIBS_INSTALL_PREFIX}/include
+)
 
-SET(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib)
-FIND_LIBRARY(GIF_LIBRARIES NAMES ${POTENTIAL_GIF_LIBS})
+SET(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
+FIND_LIBRARY(GIF_LIBRARIES NAMES ${POTENTIAL_GIF_LIBS}
+  PATHS
+  ${WIN32LIBS_INSTALL_PREFIX}/bin
+)
 
+
 IF (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
SET(CMAKE_REQUIRED_INCLUDES ${GIF_INCLUDE_DIR} ${CMAKE_REQUIRED_INCLUDES})
CHECK_STRUCT_MEMBER(GifFileType UserData gif_lib.h GIF_FOUND)
Index: FindPCRE.cmake
===
--- FindPCRE.cmake	(Revision 672234)
+++ FindPCRE.cmake	(Arbeitskopie)
@@ -19,18 +19,21 @@
 FIND_PATH(PCRE_INCLUDE_DIR pcre.h
  /usr/include/
  /usr/local/include/
+ ${WIN32LIBS_INSTALL_PREFIX}/include
 )
 
 FIND_LIBRARY(PCRE_PCRE_LIBRARY NAMES pcre
  PATHS
  /usr/lib
  /usr/local/lib
+ ${WIN32LIBS_INSTALL_PREFIX}/lib
 )
 
 FIND_LIBRARY(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix
  PATHS
  /usr/lib
  /usr/local/lib
+ ${WIN32LIBS_INSTALL_PREFIX}/lib
 )
 
 set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY} CACHE STRING The libraries needed to use PCRE)
Index: FindSharedMimeInfo.cmake
===
--- FindSharedMimeInfo.cmake	(Revision 672234)
+++ FindSharedMimeInfo.cmake	(Arbeitskopie)
@@ -21,7 +21,10 @@
 
 include (MacroEnsureVersion)
 
-find_program (UPDATE_MIME_DATABASE_EXECUTABLE NAMES update-mime-database)
+find_program (UPDATE_MIME_DATABASE_EXECUTABLE NAMES update-mime-database
+PATHS
+	${SHARED_MIME_INFO_INSTALL_PREFIX}/bin
+)
 
 if (UPDATE_MIME_DATABASE_EXECUTABLE)
 
Index: FindLibXml2.cmake
===
--- FindLibXml2.cmake	(Revision 672234)
+++ FindLibXml2.cmake	(Arbeitskopie)
@@ -28,12 +28,14 @@
 FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h
PATHS
${_LibXml2IncDir}
+   ${WIN32LIBS_INSTALL_PREFIX}/include
PATH_SUFFIXES libxml2
)
 
 FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
PATHS
${_LibXml2LinkDir}
+   ${WIN32LIBS_INSTALL_PREFIX}/lib
)
 
 IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
Index: FindPNG.cmake
===
--- FindPNG.cmake	(Revision 672234)
+++ FindPNG.cmake	(Arbeitskopie)
@@ -24,12 +24,16 @@
   /usr/local/include
   /usr/include
   /usr/local/include/libpng # OpenBSD
+  ${WIN32LIBS_INSTALL_PREFIX}/include
   )
 
-  SET(PNG_NAMES ${PNG_NAMES} png libpng)
+  SET(PNG_NAMES ${PNG_NAMES} png libpng png12)
   FIND_LIBRARY(PNG_LIBRARY
 NAMES ${PNG_NAMES}
-PATHS /usr/lib /usr/local/lib
+PATHS 
+/usr/lib 
+/usr/local/lib
+${WIN32LIBS_INSTALL_PREFIX}/bin
   )
 
   IF (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
Index: FindQt4.cmake
===
--- FindQt4.cmake	(Revision 672234)
+++ FindQt4.cmake	(Arbeitskopie)
@@ -643,13 +643,13 @@
   ELSE (QT_USE_FRAMEWORKS)
 
 # Set QT_QTCORE_LIBRARY by searching for a lib with QtCore.  as part of the filename
-FIND_LIBRARY(QT_QTCORE_LIBRARY NAMES QtCore QtCore4  PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )
+FIND_LIBRARY(QT_QTCORE_LIBRARY NAMES QtCore QtCore4 QtCored4  PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )
 
 # Set QT_QT3SUPPORT_LIBRARY
-FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support4 Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
 
 # Set QT_QTGUI_LIBRARY
-FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui4 QtGuid4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
 
 # Set QT_QTMOTIF_LIBRARY
 IF(Q_WS_X11)
@@ -657,33 +657,33 @@
 ENDIF(Q_WS_X11)
 
 # Set QT_QTNETWORK_LIBRARY
-FIND_LIBRARY(QT_QTNETWORK_LIBRARY NAMES QtNetwork QtNetwork4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+FIND_LIBRARY(QT_QTNETWORK_LIBRARY 

Re: [patch] fixes for compiling under mingw

2007-06-06 Thread Holger Schröder
On Wednesday 06 June 2007 23:53:00 you wrote:
 On Wednesday 06 June 2007 10:32, Holger Schröder wrote:
  Hi Alex, hi list,
 
  i am trying to simplify compiling of kde on windows. for that i need to
  get some changed into kdelibs/cmake/modules.
 
  most of them add a cmake variable for the prefix where to find a library,
  like gif, jpeg, etc.
 
  and then there is a patch for findqt4.cmake.
 
  the problem is, that the debug libs of qt 4 are nor found under windows,
  because they are named QFood4 for the debug libraries.
 
  so for every Qfoo4 in a find_library statement i added an Qfood4
  entry.

 Qt: ok
 Since which Qt release is this so ?

 For the other cmake modules: where do these variables come from ?
 STRIGI_INSTALL_PREFIX
 SHARED_MIMEINFO_INSTALL_PREFIX
 WIN32LIBS_INSTALL_PREFIX
 KDEWIN32_INSTALL_PREFIX


 If they have to be set manually this isn't a very good idea.
 How about setting CMAKE_PROGRAM/INCLUDE/LIBRARY_PATH ?

christian just told me about this possibility, what about this patch ?
(also asked christian and ralf about it, no feedback yet).

findwin32libs.cmake would be added, and findgnuwin32.cmake would be removed

 Or reusing some variable which is set by FindKDEWin32Libs.cmake or
 something like this ?

 Alex

i can play mahjonng under windows now :-)

regards, Holger
--- FindKDE4Internal.cmake	(Revision 672367)
+++ FindKDE4Internal.cmake	(Arbeitskopie)
@@ -533,9 +533,9 @@
 
# is GnuWin32 required or does e.g. Visual Studio provide an own implementation?
#find_package(GNUWIN32 REQUIRED)
-   find_package(GNUWIN32)
+   find_package(WIN32LIBS)
 
-   set( _KDE4_PLATFORM_INCLUDE_DIRS ${KDEWIN32_INCLUDES} ${GNUWIN32_INCLUDE_DIR})
+   set( _KDE4_PLATFORM_INCLUDE_DIRS ${KDEWIN32_INCLUDES} ${WIN32LIBS_INCLUDE_DIR})
 
# if we are compiling kdelibs, add KDEWIN32_LIBRARIES explicitely,
# otherwise they come from KDELibsDependencies.cmake, Alex

# Copyright (c) 2006, Peter Kuemmel, [EMAIL PROTECTED]
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

message( findwin32libs begin )

if (WIN32)

  IF (WIN32LIBS_INCLUDE_DIR)
# Already in cache, be silent
SET(WIN32LIBS_FIND_QUIETLY TRUE)
  ENDIF (WIN32LIBS_INCLUDE_DIR)

# check if WIN32LIBS_DIR is already set 
# (e.g. by command line argument or the calling script)
if(NOT WIN32LIBS_DIR)
# check for enviroment variable
file(TO_CMAKE_PATH $ENV{WIN32LIBS_DIR} WIN32LIBS_DIR)

# now check for deprecated GNUWIN32_DIR
if(NOT WIN32LIBS_DIR)
file(TO_CMAKE_PATH $ENV{GNUWIN32_DIR} WIN32LIBS_DIR)
endif(NOT WIN32LIBS_DIR)

if(NOT WIN32LIBS_DIR)
# search in the default program install folder
file(TO_CMAKE_PATH $ENV{PROGRAMFILES} _progFiles)
find_file(WIN32LIBS_DIR_tmp win32libs gnuwin32 
PATHS
${_progFiles}
C:/ D:/ E:/ F:/ G:/
)
set(WIN32LIBS_DIR ${WIN32LIBS_DIR_tmp})
endif(NOT WIN32LIBS_DIR)
endif(NOT WIN32LIBS_DIR)

if (WIN32LIBS_DIR)
   set(WIN32LIBS_INCLUDE_DIR ${WIN32LIBS_DIR}/include)
   set(WIN32LIBS_LIBRARY_DIR ${WIN32LIBS_DIR}/lib)
   set(WIN32LIBS_BINARY_DIR  ${WIN32LIBS_DIR}/bin)
   set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${WIN32LIBS_INCLUDE_DIR})
   set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${WIN32LIBS_LIBRARY_DIR})
   set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${WIN32LIBS_BINARY_DIR})
   set(WIN32LIBS_FOUND TRUE)
else (WIN32LIBS_DIR)
   set(WIN32LIBS_FOUND)
endif (WIN32LIBS_DIR)

if (WIN32LIBS_FOUND)
  if (NOT WIN32LIBS_FIND_QUIETLY)
message(STATUS Found Win32Libs: ${WIN32LIBS_DIR})
  endif (NOT WIN32LIBS_FIND_QUIETLY)
else (WIN32LIBS_FOUND)
  if (WIN32LIBS_FIND_REQUIRED)
message(FATAL_ERROR Could NOT find Win32Libs)
  endif (WIN32LIBS_FIND_REQUIRED)
endif (WIN32LIBS_FOUND)

endif (WIN32)

message( findwin32libs end )
___
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem


Re: [patch] fixes for compiling under mingw

2007-06-06 Thread Christian Ehrlicher

Alexander Neundorf schrieb:

On Wednesday 06 June 2007 10:32, Holger Schröder wrote:

Hi Alex, hi list,

i am trying to simplify compiling of kde on windows. for that i need to get
some changed into kdelibs/cmake/modules.

most of them add a cmake variable for the prefix where to find a library,
like gif, jpeg, etc.

and then there is a patch for findqt4.cmake.

the problem is, that the debug libs of qt 4 are nor found under windows,
because they are named QFood4 for the debug libraries.

so for every Qfoo4 in a find_library statement i added an Qfood4 entry.


Qt: ok
Since which Qt release is this so ?

Maybe try to reuse the existing msvc stuff to distinguish between debug 
and release libs.


Christian



signature.asc
Description: OpenPGP digital signature
___
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem