diff options
-rw-r--r-- | Modules/CPackDeb.cmake | 38 | ||||
-rw-r--r-- | Modules/ExternalProject.cmake | 21 | ||||
-rw-r--r-- | Modules/FindPythonLibs.cmake | 2 | ||||
-rw-r--r-- | Modules/GetPrerequisites.cmake | 51 | ||||
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 44 | ||||
-rw-r--r-- | Source/kwsys/kwsysDateStamp.cmake | 2 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/CMakeTests/GetPrerequisitesTest.cmake.in | 22 |
8 files changed, 165 insertions, 27 deletions
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/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/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/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") # diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index ac2e151..47a1ff6 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -94,6 +94,18 @@ int cmCPackDebGenerator::PackageFiles() this->GetOption("CPACK_DEBIAN_PACKAGE_SUGGESTS"); const char* debian_pkg_url = this->GetOption("CPACK_DEBIAN_PACKAGE_HOMEPAGE"); + const char* debian_pkg_predep = + this->GetOption("CPACK_DEBIAN_PACKAGE_PREDEPENDS"); + const char* debian_pkg_enhances = + this->GetOption("CPACK_DEBIAN_PACKAGE_ENHANCES"); + const char* debian_pkg_breaks = + this->GetOption("CPACK_DEBIAN_PACKAGE_BREAKS"); + const char* debian_pkg_conflicts = + this->GetOption("CPACK_DEBIAN_PACKAGE_CONFLICTS"); + const char* debian_pkg_provides = + this->GetOption("CPACK_DEBIAN_PACKAGE_PROVIDES"); + const char* debian_pkg_replaces = + this->GetOption("CPACK_DEBIAN_PACKAGE_REPLACES"); { // the scope is needed for cmGeneratedFileStream cmGeneratedFileStream out(ctlfilename.c_str()); @@ -102,22 +114,46 @@ int cmCPackDebGenerator::PackageFiles() out << "Section: " << debian_pkg_section << "\n"; out << "Priority: " << debian_pkg_priority << "\n"; out << "Architecture: " << debian_pkg_arch << "\n"; - if(debian_pkg_dep) + if(debian_pkg_dep && *debian_pkg_dep) { out << "Depends: " << debian_pkg_dep << "\n"; } - if(debian_pkg_rec) + if(debian_pkg_rec && *debian_pkg_rec) { out << "Recommends: " << debian_pkg_rec << "\n"; } - if(debian_pkg_sug) + if(debian_pkg_sug && *debian_pkg_sug) { out << "Suggests: " << debian_pkg_sug << "\n"; } - if(debian_pkg_url) + if(debian_pkg_url && *debian_pkg_url) { out << "Homepage: " << debian_pkg_url << "\n"; } + if (debian_pkg_predep && *debian_pkg_predep) + { + out << "Pre-Depends: " << debian_pkg_predep << "\n"; + } + if (debian_pkg_enhances && *debian_pkg_enhances) + { + out << "Enhances: " << debian_pkg_enhances << "\n"; + } + if (debian_pkg_breaks && *debian_pkg_breaks) + { + out << "Breaks: " << debian_pkg_breaks << "\n"; + } + if (debian_pkg_conflicts && *debian_pkg_conflicts) + { + out << "Conflicts: " << debian_pkg_conflicts << "\n"; + } + if (debian_pkg_provides && *debian_pkg_provides) + { + out << "Provides: " << debian_pkg_provides << "\n"; + } + if (debian_pkg_replaces && *debian_pkg_replaces) + { + out << "Replaces: " << debian_pkg_replaces << "\n"; + } unsigned long totalSize = 0; { std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index d2b91d0..8c487d6 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 19) +SET(KWSYS_DATE_STAMP_DAY 28) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c056e86..d618ab4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1635,7 +1635,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF() ENDIF() - IF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode") + if(NOT DEFINED CTEST_RUN_Java) + if(APPLE) + set(CTEST_RUN_Java OFF) + else() + set(CTEST_RUN_Java ON) + endif() + endif() + + IF(CTEST_RUN_Java) find_package(Java QUIET) IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW) GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH) @@ -1659,7 +1667,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF("${JNI_FILE}" MATCHES "JDK1_2") ENDIF(JNI_H) ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW) - ENDIF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode") + ENDIF(CTEST_RUN_Java) # add some cross compiler tests, for now only with makefile based generators IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") diff --git a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in index e8bfb47..daf467b 100644 --- a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in +++ b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in @@ -77,6 +77,11 @@ message(STATUS "") list_prerequisites("${CMAKE_COMMAND}" 0 0 1) message(STATUS "") +message(STATUS "=============================================================================") +string(LENGTH "$ENV{PATH}" PATH_LENGTH_BEGIN) +message(STATUS "Begin PATH length is: ${PATH_LENGTH_BEGIN}") +message(STATUS "") + # Leave the code for these tests in here, but turn them off by default... they # take longer than they're worth during development... @@ -116,11 +121,11 @@ message(STATUS "") message(STATUS "=============================================================================") message(STATUS "Test overriding 'gp_tool' with value unlikely to be found") message(STATUS "") -if(WIN32 OR APPLE) - set(gp_tool "ldd") -else(WIN32 OR APPLE) +if(APPLE) + set(gp_tool "dumpbin") +else() set(gp_tool "otool") -endif(WIN32 OR APPLE) +endif() set(gp_cmd "gp_cmd-NOTFOUND") list_prerequisites("${CMAKE_COMMAND}" 0 0 0) set(gp_cmd) @@ -139,6 +144,15 @@ foreach(v ${vs}) endforeach(v) message(STATUS "") +message(STATUS "=============================================================================") +string(LENGTH "$ENV{PATH}" PATH_LENGTH_END) +message(STATUS "Final PATH length is: ${PATH_LENGTH_END}") + +if(PATH_LENGTH_END GREATER ${PATH_LENGTH_BEGIN}) + message(FATAL_ERROR "list_prerequisties is endlessly appending the path of gp_tool to the PATH.") +endif() +message(STATUS "") + message(STATUS "=============================================================================") message(STATUS "End of test") |