diff options
-rw-r--r-- | Modules/FindLibLZMA.cmake | 69 | ||||
-rw-r--r-- | Modules/FindQt4.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/Darwin-icc.cmake | 9 | ||||
-rw-r--r-- | Modules/Platform/Darwin.cmake | 9 | ||||
-rw-r--r-- | Modules/Qt4Macros.cmake | 40 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Tests/CMakeOnly/AllFindModules/CMakeLists.txt | 2 |
7 files changed, 112 insertions, 25 deletions
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake new file mode 100644 index 0000000000..729f5ce732 --- /dev/null +++ b/Modules/FindLibLZMA.cmake @@ -0,0 +1,69 @@ +# - Find LibLZMA +# Find LibLZMA headers and library +# +# LIBLZMA_FOUND - True if liblzma is found. +# LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located. +# LIBLZMA_LIBRARIES - Lzma libraries to link against. +# LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required). +# LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required). +# LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required). +# LIBLZMA_VERSION_MAJOR - The major version of lzma +# LIBLZMA_VERSION_MINOR - The minor version of lzma +# LIBLZMA_VERSION_PATCH - The patch version of lzma +# LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3") + +#============================================================================= +# Copyright 2008 Per Øyvind Karlsen <peroyvind@mandriva.org> +# Copyright 2009 Alexander Neundorf <neundorf@kde.org> +# Copyright 2009 Helio Chissini de Castro <helio@kde.org> +# Copyright 2012 Mario Bensi <mbensi@ipsquad.net> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + + +FIND_PATH(LIBLZMA_INCLUDE_DIR lzma.h ) +FIND_LIBRARY(LIBLZMA_LIBRARY lzma) + +IF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h") + FILE(READ "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS) + + STRING(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}") + STRING(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}") + STRING(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}") + + SET(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}") +ENDIF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h") + +# We're using new code known now as XZ, even library still been called LZMA +# it can be found in http://tukaani.org/xz/ +# Avoid using old codebase +IF (LIBLZMA_LIBRARY) + INCLUDE(CheckLibraryExists) + CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER) + CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER) + CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET) +ENDIF (LIBLZMA_LIBRARY) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR + LIBLZMA_LIBRARY + LIBLZMA_HAS_AUTO_DECODER + LIBLZMA_HAS_EASY_ENCODER + LIBLZMA_HAS_LZMA_PRESET + VERSION_VAR LIBLZMA_VERSION_STRING + ) + +IF (LIBLZMA_FOUND) + SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY}) + SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR}) +ENDIF (LIBLZMA_FOUND) + +MARK_AS_ADVANCED( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY ) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index f9db5e1db8..391797eebe 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1059,7 +1059,11 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff ) SET( QT_INPUTMETHODS_PLUGINS qimsw_multi ) SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler ) - SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) + IF(APPLE) + SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) + ELSEIF(WIN32) + SET( QT_PHONON_BACKEND_PLUGINS phonon_ds9 ) + ENDIF() SET( QT_SCRIPT_PLUGINS qtscriptdbus ) SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds ) diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake index e675c0e922..b592e5f55c 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -106,7 +106,9 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE # default to searching for frameworks first -SET(CMAKE_FIND_FRAMEWORK FIRST) +IF(NOT DEFINED CMAKE_FIND_FRAMEWORK) + SET(CMAKE_FIND_FRAMEWORK FIRST) +ENDIF() # set up the default search directories for frameworks SET(CMAKE_SYSTEM_FRAMEWORK_PATH ~/Library/Frameworks @@ -115,7 +117,9 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH /System/Library/Frameworks) # default to searching for application bundles first -SET(CMAKE_FIND_APPBUNDLE FIRST) +IF(NOT DEFINED CMAKE_FIND_APPBUNDLE) + SET(CMAKE_FIND_APPBUNDLE FIRST) +ENDIF() # set up the default search directories for application bundles SET(CMAKE_SYSTEM_APPBUNDLE_PATH ~/Applications @@ -125,4 +129,3 @@ SET(CMAKE_SYSTEM_APPBUNDLE_PATH INCLUDE(Platform/UnixPaths) SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /sw/include) SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /sw/lib) - diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index a19bfe77ff..eff07b2958 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -228,9 +228,10 @@ SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>") - # default to searching for frameworks first -SET(CMAKE_FIND_FRAMEWORK FIRST) +IF(NOT DEFINED CMAKE_FIND_FRAMEWORK) + SET(CMAKE_FIND_FRAMEWORK FIRST) +ENDIF() # set up the default search directories for frameworks SET(CMAKE_SYSTEM_FRAMEWORK_PATH ~/Library/Frameworks @@ -239,7 +240,9 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH /System/Library/Frameworks) # default to searching for application bundles first -SET(CMAKE_FIND_APPBUNDLE FIRST) +IF(NOT DEFINED CMAKE_FIND_APPBUNDLE) + SET(CMAKE_FIND_APPBUNDLE FIRST) +ENDIF() # set up the default search directories for application bundles SET(_apps_paths) FOREACH(_path diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index f327125b25..f867bc51a1 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -182,23 +182,31 @@ MACRO (QT4_ADD_RESOURCES outfiles ) GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) GET_FILENAME_COMPONENT(rc_path ${infile} PATH) SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx) - # parse file for dependencies - # all files are absolute paths or relative to the location of the qrc file - FILE(READ "${infile}" _RC_FILE_CONTENTS) - STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}") + SET(_RC_DEPENDS) - FOREACH(_RC_FILE ${_RC_FILES}) - STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}") - IF(NOT IS_ABSOLUTE "${_RC_FILE}") - SET(_RC_FILE "${rc_path}/${_RC_FILE}") - ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}") - SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}") - ENDFOREACH(_RC_FILE) - # Since this cmake macro is doing the dependency scanning for these files, - # let's make a configured file and add it as a dependency so cmake is run - # again when dependencies need to be recomputed. - QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends) - CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY) + IF(EXISTS "${infile}") + # parse file for dependencies + # all files are absolute paths or relative to the location of the qrc file + FILE(READ "${infile}" _RC_FILE_CONTENTS) + STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}") + FOREACH(_RC_FILE ${_RC_FILES}) + STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}") + IF(NOT IS_ABSOLUTE "${_RC_FILE}") + SET(_RC_FILE "${rc_path}/${_RC_FILE}") + ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}") + SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}") + ENDFOREACH(_RC_FILE) + # Since this cmake macro is doing the dependency scanning for these files, + # let's make a configured file and add it as a dependency so cmake is run + # again when dependencies need to be recomputed. + QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends) + CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY) + ELSE(EXISTS "${infile}") + # The .qrc file does not exist (yet). Let's add a dependency and hope + # that it will be generated later + SET(out_depends) + ENDIF(EXISTS "${infile}") + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} COMMAND ${QT_RCC_EXECUTABLE} ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile} diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8afc51ebaa..1eb42beba6 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 8) SET(CMake_VERSION_PATCH 8) -SET(CMake_VERSION_TWEAK 20120602) +SET(CMake_VERSION_TWEAK 20120605) #SET(CMake_VERSION_RC 1) diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index fc65e58ff7..551cee3bc6 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -71,7 +71,7 @@ endmacro(check_version_string) # reported. foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HSPELL - JASPER LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB) + JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB) check_version_string(${VTEST} ${VTEST}_VERSION_STRING) endforeach(VTEST) |