From 0c302a7e5fa1b52b6b59a0f299dd811a9a1194c7 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Mon, 9 Jan 2006 11:26:31 -0500 Subject: [PATCH] ENH: Fix test for cpack variables, add support for icon on windows --- CMakeLists.txt | 3 +++ Modules/CPack.cmake | 4 ++-- Source/CPack/cmCPackGenericGenerator.cxx | 5 +++++ Templates/CPackConfig.cmake.in | 7 +++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0578877d..8600c557d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,6 +187,9 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") SET(CPACK_PACKAGE_VERSION_MAJOR "${CMake_VERSION_MAJOR}") SET(CPACK_PACKAGE_VERSION_MINOR "${CMake_VERSION_MINOR}") SET(CPACK_PACKAGE_VERSION_PATCH "${CMake_VERSION_PATCH}") + IF(WIN32 AND NOT UNIX) + SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\CMakeInstall.bmp") + ENDIF(WIN32 AND NOT UNIX) INCLUDE(CPack) ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 39c773c82..8c32e2039 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -6,9 +6,9 @@ ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") # Macro for setting values if a user did not overwrite them MACRO(cpack_set_if_not_set name value) - IF(NOT "${name}") + IF(NOT DEFINED "${name}") SET(${name} "${value}") - ENDIF(NOT "${name}") + ENDIF(NOT DEFINED "${name}") ENDMACRO(cpack_set_if_not_set) # Set the package name diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx index 7f77178ea..6da855ed9 100644 --- a/Source/CPack/cmCPackGenericGenerator.cxx +++ b/Source/CPack/cmCPackGenericGenerator.cxx @@ -222,6 +222,11 @@ int cmCPackGenericGenerator::ProcessGenerator() cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Compress package" << std::endl); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress files to: " << tempPackageFileName << std::endl); + if ( cmSystemTools::FileExists(tempPackageFileName) ) + { + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove old package file" << std::endl); + cmSystemTools::RemoveFile(tempPackageFileName); + } if ( !this->CompressFiles(tempPackageFileName, tempDirectory, gl.GetFiles()) ) { diff --git a/Templates/CPackConfig.cmake.in b/Templates/CPackConfig.cmake.in index efc35cbf2..411089af3 100644 --- a/Templates/CPackConfig.cmake.in +++ b/Templates/CPackConfig.cmake.in @@ -1,10 +1,17 @@ SET(CPACK_GENERATOR "@CPACK_GENERATOR@") + SET(CPACK_PACKAGE_NAME "@CPACK_PACKAGE_NAME@") + SET(CPACK_PACKAGE_VERSION_MAJOR "@CPACK_PACKAGE_VERSION_MAJOR@") SET(CPACK_PACKAGE_VERSION_MINOR "@CPACK_PACKAGE_VERSION_MINOR@") SET(CPACK_PACKAGE_VERSION_PATCH "@CPACK_PACKAGE_VERSION_PATCH@") + SET(CPACK_PACKAGE_VENDOR "@CPACK_PACKAGE_VENDOR@") + SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@") SET(CPACK_PACKAGE_DESCRIPTION_FILE "@CPACK_PACKAGE_DESCRIPTION_FILE@") + SET(CPACK_SOURCE_DIR "@CPACK_SOURCE_DIR@") SET(CPACK_BINARY_DIR "@CPACK_BINARY_DIR@") + +SET(CPACK_PACKAGE_ICON "@CPACK_PACKAGE_ICON@")