diff options
author | Brad King <brad.king@kitware.com> | 2010-12-17 15:32:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-12-17 15:32:01 (GMT) |
commit | ad25a968b9e47e9e966d166dd0e494dc684ebd66 (patch) | |
tree | 5638f53977907708fd7473f5b3c9a582a36a1a92 /Modules | |
parent | c128abe383e2f08e3f3e916f9b64356ca47056d1 (diff) | |
parent | 78c86f454272a2ac417ad6a89e4c7ed7e4975adb (diff) | |
download | CMake-ad25a968b9e47e9e966d166dd0e494dc684ebd66.zip CMake-ad25a968b9e47e9e966d166dd0e494dc684ebd66.tar.gz CMake-ad25a968b9e47e9e966d166dd0e494dc684ebd66.tar.bz2 |
Merge branch 'ImprovedDotSupport2' into dev/strict-mode
Conflicts:
Source/cmake.cxx
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeCInformation.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeCXXInformation.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeDetermineVSServicePack.cmake | 6 | ||||
-rw-r--r-- | Modules/CMakeFortranInformation.cmake | 2 | ||||
-rw-r--r-- | Modules/CPackDeb.cmake | 38 | ||||
-rw-r--r-- | Modules/CPackRPM.cmake | 6 | ||||
-rw-r--r-- | Modules/ExternalProject.cmake | 21 | ||||
-rw-r--r-- | Modules/FindBoost.cmake | 25 | ||||
-rw-r--r-- | Modules/FindCUDA.cmake | 8 | ||||
-rw-r--r-- | Modules/FindHDF5.cmake | 2 | ||||
-rw-r--r-- | Modules/FindMPI.cmake | 3 | ||||
-rw-r--r-- | Modules/FindPythonLibs.cmake | 2 | ||||
-rw-r--r-- | Modules/FindQt4.cmake | 73 | ||||
-rw-r--r-- | Modules/FindSubversion.cmake | 7 | ||||
-rw-r--r-- | Modules/GetPrerequisites.cmake | 51 |
15 files changed, 168 insertions, 80 deletions
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake index 578aff9..86a824a 100644 --- a/Modules/CMakeCInformation.cmake +++ b/Modules/CMakeCInformation.cmake @@ -26,6 +26,8 @@ ELSE(UNIX) SET(CMAKE_C_OUTPUT_EXTENSION .obj) ENDIF(UNIX) +SET(_INCLUDED_FILE 0) + # Load compiler-specific information. IF(CMAKE_C_COMPILER_ID) INCLUDE(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL) diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index 869894c..680f8fd 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -26,6 +26,8 @@ ELSE(UNIX) SET(CMAKE_CXX_OUTPUT_EXTENSION .obj) ENDIF(UNIX) +SET(_INCLUDED_FILE 0) + # Load compiler-specific information. IF(CMAKE_CXX_COMPILER_ID) INCLUDE(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL) diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake index 8e4eb34..a877e6e 100644 --- a/Modules/CMakeDetermineVSServicePack.cmake +++ b/Modules/CMakeDetermineVSServicePack.cmake @@ -23,8 +23,8 @@ # =========================== #============================================================================= -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman <philip@yhbt.com> +# Copyright 2009-2010 Kitware, Inc. +# Copyright 2009-2010 Philip Lowman <philip@yhbt.com> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -47,6 +47,8 @@ function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version) set(_version "vc90") elseif(${_cl_version} VERSION_EQUAL "15.00.30729.01") set(_version "vc90sp1") + elseif(${_cl_version} VERSION_EQUAL "16.00.30319.01") + set(_version "vc100") else() set(_version "") endif() diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index cdb8038..f6a52c6 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -16,6 +16,8 @@ # It also loads the available platform file for the system-compiler # if it exists. +SET(_INCLUDED_FILE 0) + # Load compiler-specific information. IF(CMAKE_Fortran_COMPILER_ID) INCLUDE(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 07d6ff9..98d40d6 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -62,7 +62,43 @@ # Default : - # May be set when invoking cpack in order to trace debug informations # during CPackDeb run. - +# CPACK_DEBIAN_PACKAGE_PREDEPENDS +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# This field is like Depends, except that it also forces dpkg to complete installation of +# the packages named before even starting the installation of the package which declares +# the pre-dependency. +# CPACK_DEBIAN_PACKAGE_ENHANCES +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# This field is similar to Suggests but works in the opposite direction. +# It is used to declare that a package can enhance the functionality of another package. +# CPACK_DEBIAN_PACKAGE_BREAKS +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# When one binary package declares that it breaks another, dpkg will refuse to allow the +# package which declares Breaks be installed unless the broken package is deconfigured first, +# and it will refuse to allow the broken package to be reconfigured. +# CPACK_DEBIAN_PACKAGE_CONFLICTS +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# When one binary package declares a conflict with another using a Conflicts field, +# dpkg will refuse to allow them to be installed on the system at the same time. +# CPACK_DEBIAN_PACKAGE_PROVIDES +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# A virtual package is one which appears in the Provides control field of another package. +# CPACK_DEBIAN_PACKAGE_REPLACES +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# Packages can declare in their control file that they should overwrite +# files in certain other packages, or completely replace other packages. #============================================================================= # Copyright 2007-2009 Kitware, Inc. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 3ade3aa..e2d78802 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -548,16 +548,16 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ # We do only save CPack installed tree in _prepr # and then restore it in build. %prep -mv $RPM_BUILD_ROOT \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot +mv $RPM_BUILD_ROOT \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" #p build %install if [ -e $RPM_BUILD_ROOT ]; then - mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/* $RPM_BUILD_ROOT + mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/*\" $RPM_BUILD_ROOT else - mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot $RPM_BUILD_ROOT + mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT fi %clean diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index d76796f..997164a 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -597,8 +597,7 @@ function(_ep_get_build_command name step cmd_var) # CMake project. Select build command based on generator. get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR) if("${CMAKE_GENERATOR}" MATCHES "Make" AND - ("${cmake_generator}" STREQUAL "${CMAKE_GENERATOR}" OR - NOT cmake_generator)) + ("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator)) # The project uses the same Makefile generator. Use recursive make. set(cmd "$(MAKE)") if(step STREQUAL "INSTALL") @@ -985,8 +984,15 @@ function(_ep_add_download_command name) get_filename_component(src_name "${source_dir}" NAME) get_filename_component(work_dir "${source_dir}" PATH) set(comment "Performing download step (SVN checkout) for '${name}'") + set(svn_user_pw_args "") + if(svn_username) + set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}") + endif() + if(svn_password) + set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}") + endif() set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} - --username=${svn_username} --password=${svn_password} ${src_name}) + ${svn_user_pw_args} ${src_name}) list(APPEND depends ${stamp_dir}/${name}-svninfo.txt) elseif(git_repository) find_package(Git) @@ -1125,8 +1131,15 @@ function(_ep_add_update_command name) get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION) get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME) get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD) + set(svn_user_pw_args "") + if(svn_username) + set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}") + endif() + if(svn_password) + set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}") + endif() set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision} - --username=${svn_username} --password=${svn_password}) + ${svn_user_pw_args}) set(always 1) elseif(git_repository) if(NOT GIT_EXECUTABLE) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 2377e10..3ae4e14 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -20,7 +20,6 @@ # set(Boost_USE_STATIC_LIBS ON) # set(Boost_USE_MULTITHREADED ON) # set(Boost_USE_STATIC_RUNTIME OFF) -# set(Boost_COMPAT_STATIC_RUNTIME OFF) # find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) # # if(Boost_FOUND) @@ -94,7 +93,10 @@ # # Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries # linked against a static C++ standard library -# ('s' ABI tag). Defaults to OFF. +# ('s' ABI tag). This option should be set to +# ON or OFF because the default behavior +# if not specified is platform dependent +# for backwards compatibility. # [Since CMake 2.8.3] # # Boost_USE_DEBUG_PYTHON If enabled, searches for boost libraries @@ -114,14 +116,6 @@ # Defaults to OFF. # [Since CMake 2.8.3] # -# Boost_COMPAT_STATIC_RUNTIME Set to OFF to disable backwards compatible -# searching for libraries with the 's' ABI -# tag on WIN32 after normal searches. You -# should set this to OFF and also set -# Boost_USE_STATIC_RUNTIME appropriately. -# If not specified, defaults to ON. -# [Since CMake 2.8.3] -# # Other Variables used by this module which you may want to set. # # Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching @@ -372,9 +366,6 @@ endfunction() IF(NOT DEFINED Boost_USE_MULTITHREADED) SET(Boost_USE_MULTITHREADED TRUE) ENDIF() -if(NOT DEFINED Boost_COMPAT_STATIC_RUNTIME) - set(Boost_COMPAT_STATIC_RUNTIME TRUE) -endif() if(Boost_FIND_VERSION_EXACT) # The version may appear in a directory with or without the patch @@ -868,11 +859,11 @@ ELSE (_boost_IN_CACHE) # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found) # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found) # We maintain this behavior since changing it could break people's builds. - # To disable the ambiguous behavior, the user can - # set Boost_COMPAT_STATIC_RUNTIME to FALSE + # To disable the ambiguous behavior, the user need only + # set Boost_USE_STATIC_RUNTIME either ON or OFF. set(_boost_STATIC_RUNTIME_WORKAROUND false) - if(Boost_COMPAT_STATIC_RUNTIME AND WIN32 AND Boost_USE_STATIC_LIBS) - if(NOT Boost_USE_STATIC_RUNTIME) + if(WIN32 AND Boost_USE_STATIC_LIBS) + if(NOT DEFINED Boost_USE_STATIC_RUNTIME) set(_boost_STATIC_RUNTIME_WORKAROUND true) endif() endif() diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 49bff5b..91215d5 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -612,8 +612,10 @@ else() endif() ######################## -# Look for the SDK stuff +# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with +# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h + "$ENV{NVSDKCOMPUTE_ROOT}/C" "$ENV{NVSDKCUDA_ROOT}" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" "/Developer/GPU\ Computing/C" @@ -941,8 +943,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) # we convert the strings to lists (like we want). if(CUDA_PROPAGATE_HOST_FLAGS) - # nvcc chokes on -g3, so replace it with -g - if(CMAKE_COMPILER_IS_GNUCC) + # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g + if(CMAKE_COMPILER_IS_GNUCC AND CUDA_VERSION VERSION_LESS "3.0") string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") else() set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 1746fb5..90c9de4 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -293,7 +293,7 @@ else() # If the HDF5 include directory was found, open H5pubconf.h to determine if # HDF5 was compiled with parallel IO support set( HDF5_IS_PARALLEL FALSE ) - foreach( _dir HDF5_INCLUDE_DIRS ) + foreach( _dir IN LISTS HDF5_INCLUDE_DIRS ) if( EXISTS "${_dir}/H5pubconf.h" ) file( STRINGS "${_dir}/H5pubconf.h" HDF5_HAVE_PARALLEL_DEFINE diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 3419134..78699cc 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -81,6 +81,7 @@ set(_MPI_PACKAGE_DIR lib/openmpi "MPICH/SDK" "Microsoft Compute Cluster Pack" + "Microsoft HPC Pack 2008 R2" ) set(_MPI_PREFIX_PATH) @@ -306,7 +307,7 @@ else (MPI_COMPILE_CMDLINE) # No MPI compiler to interogate so attempt to find everything with find functions. find_path(MPI_INCLUDE_PATH mpi.h HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include + PATH_SUFFIXES include Inc ) # Decide between 32-bit and 64-bit libraries for Microsoft's MPI diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index b849bc2..10e9241 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -27,7 +27,7 @@ INCLUDE(CMakeFindFrameworks) # Search for the python framework on Apple. CMAKE_FIND_FRAMEWORKS(Python) -FOREACH(_CURRENT_VERSION 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) +FOREACH(_CURRENT_VERSION 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION}) IF(WIN32) FIND_LIBRARY(PYTHON_DEBUG_LIBRARY diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index d2d39e6..45bbd2e 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -242,6 +242,7 @@ # QT_LIBRARY_DIR Path to "lib" of Qt4 # QT_PLUGINS_DIR Path to "plugins" for Qt4 # QT_TRANSLATIONS_DIR Path to "translations" of Qt4 +# QT_IMPORTS_DIR Path to "imports" of Qt4 # QT_DOC_DIR Path to "doc" of Qt4 # QT_MKSPECS_DIR Path to "mkspecs" of Qt4 # @@ -445,6 +446,14 @@ MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename) MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR) ENDMACRO (_QT4_ADJUST_LIB_VARS) +function(_QT4_QUERY_QMAKE VAR RESULT) + exec_program(${QT_QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output ) + if(NOT return_code) + file(TO_CMAKE_PATH "${output}" output) + set(${RESULT} ${output} PARENT_SCOPE) + endif(NOT return_code) +endfunction(_QT4_QUERY_QMAKE) + SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE) @@ -470,7 +479,7 @@ IF (QT_QMAKE_EXECUTABLE) SET(QT4_QMAKE_FOUND FALSE) - EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION) + _qt4_query_qmake(QT_VERSION QTVERSION) # check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path IF("${QTVERSION}" MATCHES "Unknown") @@ -482,8 +491,7 @@ IF (QT_QMAKE_EXECUTABLE) DOC "The qmake executable for the Qt installation to use" ) IF(QT_QMAKE_EXECUTABLE) - EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} - ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION) + _qt4_query_qmake(QT_VERSION QTVERSION) ENDIF(QT_QMAKE_EXECUTABLE) ENDIF("${QTVERSION}" MATCHES "Unknown") @@ -559,9 +567,7 @@ IF (QT4_QMAKE_FOUND) # ask qmake for the mkspecs directory # we do this first because QT_LIBINFIX might be set IF (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED) - EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} - ARGS "-query QMAKE_MKSPECS" - OUTPUT_VARIABLE qt_mkspecs_dirs ) + _qt4_query_qmake(QMAKE_MKSPECS qt_mkspecs_dirs) # do not replace : on windows as it might be a drive letter # and windows should already use ; as a separator IF(NOT WIN32) @@ -592,11 +598,7 @@ IF (QT4_QMAKE_FOUND) # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the # others and for setting QT_LIBRARY_DIR IF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED) - EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} - ARGS "-query QT_INSTALL_LIBS" - OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP ) - # make sure we have / and not \ as qmake gives on windows - FILE(TO_CMAKE_PATH "${QT_LIBRARY_DIR_TMP}" QT_LIBRARY_DIR_TMP) + _qt4_query_qmake(QT_INSTALL_LIBS QT_LIBRARY_DIR_TMP) SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND) SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND) FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE @@ -649,21 +651,13 @@ IF (QT4_QMAKE_FOUND) # ask qmake for the binary dir IF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED) - EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} - ARGS "-query QT_INSTALL_BINS" - OUTPUT_VARIABLE qt_bins ) - # make sure we have / and not \ as qmake gives on windows - FILE(TO_CMAKE_PATH "${qt_bins}" qt_bins) - SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE) + _qt4_query_qmake(QT_INSTALL_BINS qt_bins) + SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE) ENDIF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED) # ask qmake for the include dir IF (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)) - EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} - ARGS "-query QT_INSTALL_HEADERS" - OUTPUT_VARIABLE qt_headers ) - # make sure we have / and not \ as qmake gives on windows - FILE(TO_CMAKE_PATH "${qt_headers}" qt_headers) + _qt4_query_qmake(QT_INSTALL_HEADERS qt_headers) SET(QT_QTCORE_INCLUDE_DIR NOTFOUND) FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore HINTS ${qt_headers} @@ -703,22 +697,14 @@ IF (QT4_QMAKE_FOUND) # ask qmake for the documentation directory IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) - EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} - ARGS "-query QT_INSTALL_DOCS" - OUTPUT_VARIABLE qt_doc_dir ) - # make sure we have / and not \ as qmake gives on windows - FILE(TO_CMAKE_PATH "${qt_doc_dir}" qt_doc_dir) + _qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir) SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE) ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) # ask qmake for the plugins directory IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED) - EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} - ARGS "-query QT_INSTALL_PLUGINS" - OUTPUT_VARIABLE qt_plugins_dir ) - # make sure we have / and not \ as qmake gives on windows - FILE(TO_CMAKE_PATH "${qt_plugins_dir}" qt_plugins_dir) + _qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir) SET(QT_PLUGINS_DIR NOTFOUND) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins") @@ -730,14 +716,27 @@ IF (QT4_QMAKE_FOUND) # ask qmake for the translations directory IF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) - EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE} - ARGS "-query QT_INSTALL_TRANSLATIONS" - OUTPUT_VARIABLE qt_translations_dir ) - # make sure we have / and not \ as qmake gives on windows - FILE(TO_CMAKE_PATH "${qt_translations_dir}" qt_translations_dir) + _qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir) SET(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE) ENDIF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) + # ask qmake for the imports directory + IF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) + _qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir) + if(qt_imports_dir) + SET(QT_IMPORTS_DIR NOTFOUND) + foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) + set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports") + endforeach(qt_cross_path) + FIND_PATH(QT_IMPORTS_DIR NAMES Qt + HINTS ${qt_cross_paths} ${qt_imports_dir} + DOC "The location of the Qt imports" + NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH) + mark_as_advanced(QT_IMPORTS_DIR) + endif(qt_imports_dir) + ENDIF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) + # Make variables changeble to the advanced user MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR QT_PLUGINS_DIR QT_TRANSLATIONS_DIR) diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index a58c48d..11f66b0 100644 --- a/Modules/FindSubversion.cmake +++ b/Modules/FindSubversion.cmake @@ -52,11 +52,18 @@ FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE) IF(Subversion_SVN_EXECUTABLE) + # the subversion commands should be executed with the C locale, otherwise + # the message (which are parsed) may be translated, Alex + SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}") + SET(ENV{LC_ALL} C) EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version OUTPUT_VARIABLE Subversion_VERSION_SVN OUTPUT_STRIP_TRAILING_WHITESPACE) + # restore the previous LC_ALL + SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL}) + STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index c83da4f..853b1a1 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -146,7 +146,7 @@ function(is_file_executable file result_var) # If file name ends in .exe on Windows, *assume* executable: # - if(WIN32) + if(WIN32 AND NOT UNIX) if("${file_full_lower}" MATCHES "\\.exe$") set(${result_var} 1 PARENT_SCOPE) return() @@ -156,7 +156,7 @@ function(is_file_executable file result_var) # to determine ${result_var}. In 99%+? practical cases, the exe name # match will be sufficient... # - endif(WIN32) + endif(WIN32 AND NOT UNIX) # Use the information returned from the Unix shell command "file" to # determine if ${file_full} should be considered an executable file... @@ -335,7 +335,7 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) # Using find_program on Windows will find dll files that are in the PATH. # (Converting simple file names into full path names if found.) # - if(WIN32) + if(WIN32 AND NOT UNIX) if(NOT resolved) set(ri "ri-NOTFOUND") find_program(ri "${item}" PATHS "${exepath};${dirs}" NO_DEFAULT_PATH) @@ -347,7 +347,7 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) set(ri "ri-NOTFOUND") endif(ri) endif(NOT resolved) - endif(WIN32) + endif(WIN32 AND NOT UNIX) # Provide a hook so that projects can override item resolution # by whatever logic they choose: @@ -413,7 +413,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var) string(TOLOWER "${resolved_file}" lower) if(UNIX) - if(resolved_file MATCHES "^(/lib/|/lib32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/lib64/|/usr/X11R6/)") + if(resolved_file MATCHES "^(/lib/|/lib32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)") set(is_system 1) endif() endif() @@ -434,7 +434,27 @@ function(gp_resolved_file_type original_file file exepath dirs type_var) if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)") set(is_system 1) endif() - endif() + + if(UNIX) + # if cygwin, we can get the properly formed windows paths from cygpath + find_program(CYGPATH_EXECUTABLE cygpath) + + if(CYGPATH_EXECUTABLE) + execute_process(COMMAND ${CYGPATH_EXECUTABLE} -W + OUTPUT_VARIABLE env_windir + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${CYGPATH_EXECUTABLE} -S + OUTPUT_VARIABLE env_sysdir + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(TOLOWER "${env_windir}" windir) + string(TOLOWER "${env_sysdir}" sysroot) + + if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)") + set(is_system 1) + endif() + endif(CYGPATH_EXECUTABLE) + endif(UNIX) + endif(WIN32) if(NOT is_system) get_filename_component(original_path "${original_lower}" PATH) @@ -519,9 +539,9 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa if(APPLE) set(gp_tool "otool") endif(APPLE) - if(WIN32) + if(WIN32 AND NOT UNIX) # This is how to check for cygwin, har! set(gp_tool "dumpbin") - endif(WIN32) + endif(WIN32 AND NOT UNIX) endif("${gp_tool}" STREQUAL "") set(gp_tool_known 0) @@ -587,11 +607,22 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa # get_filename_component(gp_cmd_dir "${gp_cmd}" PATH) get_filename_component(gp_cmd_dlls_dir "${gp_cmd_dir}/../../Common7/IDE" ABSOLUTE) + # Use cmake paths as a user may have a PATH element ending with a backslash. + # This will escape the list delimiter and create havoc! if(EXISTS "${gp_cmd_dlls_dir}") # only add to the path if it is not already in the path - if(NOT "$ENV{PATH}" MATCHES "${gp_cmd_dlls_dir}") + set(gp_found_cmd_dlls_dir 0) + file(TO_CMAKE_PATH "$ENV{PATH}" env_path) + foreach(gp_env_path_element ${env_path}) + if("${gp_env_path_element}" STREQUAL "${gp_cmd_dlls_dir}") + set(gp_found_cmd_dlls_dir 1) + endif() + endforeach(gp_env_path_element) + + if(NOT gp_found_cmd_dlls_dir) + file(TO_NATIVE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir) set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}") - endif(NOT "$ENV{PATH}" MATCHES "${gp_cmd_dlls_dir}") + endif() endif(EXISTS "${gp_cmd_dlls_dir}") endif("${gp_tool}" STREQUAL "dumpbin") # |