diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-07-31 11:52:25 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-07-31 11:52:25 -0400 |
commit | e1d7c3aff2cdafcf069a0a6b7e08ea5c1990d2d0 (patch) | |
tree | ea7b0730b27514a81a2f5b335aba8c6044b91e33 | |
parent | cb7487b1afa6e2bce0d6c17f39e65b8d58d2081a (diff) | |
download | cmake-e1d7c3aff2cdafcf069a0a6b7e08ea5c1990d2d0.tar.gz |
ENH: merge in stuff from cvs head RC 16
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | ChangeLog.manual | 7 | ||||
-rw-r--r-- | Modules/InstallRequiredSystemLibraries.cmake | 31 | ||||
-rw-r--r-- | Source/cmCallVisualStudioMacro.cxx | 42 | ||||
-rw-r--r-- | Source/cmCallVisualStudioMacro.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmake.cxx | 3 | ||||
-rw-r--r-- | Tests/BundleGeneratorTest/BundleIcon.icns | bin | 0 -> 33478 bytes | |||
-rw-r--r-- | Tests/BundleGeneratorTest/CMakeLists.txt | 24 | ||||
-rw-r--r-- | Tests/BundleGeneratorTest/Executable.cxx | 8 | ||||
-rw-r--r-- | Tests/BundleGeneratorTest/Info.plist | 14 | ||||
-rw-r--r-- | Tests/BundleGeneratorTest/Library.cxx | 7 | ||||
-rwxr-xr-x | Tests/BundleGeneratorTest/StartupCommand | 12 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 14 |
15 files changed, 145 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ec9d07728..1ae365685a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES) SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 6) SET(CMake_VERSION_PATCH 1) -SET(CMake_VERSION_RC 15) +SET(CMake_VERSION_RC 16) # CVS versions are odd, if this is an odd minor version # then set the CMake_VERSION_DATE variable IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$") diff --git a/ChangeLog.manual b/ChangeLog.manual index 486f186425..41e5e7b966 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,10 @@ +Changes in CMake 2.6.1 RC 16 +- Fix for bug 7427, preinstall target name hard coded +- Fix issue #7088 - do not emit error messages when attempts to run + Visual Studio macros fail. You can still get the error output + as messages if you want using --debug-output from the cmake command line. +- Fix InstallRequiredSystemLibraries.cmake to work with win64 + Changes in CMake 2.6.1 RC 15 - Fix bug 7426 FindJPEG module causes error when setting JPEG_LIBRARY to blank - Fix bug 7414 PackageMaker generator crashes when given components diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 2b963bf83a..7744dfa19d 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -26,13 +26,20 @@ IF(MSVC) "${SYSTEMROOT}/system32/msvcr71.dll" ) ENDIF(MSVC71) + + IF(CMAKE_CL_64) + SET(CMAKE_MSVC_ARCH amd64) + ELSE(CMAKE_CL_64) + SET(CMAKE_MSVC_ARCH x86) + ENDIF(CMAKE_CL_64) + IF(MSVC80) # Find the runtime library redistribution directory. - FIND_PATH(MSVC80_REDIST_DIR NAMES x86/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest + FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist" ) MARK_AS_ADVANCED(MSVC80_REDIST_DIR) - SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/x86/Microsoft.VC80.CRT") + SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. @@ -45,7 +52,7 @@ IF(MSVC) IF(CMAKE_INSTALL_DEBUG_LIBRARIES) SET(MSVC80_CRT_DIR - "${MSVC80_REDIST_DIR}/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT") + "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT") SET(__install__libs ${__install__libs} "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest" "${MSVC80_CRT_DIR}/msvcm80d.dll" @@ -57,13 +64,13 @@ IF(MSVC) ENDIF(MSVC80) IF(MSVC90) # Find the runtime library redistribution directory. - FIND_PATH(MSVC90_REDIST_DIR NAMES x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest + FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/redist" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]/../../VC/redist" ) MARK_AS_ADVANCED(MSVC90_REDIST_DIR) - SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/x86/Microsoft.VC90.CRT") + SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. @@ -75,7 +82,7 @@ IF(MSVC) ) IF(CMAKE_INSTALL_DEBUG_LIBRARIES) SET(MSVC90_CRT_DIR - "${MSVC90_REDIST_DIR}/Debug_NonRedist/x86/Microsoft.VC90.DebugCRT") + "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT") SET(__install__libs ${__install__libs} "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest" "${MSVC90_CRT_DIR}/msvcm90d.dll" @@ -98,7 +105,7 @@ IF(MSVC) IF(MSVC80) IF(CMAKE_INSTALL_DEBUG_LIBRARIES) SET(MSVC80_MFC_DIR - "${MSVC80_REDIST_DIR}/Debug_NonRedist/x86/Microsoft.VC80.DebugMFC") + "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC") SET(__install__libs ${__install__libs} "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest" "${MSVC80_MFC_DIR}/mfc80d.dll" @@ -108,7 +115,7 @@ IF(MSVC) ) ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) - SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/x86/Microsoft.VC80.MFC") + SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. SET(__install__libs ${__install__libs} @@ -119,7 +126,7 @@ IF(MSVC) "${MSVC80_MFC_DIR}/mfcm80u.dll" ) # include the language dll's for vs8 as well as the actuall dll's - SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/x86/Microsoft.VC80.MFCLOC") + SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. SET(__install__libs ${__install__libs} @@ -138,7 +145,7 @@ IF(MSVC) IF(MSVC90) IF(CMAKE_INSTALL_DEBUG_LIBRARIES) SET(MSVC90_MFC_DIR - "${MSVC90_REDIST_DIR}/Debug_NonRedist/x86/Microsoft.VC90.DebugMFC") + "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC") SET(__install__libs ${__install__libs} "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest" "${MSVC90_MFC_DIR}/mfc90d.dll" @@ -148,7 +155,7 @@ IF(MSVC) ) ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) - SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/x86/Microsoft.VC90.MFC") + SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. SET(__install__libs ${__install__libs} @@ -159,7 +166,7 @@ IF(MSVC) "${MSVC90_MFC_DIR}/mfcm90u.dll" ) # include the language dll's for vs9 as well as the actuall dll's - SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/x86/Microsoft.VC90.MFCLOC") + SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. SET(__install__libs ${__install__libs} diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx index 2476631722..2aefd20a7c 100644 --- a/Source/cmCallVisualStudioMacro.cxx +++ b/Source/cmCallVisualStudioMacro.cxx @@ -24,6 +24,11 @@ #endif +// Just for this file: +// +static bool LogErrorsAsMessages; + + #if defined(HAVE_COMDEF_H) @@ -31,17 +36,20 @@ //---------------------------------------------------------------------------- -///! Use ReportHRESULT to make a cmSystemTools::Error after calling +///! Use ReportHRESULT to make a cmSystemTools::Message after calling ///! a COM method that may have failed. #define ReportHRESULT(hr, context) \ if (FAILED(hr)) \ { \ - std::ostringstream oss; \ - oss.flags(std::ios::hex); \ - oss << context << " failed HRESULT, hr = 0x" << hr << std::endl; \ - oss.flags(std::ios::dec); \ - oss << __FILE__ << "(" << __LINE__ << ")"; \ - cmSystemTools::Error(oss.str().c_str()); \ + if (LogErrorsAsMessages) \ + { \ + std::ostringstream oss; \ + oss.flags(std::ios::hex); \ + oss << context << " failed HRESULT, hr = 0x" << hr << std::endl; \ + oss.flags(std::ios::dec); \ + oss << __FILE__ << "(" << __LINE__ << ")"; \ + cmSystemTools::Message(oss.str().c_str()); \ + } \ } @@ -404,6 +412,8 @@ int cmCallVisualStudioMacro::GetNumberOfRunningVisualStudioInstances( { int count = 0; + LogErrorsAsMessages = false; + #if defined(HAVE_COMDEF_H) HRESULT hr = CoInitialize(0); ReportHRESULT(hr, "CoInitialize"); @@ -438,10 +448,13 @@ int cmCallVisualStudioMacro::GetNumberOfRunningVisualStudioInstances( int cmCallVisualStudioMacro::CallMacro( const std::string& slnFile, const std::string& macro, - const std::string& args) + const std::string& args, + const bool logErrorsAsMessages) { int err = 1; // no comdef.h + LogErrorsAsMessages = logErrorsAsMessages; + #if defined(HAVE_COMDEF_H) err = 2; // error initializing @@ -489,16 +502,19 @@ int cmCallVisualStudioMacro::CallMacro( (void)slnFile; (void)macro; (void)args; - cmSystemTools::Error("cmCallVisualStudioMacro::CallMacro is not " - "supported on this platform"); + if (LogErrorsAsMessages) + { + cmSystemTools::Message("cmCallVisualStudioMacro::CallMacro is not " + "supported on this platform"); + } #endif - if (err) + if (err && LogErrorsAsMessages) { std::ostringstream oss; oss << "cmCallVisualStudioMacro::CallMacro failed, err = " << err; - cmSystemTools::Error(oss.str().c_str()); + cmSystemTools::Message(oss.str().c_str()); } - return err; + return 0; } diff --git a/Source/cmCallVisualStudioMacro.h b/Source/cmCallVisualStudioMacro.h index ea3cc104d6..44f6e55af5 100644 --- a/Source/cmCallVisualStudioMacro.h +++ b/Source/cmCallVisualStudioMacro.h @@ -33,7 +33,8 @@ public: ///! macro in each Visual Studio instance. static int CallMacro(const std::string& slnFile, const std::string& macro, - const std::string& args); + const std::string& args, + const bool logErrorsAsMessages); ///! Count the number of running instances of Visual Studio with the ///! given solution file open. Pass "ALL" for slnFile to count all diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 83733bfdcc..cf4abdd5e9 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1565,7 +1565,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.push_back(singleLine); if ( this->GetPreinstallTargetName() ) { - depends.push_back("preinstall"); + depends.push_back(this->GetPreinstallTargetName()); } else { diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index e28b293302..4e1b8510a4 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -178,14 +178,16 @@ cmGlobalVisualStudioGenerator projects += ";"; projects += *it; } - cmCallVisualStudioMacro::CallMacro - (topLevelSlnName, CMAKE_VSMACROS_RELOAD_MACRONAME, projects); + cmCallVisualStudioMacro::CallMacro(topLevelSlnName, + CMAKE_VSMACROS_RELOAD_MACRONAME, projects, + this->GetCMakeInstance()->GetDebugOutput()); } } else if(m == MacroStop) { cmCallVisualStudioMacro::CallMacro(topLevelSlnName, - CMAKE_VSMACROS_STOP_MACRONAME, ""); + CMAKE_VSMACROS_STOP_MACRONAME, "", + this->GetCMakeInstance()->GetDebugOutput()); } } } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e9ccf06665..90b6c2641f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1422,7 +1422,8 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args) } } - return cmCallVisualStudioMacro::CallMacro(args[2], args[3], macroArgs); + return cmCallVisualStudioMacro::CallMacro(args[2], args[3], + macroArgs, true); } #endif diff --git a/Tests/BundleGeneratorTest/BundleIcon.icns b/Tests/BundleGeneratorTest/BundleIcon.icns Binary files differnew file mode 100644 index 0000000000..00c74e1c10 --- /dev/null +++ b/Tests/BundleGeneratorTest/BundleIcon.icns diff --git a/Tests/BundleGeneratorTest/CMakeLists.txt b/Tests/BundleGeneratorTest/CMakeLists.txt new file mode 100644 index 0000000000..e671d40b35 --- /dev/null +++ b/Tests/BundleGeneratorTest/CMakeLists.txt @@ -0,0 +1,24 @@ +PROJECT(BundleGeneratorTest) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.7) + +# Build a shared library and install it in lib/ +ADD_LIBRARY(Library SHARED Library.cxx) +INSTALL(TARGETS Library DESTINATION lib) + +# Build an executable and install it in bin/ +ADD_EXECUTABLE(Executable Executable.cxx) +TARGET_LINK_LIBRARIES(Executable Library) +INSTALL(TARGETS Executable DESTINATION bin) + +# Use the bundle-generator for packaging ... +SET(CPACK_GENERATOR "Bundle") +SET(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/BundleIcon.icns") +SET(CPACK_BUNDLE_NAME "BundleGeneratorTest") +SET(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist") +SET(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/StartupCommand") +SET(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation") +SET(CPACK_PACKAGE_NAME "BundleGeneratorTest") +SET(CPACK_PACKAGE_VERSION "0.1") +INCLUDE(CPack) + diff --git a/Tests/BundleGeneratorTest/Executable.cxx b/Tests/BundleGeneratorTest/Executable.cxx new file mode 100644 index 0000000000..8107f783a8 --- /dev/null +++ b/Tests/BundleGeneratorTest/Executable.cxx @@ -0,0 +1,8 @@ +extern void print_message(const char* const Message); + +int main(int argc, char* argv[]) +{ + print_message("Howdy, World!\n"); + return 0; +} + diff --git a/Tests/BundleGeneratorTest/Info.plist b/Tests/BundleGeneratorTest/Info.plist new file mode 100644 index 0000000000..e5a7d0047a --- /dev/null +++ b/Tests/BundleGeneratorTest/Info.plist @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>CFBundleExecutable</key> + <string>BundleGeneratorTest</string> + <key>CFBundleIconFile</key> + <string>BundleGeneratorTest.icns</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + </dict> +</plist> diff --git a/Tests/BundleGeneratorTest/Library.cxx b/Tests/BundleGeneratorTest/Library.cxx new file mode 100644 index 0000000000..1403c68246 --- /dev/null +++ b/Tests/BundleGeneratorTest/Library.cxx @@ -0,0 +1,7 @@ +#include <iostream> + +void print_message(const char* const Message) +{ + std::cout << Message; +} + diff --git a/Tests/BundleGeneratorTest/StartupCommand b/Tests/BundleGeneratorTest/StartupCommand new file mode 100755 index 0000000000..5bc5ad2370 --- /dev/null +++ b/Tests/BundleGeneratorTest/StartupCommand @@ -0,0 +1,12 @@ +#!/bin/sh + +BUNDLE="`echo "$0" | sed -e 's/\/Contents\/MacOS\/.*//'`" +RESOURCES="$BUNDLE/Contents/Resources" + +echo "BUNDLE: $BUNDLE" +echo "RESOURCES: $RESOURCES" + +export DYLD_LIBRARY_PATH=$RESOURCES/lib + +exec "$RESOURCES/bin/Executable" + diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index febb46af9f..f2ff228fb8 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -705,6 +705,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel ADD_TEST_MACRO(ObjC++ ObjC++) ENDIF (APPLE AND CMAKE_COMPILER_IS_GNUCXX) + IF(APPLE AND CTEST_TEST_CPACK) + ADD_TEST(BundleGeneratorTest ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/BundleGeneratorTest" + "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest" + --build-two-config + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project BundleGeneratorTest + --build-target package + --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory" + ) + ENDIF(APPLE AND CTEST_TEST_CPACK) + IF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS) CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" @ONLY ESCAPE_QUOTES) |