From 2a6bc875670915c3d40c724096c01f57f290aa40 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 11 Jan 2006 11:08:15 -0500 Subject: ENH: Some improvements: specify link, copy msvc libraries, fix install directory --- CMakeLists.txt | 2 ++ Modules/CPack.cmake | 28 ++++++++++++++++++++++++++++ Modules/NSIS.template.in | 4 ++-- Source/CPack/cmCPackGenericGenerator.cxx | 2 +- Templates/CPackConfig.cmake.in | 4 ++++ 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fe86bf..9265aa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,6 +187,8 @@ 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}") + SET(CPACK_PACKAGE_EXECUTABLE "CMakeSetup") + SET(CPACK_PACKAGE_EXECUTABLE_LABEL "CMake") IF(WIN32 AND NOT UNIX) # There is a bug in NSI that does not handle full unix paths properly. Make # sure there is at least one set of four (4) backlasshes. diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 47dcbe4..819f0c1 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -47,4 +47,32 @@ ENDIF(NOT CPACK_GENERATOR) SET(CPACK_SOURCE_DIR "${CMAKE_SOURCE_DIR}") SET(CPACK_BINARY_DIR "${CMAKE_BINARY_DIR}") +# Hack for Visual Studio support +# Search for system runtime libraries based on the platform. This is +# not complete because it is used only for the release process by the +# developers. +IF(WIN32 AND NOT CYGWIN) + STRING(REGEX REPLACE "\\\\" "/" SYSTEMROOT "$ENV{SYSTEMROOT}") + FOREACH(lib + "${SYSTEMROOT}/system32/mfc71.dll" + "${SYSTEMROOT}/system32/msvcp71.dll" + "${SYSTEMROOT}/system32/msvcr71.dll" + ) + IF(EXISTS ${lib}) + SET(CMake_INSTALL_SYSTEM_RUNTIME_LIBS + ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib}) + ENDIF(EXISTS ${lib}) + ENDFOREACH(lib) +ENDIF(WIN32 AND NOT CYGWIN) + +# Include system runtime libraries in the installation if any are +# specified by CMake_INSTALL_SYSTEM_RUNTIME_LIBS. +IF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS) + IF(WIN32) + INSTALL_PROGRAMS(/bin ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS}) + ELSE(WIN32) + INSTALL_PROGRAMS(/lib ${CMake_INSTALL_SYSTEM_RUNTIME_LIBS}) + ENDIF(WIN32) +ENDIF(CMake_INSTALL_SYSTEM_RUNTIME_LIBS) + CONFIGURE_FILE("${cpack_input_file}" "${CMAKE_BINARY_DIR}/CPackConfig.cmake" @ONLY IMMEDIATE) diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index f895a30..5f56cda 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -358,7 +358,7 @@ Section "Dummy Section" SecDummy ;Create shortcuts CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\cmake.lnk" "$INSTDIR\bin\CMakeSetup.exe" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CPACK_PACKAGE_EXECUTABLE_LABEL@.lnk" "$INSTDIR\bin\@CPACK_PACKAGE_EXECUTABLE@.exe" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" !insertmacro MUI_STARTMENU_WRITE_END @@ -414,7 +414,7 @@ Section "Uninstall" !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" - Delete "$SMPROGRAMS\$MUI_TEMP\cmake.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\@CPACK_PACKAGE_EXECUTABLE_LABEL@.lnk" ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx index 80692b8..dfb3ed8 100644 --- a/Source/CPack/cmCPackGenericGenerator.cxx +++ b/Source/CPack/cmCPackGenericGenerator.cxx @@ -66,10 +66,10 @@ int cmCPackGenericGenerator::PrepareNames() outName += "-"; outName += postfix; } - tempDirectory += "/" + outName; */ std::string outName = this->GetOption("CPACK_PACKAGE_FILE_NAME"); + tempDirectory += "/" + outName; outName += "."; outName += this->GetOutputExtension(); diff --git a/Templates/CPackConfig.cmake.in b/Templates/CPackConfig.cmake.in index ef81b09..0476ba0 100644 --- a/Templates/CPackConfig.cmake.in +++ b/Templates/CPackConfig.cmake.in @@ -10,6 +10,10 @@ SET(CPACK_PACKAGE_VENDOR "@CPACK_PACKAGE_VENDOR@") SET(CPACK_PACKAGE_FILE_NAME "@CPACK_PACKAGE_FILE_NAME@") +SET(CPACK_PACKAGE_EXECUTABLE "@CPACK_PACKAGE_EXECUTABLE@") +SET(CPACK_PACKAGE_EXECUTABLE_LABEL "@CPACK_PACKAGE_EXECUTABLE_LABEL@") + + SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@") SET(CPACK_PACKAGE_DESCRIPTION_FILE "@CPACK_PACKAGE_DESCRIPTION_FILE@") -- cgit v0.12