Commit e1d7c3af authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge in stuff from cvs head RC 16

parent cb7487b1
......@@ -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]$")
......
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
......
......@@ -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}
......
......@@ -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;
}
......@@ -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
......
......@@ -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
{
......
......@@ -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());
}
}
}
......
......@@ -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
......
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)
extern void print_message(const char* const Message);
int main(int argc, char* argv[])
{
print_message("Howdy, World!\n");
return 0;
}
<?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>
#include <iostream>
void print_message(const char* const Message)
{
std::cout << Message;
}
#!/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"
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment