diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeGenericSystem.cmake | 6 | ||||
-rw-r--r-- | Modules/CPackRPM.cmake | 5 | ||||
-rw-r--r-- | Modules/FindBZip2.cmake | 10 | ||||
-rw-r--r-- | Modules/FindLibLZMA.cmake | 69 | ||||
-rw-r--r-- | Modules/FindPythonLibs.cmake | 10 | ||||
-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-- | Modules/UseJava.cmake | 4 |
10 files changed, 137 insertions, 31 deletions
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index c733969..0ccbfac 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -60,6 +60,12 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles") ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") +IF(CMAKE_GENERATOR MATCHES "Ninja") + SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL + "Enable/Disable output of compile commands during generation." + ) + MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS) +ENDIF(CMAKE_GENERATOR MATCHES "Ninja") # GetDefaultWindowsPrefixBase # diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index cba746f..ae93512 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -488,7 +488,10 @@ FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") ENDIF(CPACK_RPM_PACKAGE_DEBUG) SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") -ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) + ELSE(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) + # Do not forget to unset previously set header (from previous component) + UNSET(TMP_RPM_${_RPM_SPEC_HEADER}) + ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) ENDFOREACH(_RPM_SPEC_HEADER) # CPACK_RPM_SPEC_INSTALL_POST diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake index 7130192..ce7f255 100644 --- a/Modules/FindBZip2.cmake +++ b/Modules/FindBZip2.cmake @@ -22,11 +22,15 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ) +SET(_BZIP2_PATHS PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]" + ) + +FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include) IF (NOT BZIP2_LIBRARIES) - FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ) - FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d ) + FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib) + FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(BZIP2) diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake new file mode 100644 index 0000000..729f5ce --- /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/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index 478ebcb..11ff196 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -45,13 +45,19 @@ IF(PythonLibs_FIND_VERSION) STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}") STRING(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}") UNSET(_PYTHON_FIND_OTHER_VERSIONS) - IF(NOT PythonLibs_FIND_VERSION_EXACT) + IF(PythonLibs_FIND_VERSION_EXACT) + IF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}") + ELSE(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}") + ENDIF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + ELSE(PythonLibs_FIND_VERSION_EXACT) FOREACH(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) IF(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) LIST(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) ENDIF() ENDFOREACH() - ENDIF(NOT PythonLibs_FIND_VERSION_EXACT) + ENDIF(PythonLibs_FIND_VERSION_EXACT) UNSET(_PYTHON_FIND_MAJ_MIN) UNSET(_PYTHON_FIND_MAJ) ELSE(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index f9db5e1..391797e 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 e675c0e..b592e5f 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 a19bfe7..eff07b2 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 f327125..f867bc5 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/Modules/UseJava.cmake b/Modules/UseJava.cmake index 30cc920..0b2d1b8 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -533,9 +533,9 @@ function (find_jar VARIABLE) endif (${_state} STREQUAL "name") endforeach (arg ${ARGN}) - if (${_jar_names} STREQUAL "") + if (NOT _jar_names) message(FATAL_ERROR "find_jar: No name to search for given") - endif (${_jar_names} STREQUAL "") + endif (NOT _jar_names) foreach (jar_name ${_jar_names}) foreach (version ${_jar_versions}) |