From 139e74d81f6e0f7a50ba114328d97726b43d3497 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Wed, 6 Jan 2010 22:09:54 +0000 Subject: bugfix: this macro did actually in most cases not work as it should, since most find-modules set UPPERCASE_FOUND, while this set only CamelCase_FOUND. Now it sets both. Alex CCMAIL: vkrause@kde.org svn path=/trunk/KDE/kdelibs/; revision=1070843 --- modules/MacroOptionalFindPackage.cmake | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/modules/MacroOptionalFindPackage.cmake b/modules/MacroOptionalFindPackage.cmake index f09952f3..d4ed48e3 100644 --- a/modules/MacroOptionalFindPackage.cmake +++ b/modules/MacroOptionalFindPackage.cmake @@ -7,22 +7,42 @@ # The standard _FOUND variables can be used in the same way # as when using the normal FIND_PACKAGE() -# Copyright (c) 2006, Alexander Neundorf, +# Copyright (c) 2006-2010 Alexander Neundorf, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# This is just a helper macro to set a bunch of variables empty. +# We don't know whether the package uses UPPERCASENAME or CamelCaseName, so we try both: +macro(_MOFP_SET_EMPTY_IF_DEFINED _name _var) + if(DEFINED ${_name}_${_var}) + set(${_name}_${_var} "") + endif(DEFINED ${_name}_${_var}) + + string(TOUPPER ${_name} _nameUpper) + if(DEFINED ${_nameUpper}_${_var}) + set(${_nameUpper}_${_var} "") + endif(DEFINED ${_nameUpper}_${_var}) +endmacro(_MOFP_SET_EMPTY_IF_DEFINED _package _var) + 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) + string(TOUPPER ${_name} _nameUpper) + set(${_name}_FOUND FALSE) + set(${_nameUpper}_FOUND FALSE) + + _mofp_set_empty_if_defined(${_name} INCLUDE_DIRS) + _mofp_set_empty_if_defined(${_name} INCLUDE_DIR) + _mofp_set_empty_if_defined(${_name} INCLUDES) + _mofp_set_empty_if_defined(${_name} LIBRARY) + _mofp_set_empty_if_defined(${_name} LIBRARIES) + _mofp_set_empty_if_defined(${_name} LIBS) + _mofp_set_empty_if_defined(${_name} FLAGS) + _mofp_set_empty_if_defined(${_name} DEFINITIONS) endif (WITH_${_name}) endmacro (MACRO_OPTIONAL_FIND_PACKAGE) -- cgit v1.2.1 From 028b0d21b6bcdad6ae71bb35748261af900d492c Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Wed, 6 Jan 2010 22:17:39 +0000 Subject: -setting QUIETLY manually is not necessary, this is handled automatically by find_package_handle_standard_args() -the first argument to find_package_handle_standard_args() should be the exact-case name of the Find-module, i.e. "LibAttica", not "libattica" Frederik: if you really want to see this as "libattica", then the module has to be renamed to "Findlibattica.cmake", which is also ok and we still have the time to do it since this file has not been part of a release yet. Alex CCMAIL: CCMAIL: svn path=/trunk/KDE/kdelibs/; revision=1070847 --- modules/FindLibAttica.cmake | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/FindLibAttica.cmake b/modules/FindLibAttica.cmake index f901075a..b9b0610a 100644 --- a/modules/FindLibAttica.cmake +++ b/modules/FindLibAttica.cmake @@ -14,11 +14,6 @@ IF (NOT LIBATTICA_MIN_VERSION) SET(LIBATTICA_MIN_VERSION "0.1.0") ENDIF(NOT LIBATTICA_MIN_VERSION) -IF (LIBATTICA_INCLUDE_DIR AND LIBATTICA_LIBRARIES) - # in cache already - SET(libattica_FIND_QUIETLY TRUE) -ENDIF (LIBATTICA_INCLUDE_DIR AND LIBATTICA_LIBRARIES) - IF (NOT WIN32) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls @@ -59,10 +54,9 @@ FIND_LIBRARY(LIBATTICA_LIBRARIES NAMES attica libattica ) INCLUDE(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set ATTICA_FOUND to TRUE if +# handle the QUIETLY and REQUIRED arguments and set LIBATTICA_FOUND to TRUE if # all listed variables are TRUE -FIND_PACKAGE_HANDLE_STANDARD_ARGS(libattica DEFAULT_MSG LIBATTICA_LIBRARIES LIBATTICA_INCLUDE_DIR LIBATTICA_VERSION_OK) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibAttica DEFAULT_MSG LIBATTICA_LIBRARIES LIBATTICA_INCLUDE_DIR LIBATTICA_VERSION_OK) MARK_AS_ADVANCED(LIBATTICA_INCLUDE_DIR LIBATTICA_LIBRARIES) - -- cgit v1.2.1 From be71e39f528e26bfc1ff97ef2b615bc515342a05 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Wed, 6 Jan 2010 22:22:22 +0000 Subject: -introduce imported targets for the various Qt4 libraries, so we can handle the release- and debug-libraries finally properly. Tested on my machine with Linux with kdelibs, kdeutils and some other module, and also tested under Windows by Saro. If you suddenly get strange linking-related errors with Qt4 libraries, please let me know ASAP. This should also help the installation of KDE under Windows, since with these imported Qt libraries the location of the Qt-libraries is not fixed at kdelibs-buildtime anymore (for the installed dependencies-file), but determined at 3rd-party cmake-time. So different locations of Qt on a Windows-development machine should be no problem anymore. (I'd like to have some feedback on this ) Alex CCMAIL: kde-windows@kde.org CCMAIL: kde-buildsystem@kde.org CCMAIL: svn path=/trunk/KDE/kdelibs/; revision=1070849 --- modules/FindQt4.cmake | 57 ++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/modules/FindQt4.cmake b/modules/FindQt4.cmake index 864828f8..941e2e40 100644 --- a/modules/FindQt4.cmake +++ b/modules/FindQt4.cmake @@ -892,38 +892,35 @@ IF (QT4_QMAKE_FOUND) ############################################ MACRO (_QT4_ADJUST_LIB_VARS basename) +# message(STATUS "Adjusting ${basename}, release: -${QT_${basename}_LIBRARY_RELEASE}- debug: -${QT_${basename}_LIBRARY_DEBUG}-") IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) + ADD_LIBRARY(Qt4__${basename} SHARED IMPORTED ) - # if the release- as well as the debug-version of the library have been found: - IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) - # if the generator supports configuration types then set - # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) - ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - # if there are no configuration types and CMAKE_BUILD_TYPE has no value - # then just use the release libraries - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} ) - ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) - ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) - - # if only the release version was found, set the debug variable also to the release version - IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) - SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE}) - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE}) - SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE}) - ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) - - # if only the debug version was found, set the release variable also to the debug version - IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) - SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG}) - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG}) - SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG}) - ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) - - # put the value in the cache: - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE) + IF(WIN32) + SET(_QT4_LIBRARY_PROPERTY_NAME IMPLIB) + ELSE(WIN32) + SET(_QT4_LIBRARY_PROPERTY_NAME LOCATION) + ENDIF(WIN32) + + + IF (QT_${basename}_LIBRARY_RELEASE) + SET_PROPERTY(TARGET Qt4__${basename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + SET_PROPERTY(TARGET Qt4__${basename} PROPERTY IMPORTED_${_QT4_LIBRARY_PROPERTY_NAME}_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" ) +# message(STATUS "Setting IMPORTED_LOCATION_RELEASE to -${QT_${basename}_LIBRARY_RELEASE}-") + ENDIF (QT_${basename}_LIBRARY_RELEASE) + + IF (QT_${basename}_LIBRARY_DEBUG) + SET_PROPERTY(TARGET Qt4__${basename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + SET_PROPERTY(TARGET Qt4__${basename} PROPERTY IMPORTED_${_QT4_LIBRARY_PROPERTY_NAME}_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" ) + +# message(STATUS "Setting IMPORTED_LOCATION_DEBUG to -${QT_${basename}_LIBRARY_DEBUG}-") + + SET_PROPERTY(TARGET Qt4__${basename} PROPERTY MAP_IMPORTED_CONFIG_PROFILE DEBUG) + SET_PROPERTY(TARGET Qt4__${basename} PROPERTY MAP_IMPORTED_CONFIG_DEBUGFULL DEBUG) + ENDIF (QT_${basename}_LIBRARY_DEBUG) + + SET(QT_${basename}_LIBRARY Qt4__${basename} ) + SET(QT_${basename}_LIBRARIES Qt4__${basename} ) IF (QT_${basename}_LIBRARY) SET(QT_${basename}_FOUND 1) -- cgit v1.2.1 From 9ca55bb491d713c96e83b16845e0599f98c05de0 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 7 Jan 2010 15:44:17 +0000 Subject: we need 2.6.3 for the shared-desktop-ontologies detection svn path=/trunk/KDE/kdelibs/; revision=1071123 --- modules/FindKDE4Internal.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index c6f5599e..672a6db5 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -275,7 +275,7 @@ # this is required now by cmake 2.6 and so must not be skipped by if(KDE4_FOUND) below -cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) +cmake_minimum_required(VERSION 2.6.3 FATAL_ERROR) # set the cmake policies to the 2.4.x compatibility settings (may change for KDE 4.3) cmake_policy(VERSION 2.4.5) -- cgit v1.2.1 From b22257ac18459a4dfbd6a42e0ac14472cd8f13ea Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Thu, 7 Jan 2010 17:53:58 +0000 Subject: we require CMake 2.6.2 or KDE, nothing else has been announced, discussed or even suggested Alex CCMAIL: kde-buildsystem@kde.org CCMAIL: mueller@kde.org svn path=/trunk/KDE/kdelibs/; revision=1071192 --- modules/FindKDE4Internal.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index 672a6db5..c6f5599e 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -275,7 +275,7 @@ # this is required now by cmake 2.6 and so must not be skipped by if(KDE4_FOUND) below -cmake_minimum_required(VERSION 2.6.3 FATAL_ERROR) +cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) # set the cmake policies to the 2.4.x compatibility settings (may change for KDE 4.3) cmake_policy(VERSION 2.4.5) -- cgit v1.2.1 From 1c966e86fcb333b72f65588a0ded697889bf378b Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Thu, 7 Jan 2010 18:39:34 +0000 Subject: -make cmake 2.6.2 find SDO 0.2 This didn't work since SDO 0.2 installs its files into share/cmake/SDO/, which is supported by cmake >= 2.6.3, but not by 2.6.2, which KDE requires. It would be nice if SDO would install it into share/SDO/ or share/SDO/cmake, then it would be found automatically by cmake 2.6.2 and also 2.6.3 and all newer versions. Alex CCMAIL: kde-buildsystem@kde.org CCMAIL: mueller@kde.org CCMAIL: release-team@kde.org CCMAIL: trueg@kde.org CCMAIL: kde-packagers@kde.org svn path=/trunk/KDE/kdelibs/; revision=1071218 --- modules/FindSharedDesktopOntologies.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/FindSharedDesktopOntologies.cmake b/modules/FindSharedDesktopOntologies.cmake index 2bca1df3..eecd608a 100644 --- a/modules/FindSharedDesktopOntologies.cmake +++ b/modules/FindSharedDesktopOntologies.cmake @@ -21,7 +21,14 @@ # First try the SharedDesktopOntologiesConfig.cmake from shared-desktop-ontologies 0.2 and newer -find_package(SharedDesktopOntologies ${SharedDesktopOntologies_FIND_VERSION} QUIET NO_MODULE) + +# This is to make it work with cmake 2.6.2, since SDO 0.2 installs its config file into +# the 2.6.3 compatible location only ( share/cmake/SDO/ instead share/SDO/[cmake/] ) +if( "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.6.3") + find_path(_SDO_CONFIG_DIR SharedDesktopOntologiesConfig.cmake PATH_SUFFIXES share/cmake/SharedDesktopOntologies/ ) +endif( "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.6.3") + +find_package(SharedDesktopOntologies ${SharedDesktopOntologies_FIND_VERSION} QUIET NO_MODULE HINTS "${_SDO_CONFIG_DIR}" ) if (SHAREDDESKTOPONTOLOGIES_ROOT_DIR) mark_as_advanced(SHAREDDESKTOPONTOLOGIES_ROOT_DIR) -- cgit v1.2.1 From d75c51be7b462e488f91c71fb83c49b8ccc5794f Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 11 Jan 2010 20:12:40 +0000 Subject: -fix handling of imported targets which don't have the link interface libraries property set, and also fix it on Windows Alex CCMAIL: CCMAIL: christoph@maxiom.de svn path=/trunk/KDE/kdelibs/; revision=1073213 --- .../HandleImportedTargetsInCMakeRequiredLibraries.cmake | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake b/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake index 28564ab6..e28efd44 100644 --- a/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake +++ b/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake @@ -44,15 +44,23 @@ FUNCTION(HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES _RESULT) ENDIF ("${_CCSR_LOOP_COUNTER}" LESS 100) LIST(GET _importedConfigs 0 _firstImportedConfig) - GET_TARGET_PROPERTY(_firstImportedLocation ${_CURRENT_LIB} LOCATION_${_firstImportedConfig}) + IF(NOT WIN32) + GET_TARGET_PROPERTY(_firstImportedLocation ${_CURRENT_LIB} IMPORTED_LOCATION_${_firstImportedConfig}) + ELSE(NOT WIN32) + GET_TARGET_PROPERTY(_firstImportedLocation ${_CURRENT_LIB} IMPORTED_IMPLIB_${_firstImportedConfig}) + ENDIF(NOT WIN32) GET_TARGET_PROPERTY(_linkInterfaceLibs ${_CURRENT_LIB} IMPORTED_LINK_INTERFACE_LIBRARIES_${_firstImportedConfig} ) LIST(APPEND _CCSR_NEW_REQ_LIBS ${_firstImportedLocation}) # MESSAGE(STATUS "Appending lib ${_CURRENT_LIB} as ${_firstImportedLocation}") - FOREACH(_currentLinkInterfaceLib ${_linkInterfaceLibs}) + IF(_linkInterfaceLibs) + FOREACH(_currentLinkInterfaceLib ${_linkInterfaceLibs}) # MESSAGE(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}") - LIST(APPEND _CCSR_NEW_REQ_LIBS ${_currentLinkInterfaceLib} ) - ENDFOREACH(_currentLinkInterfaceLib ${_linkInterfaceLibs}) + IF(_currentLinkInterfaceLib) + LIST(APPEND _CCSR_NEW_REQ_LIBS ${_currentLinkInterfaceLib} ) + ENDIF(_currentLinkInterfaceLib) + ENDFOREACH(_currentLinkInterfaceLib ${_linkInterfaceLibs}) + ENDIF(_linkInterfaceLibs) ELSE(_importedConfigs) # "Normal" libraries are just used as they are. LIST(APPEND _CCSR_NEW_REQ_LIBS ${_CURRENT_LIB} ) -- cgit v1.2.1