Re: [patch] fixes for compiling under mingw

2007-06-07 Thread Ralf Habacker
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 Qd4 for the debug libraries.
>>
>> so for every Q4 in a find_library statement i added an Qd4 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 ?
>
> Or reusing some variable which is set by FindKDEWin32Libs.cmake or something 
> like this ?
>   
May be this approach helps. I splitted KDEWIN32 and GNUWIN32 into a
KDEWIN and KDEWIN32 module.

The KDEWIN module looks in different locations for windows supplementary
installations in the order:

for mingw
   environment variable KDEWIN_DIR
/kdewin-mingw
/kdewin
/kdewin32
/gnuwin32

for msvc
   environment variable KDEWIN_DIR
/kdewin-msvc
/kdewin
/kdewin32
/gnuwin32

This module sets CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH for further
cmake modules in the configure process and for compiling.

The KDEWIN32 module then searches only for the kdewin32 library in the
predefined pathes

The GNUWIN32 module is now obsolate.

BTW: An extension of the KDEWIN module may be to be able to use more
than one path or additional directories like /win32libs



Ralf


# - Try to find the directory in which the kdewin32 library and other win32 
related libraries lives
# 
# Once done this will define
#
#  KDEWIN32_FOUND - system has KDEWIN32
#  KDEWIN32_INCLUDES - the KDEWIN32 include directories
#  KDEWIN32_LIBRARIES - The libraries needed to use KDEWIN32
#
# Copyright (c) 2006, Alexander Neundorf, <[EMAIL PROTECTED]>
# Copyright (c) 2007, Ralf Habacker, <[EMAIL PROTECTED]>
#
# 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 KDEWIN32_DIR)
if(NOT KDEWIN_FOUND)
  find_package(KDEWIN REQUIRED)
endif(NOT KDEWIN_FOUND)

find_path(KDEWIN32_INCLUDE_DIR winposix_export.h
  ${CMAKE_INCLUDE_PATH}
  ${CMAKE_INSTALL_PREFIX}/include
)
 
# search for kdewin32 in the default install directory for applications 
(default of (n)make install)

find_library(KDEWIN32_LIBRARY_DEBUG NAMES kdewin32d
  PATHS 
${CMAKE_LIBRARY_PATH}
${CMAKE_INSTALL_PREFIX}/lib
  NO_SYSTEM_ENVIRONMENT_PATH
)

find_library(KDEWIN32_LIBRARY_RELEASE NAMES kdewin32
  PATHS 
${CMAKE_LIBRARY_PATH}
${CMAKE_INSTALL_PREFIX}/lib
  NO_SYSTEM_ENVIRONMENT_PATH
)

# msvc makes a difference between debug and release
if(MSVC)
  find_library(KDEWIN32_LIBRARY_DEBUG NAMES kdewin32d
PATHS 
  ${CMAKE_LIBRARY_PATH
  ${CMAKE_INSTALL_PREFIX}/lib
NO_SYSTEM_ENVIRONMENT_PATH
  )
  if(MSVC_IDE)
# the ide needs the debug and release version
if( NOT KDEWIN32_LIBRARY_DEBUG OR NOT KDEWIN32_LIBRARY_RELEASE)
  message(FATAL_ERROR "\nCould NOT find the debug AND release version 
of the KDEWIN32 library.\nYou need to have both to use MSVC projects.\nPlease 
build and install both kdelibs/win/ libraries first.\n")
endif( NOT KDEWIN32_LIBRARY_DEBUG OR NOT KDEWIN32_LIBRARY_RELEASE)
SET(KDEWIN32_LIBRARY optimized ${KDEWIN32_LIBRARY_RELEASE} debug 
${KDEWIN32_LIBRARY_DEBUG})
  else(MSVC_IDE)
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
if(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
  set(KDEWIN32_LIBRARY ${KDEWIN32_LIBRARY_DEBUG})
else(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
  set(KDEWIN32_LIBRARY ${KDEWIN32_LIBRARY_RELEASE})
endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
  endif(MSVC_IDE) 
else(MSVC)
  if(KDEWIN32_LIBRARY_RELEASE)
  set(KDEWIN32_LIBRARY ${KDEWIN32_LIBRARY_RELEASE})
else(KDEWIN32_LIBRARY_RELEASE)
  set(KDEWIN32_LIBRARY ${KDEWIN32_LIBRARY_DEBUG})
endif(KDEWIN32_LIBRARY_RELEASE)
endif(MSVC)
  
# 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 needed system libs
  set(KDEWIN32_LIBRARIES ${KDEWIN32_LIBRARY} user32 shell32 ws2_

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 Qd4 for the debug libraries.

so for every Q4 in a find_library statement i added an Qd4 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


Re: [patch] fixes for compiling under mingw

2007-06-06 Thread Thiago Macieira
Alexander Neundorf wrote:
>Since which Qt release is this so ?

4.0.

The same applies to MacOS X (with _debug instead of d). It used to apply 
to other Unix as well, until Qt 4.2.0.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358


signature.asc
Description: This is a digitally signed message part.
___
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 Alexander Neundorf
On Wednesday 06 June 2007 18:04, you wrote:

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

I can't really comment on gnuwin32, kdewin32 etc. 

Formally it looks ok.

> 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 :-)

Cool :-)

Alex
___
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 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 Qd4 for the debug libraries.
> >
> > so for every Q4 in a find_library statement i added an Qd4
> > 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 Alexander Neundorf
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 Qd4 for the debug libraries.
>
> so for every Q4 in a find_library statement i added an Qd4 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 ?

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

Alex

___
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem


[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 Qd4 for the debug libraries.

so for every Q4 in a find_library statement i added an Qd4 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 NA