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 Q<Foo>d4 for the debug libraries.
>>
>> so for every Q<foo>4 in a find_library statement i added an Q<foo>d4 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
<ProgramFiles>/kdewin-mingw
<ProgramFiles>/kdewin
<ProgramFiles>/kdewin32
<ProgramFiles>/gnuwin32
for msvc
environment variable KDEWIN_DIR
<ProgramFiles>/kdewin-msvc
<ProgramFiles>/kdewin
<ProgramFiles>/kdewin32
<ProgramFiles>/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 <ProgramFiles>/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_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
file(TO_CMAKE_PATH "$ENV{MSSDK}" MSSDK_DIR)
set(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR}
${KDEWIN32_INCLUDE_DIR}/msvc ${QT_INCLUDES} ${MSSDK_DIR})
endif (MINGW)
endif (KDEWIN32_LIBRARY AND KDEWIN32_INCLUDE_DIR)
# required for configure
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN32_INCLUDES})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
${KDEWIN32_LIBRARIES})
endif (NOT KDEWIN32_DIR)
if (KDEWIN32_FOUND)
if (NOT KDEWIN32_FIND_QUIETLY)
message(STATUS "Found kdewin32 library: ${KDEWIN32_LIBRARY}")
endif (NOT KDEWIN32_FIND_QUIETLY)
else (KDEWIN32_FOUND)
if (KDEWIN32_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find KDEWIN32 library\nPlease install it
first")
endif (KDEWIN32_FIND_REQUIRED)
endif (KDEWIN32_FOUND)
endif (WIN32)
# - 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, <[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 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)
set (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)
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem