From 5457b8254cb43e002fe90b7c81ae65134ec12b24 Mon Sep 17 00:00:00 2001 From: Richard Bateman Date: Wed, 6 Oct 2010 20:43:04 -0600 Subject: Add support for CFBundle targets on the Mac (#11295) This commit enables building, for example, plugin bundles to be loaded by web browsers. --- Source/cmExportFileGenerator.cxx | 6 +++ Source/cmExportInstallFileGenerator.cxx | 14 +++++++ Source/cmGlobalXCodeGenerator.cxx | 55 ++++++++++++++++++++++++---- Source/cmMakefileLibraryTargetGenerator.cxx | 49 +++++++++++++++++++++++++ Source/cmMakefileLibraryTargetGenerator.h | 1 + Source/cmSourceFile.cxx | 6 ++- Source/cmTarget.cxx | 24 ++++++++++++ Source/cmTarget.h | 3 ++ Tests/CFBundleTest/CMakeLists.txt | 53 +++++++++++++++++++++++++++ Tests/CFBundleTest/ExportList_plugin.txt | 3 ++ Tests/CFBundleTest/Info.plist.in | 54 +++++++++++++++++++++++++++ Tests/CFBundleTest/InfoPlist.strings.in | 4 ++ Tests/CFBundleTest/Localized.r | 18 +++++++++ Tests/CFBundleTest/Localized.rsrc | Bin 0 -> 496 bytes Tests/CFBundleTest/PluginConfig.cmake | 21 +++++++++++ Tests/CFBundleTest/README.txt | 16 ++++++++ Tests/CFBundleTest/VerifyResult.cmake | 32 ++++++++++++++++ Tests/CFBundleTest/np_macmain.cpp | 49 +++++++++++++++++++++++++ Tests/CMakeLists.txt | 15 ++++++++ 19 files changed, 415 insertions(+), 8 deletions(-) create mode 100644 Tests/CFBundleTest/CMakeLists.txt create mode 100644 Tests/CFBundleTest/ExportList_plugin.txt create mode 100644 Tests/CFBundleTest/Info.plist.in create mode 100644 Tests/CFBundleTest/InfoPlist.strings.in create mode 100644 Tests/CFBundleTest/Localized.r create mode 100644 Tests/CFBundleTest/Localized.rsrc create mode 100644 Tests/CFBundleTest/PluginConfig.cmake create mode 100644 Tests/CFBundleTest/README.txt create mode 100644 Tests/CFBundleTest/VerifyResult.cmake create mode 100644 Tests/CFBundleTest/np_macmain.cpp diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index e2a6035..9e5c91e 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -325,6 +325,12 @@ cmExportFileGenerator os << "SET_PROPERTY(TARGET " << targetName << " PROPERTY MACOSX_BUNDLE 1)\n"; } + + if (target->IsCFBundleOnApple()) + { + os << "SET_PROPERTY(TARGET " << targetName + << " PROPERTY BUNDLE 1)\n"; + } os << "\n"; } diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 717571c..23ff5fb 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -263,6 +263,20 @@ cmExportInstallFileGenerator value += ".framework/"; value += itgen->GetInstallFilename(target, config); } + else if(target->IsCFBundleOnApple()) + { + const char *ext = target->GetProperty("BUNDLE_EXTENSION"); + if (!ext) + { + ext = "bundle"; + } + + value += itgen->GetInstallFilename(target, config); + value += "."; + value += ext; + value += "/"; + value += itgen->GetInstallFilename(target, config); + } else if(target->IsAppBundleOnApple()) { value += itgen->GetInstallFilename(target, config); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 59ca38f..f58a15f 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -570,6 +570,12 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, } } + if(cmtarget.IsCFBundleOnApple()) + { + cmtarget.SetProperty("PREFIX", ""); + cmtarget.SetProperty("SUFFIX", ""); + } + // Add the fileRef to the top level Resources group/folder if it is not // already there. // @@ -804,6 +810,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // some build phases only apply to bundles and/or frameworks bool isFrameworkTarget = cmtarget.IsFrameworkOnApple(); bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"); + bool isCFBundleTarget = cmtarget.IsCFBundleOnApple(); cmXCodeObject* buildFiles = 0; @@ -849,7 +856,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // create resource build phase - only for framework or bundle targets cmXCodeObject* resourceBuildPhase = 0; - if (!resourceFiles.empty() && (isFrameworkTarget || isBundleTarget)) + if (!resourceFiles.empty() && + (isFrameworkTarget || isBundleTarget || isCFBundleTarget)) { resourceBuildPhase = this->CreateObject(cmXCodeObject::PBXResourcesBuildPhase); @@ -870,7 +878,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // create vector of "non-resource content file" build phases - only for // framework or bundle targets std::vector contentBuildPhases; - if (isFrameworkTarget || isBundleTarget) + if (isFrameworkTarget || isBundleTarget || isCFBundleTarget) { typedef std::map > mapOfVectorOfSourceFiles; @@ -1594,7 +1602,33 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { buildSettings->AddAttribute("LIBRARY_STYLE", this->CreateString("BUNDLE")); - if(this->XcodeVersion >= 22) + if (target.GetPropertyAsBool("BUNDLE")) + { + // It turns out that a BUNDLE is basically the same + // in many ways as an application bundle, as far as + // link flags go + std::string createFlags = + this->LookupFlags("CMAKE_SHARED_MODULE_CREATE_", lang, "_FLAGS", + "-bundle"); + if(!createFlags.empty()) + { + extraLinkOptions += " "; + extraLinkOptions += createFlags; + } + std::string plist = this->ComputeInfoPListLocation(target); + // Xcode will create the final version of Info.plist at build time, + // so let it replace the cfbundle name. This avoids creating + // a per-configuration Info.plist file. The cfbundle plist + // is very similar to the application bundle plist + this->CurrentLocalGenerator + ->GenerateAppleInfoPList(&target, "$(EXECUTABLE_NAME)", + plist.c_str()); + std::string path = + this->ConvertToRelativeForXCode(plist.c_str()); + buildSettings->AddAttribute("INFOPLIST_FILE", + this->CreateString(path.c_str())); + } + else if(this->XcodeVersion >= 22) { buildSettings->AddAttribute("MACH_O_TYPE", this->CreateString("mh_bundle")); @@ -1633,7 +1667,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, std::string plist = this->ComputeInfoPListLocation(target); // Xcode will create the final version of Info.plist at build time, - // so let it replace the framework name. This avoids creating + // so let it replace the framework name. This avoids creating // a per-configuration Info.plist file. this->CurrentLocalGenerator ->GenerateFrameworkInfoPList(&target, "$(EXECUTABLE_NAME)", @@ -2032,7 +2066,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget) case cmTarget::STATIC_LIBRARY: return "archive.ar"; case cmTarget::MODULE_LIBRARY: - return ((this->XcodeVersion >= 22)? + if (cmtarget.IsCFBundleOnApple()) + return "wrapper.plug-in"; + else + return ((this->XcodeVersion >= 22)? "compiled.mach-o.executable" : "compiled.mach-o.dylib"); case cmTarget::SHARED_LIBRARY: return (cmtarget.GetPropertyAsBool("FRAMEWORK")? @@ -2052,8 +2089,12 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget) case cmTarget::STATIC_LIBRARY: return "com.apple.product-type.library.static"; case cmTarget::MODULE_LIBRARY: - return ((this->XcodeVersion >= 22)? "com.apple.product-type.tool" : - "com.apple.product-type.library.dynamic"); + if (cmtarget.IsCFBundleOnApple()) + return "com.apple.product-type.bundle"; + else + return ((this->XcodeVersion >= 22)? + "com.apple.product-type.tool" : + "com.apple.product-type.library.dynamic"); case cmTarget::SHARED_LIBRARY: return (cmtarget.GetPropertyAsBool("FRAMEWORK")? "com.apple.product-type.framework" : diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 049a338..1e9a670 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -26,6 +26,12 @@ cmMakefileLibraryTargetGenerator ::cmMakefileLibraryTargetGenerator(cmTarget* target): cmMakefileTargetGenerator(target) { + if(this->Target->IsCFBundleOnApple()) + { + target->SetProperty("PREFIX", ""); + target->SetProperty("SUFFIX", ""); + } + this->CustomCommandDriver = OnDepends; this->Target->GetLibraryNames( this->TargetNameOut, this->TargetNameSO, this->TargetNameReal, @@ -41,6 +47,20 @@ cmMakefileLibraryTargetGenerator this->MacContentDirectory += this->FrameworkVersion; this->MacContentDirectory += "/"; } + else if(this->Target->IsCFBundleOnApple()) + { + this->MacContentDirectory = this->Target->GetDirectory(this->ConfigName); + this->MacContentDirectory += "/"; + this->MacContentDirectory += this->TargetNameOut; + this->MacContentDirectory += "."; + const char *ext = this->Target->GetProperty("BUNDLE_EXTENSION"); + if (!ext) + { + ext = "bundle"; + } + this->MacContentDirectory += ext; + this->MacContentDirectory += "/Contents/"; + } } //---------------------------------------------------------------------------- @@ -301,6 +321,27 @@ cmMakefileLibraryTargetGenerator } //---------------------------------------------------------------------------- +void +cmMakefileLibraryTargetGenerator::CreateCFBundle(std::string& targetName, + std::string& outpath) +{ + // Compute bundle directory names. + outpath = this->MacContentDirectory; + outpath += "MacOS"; + cmSystemTools::MakeDirectory(outpath.c_str()); + this->Makefile->AddCMakeOutputFile(outpath.c_str()); + outpath += "/"; + + // Configure the Info.plist file. Note that it needs the executable name + // to be set. + std::string plist = this->MacContentDirectory + "Info.plist"; + this->LocalGenerator->GenerateAppleInfoPList(this->Target, + targetName.c_str(), + plist.c_str()); + this->Makefile->AddCMakeOutputFile(plist.c_str()); +} + +//---------------------------------------------------------------------------- void cmMakefileLibraryTargetGenerator::WriteLibraryRules (const char* linkRuleVar, const char* extraFlags, bool relink) { @@ -354,6 +395,12 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules outpath = this->MacContentDirectory; this->CreateFramework(targetName); } + else if(this->Target->IsCFBundleOnApple()) + { + outpath = this->Target->GetDirectory(this->ConfigName); + outpath += "/"; + this->CreateCFBundle(targetName, outpath); + } else if(relink) { outpath = this->Makefile->GetStartOutputDirectory(); @@ -417,6 +464,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules buildEcho += " shared library "; break; case cmTarget::MODULE_LIBRARY: + if (this->Target->IsCFBundleOnApple()) + buildEcho += " CFBundle"; buildEcho += " shared module "; break; default: diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h index 2f085ad..f3c47db 100644 --- a/Source/cmMakefileLibraryTargetGenerator.h +++ b/Source/cmMakefileLibraryTargetGenerator.h @@ -33,6 +33,7 @@ protected: // MacOSX Framework support methods void WriteFrameworkRules(bool relink); void CreateFramework(std::string const& targetName); + void CreateCFBundle(std::string& targetName, std::string& outpath); // Store the computd framework version for OS X Frameworks. std::string FrameworkVersion; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 26328cf..1c0c957 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -484,17 +484,21 @@ void cmSourceFile::DefineProperties(cmake *cm) cm->DefineProperty ("MACOSX_PACKAGE_LOCATION", cmProperty::SOURCE_FILE, - "Place a source file inside a Mac OS X bundle or framework.", + "Place a source file inside a Mac OS X bundle, CFBundle, or framework.", "Executable targets with the MACOSX_BUNDLE property set are built " "as Mac OS X application bundles on Apple platforms. " "Shared library targets with the FRAMEWORK property set are built " "as Mac OS X frameworks on Apple platforms. " + "Module library targets with the BUNDLE property set are built " + "as Mac OS X CFBundle bundles on Apple platforms. " "Source files listed in the target with this property set will " "be copied to a directory inside the bundle or framework content " "folder specified by the property value. " "For bundles the content folder is \".app/Contents\". " "For frameworks the content folder is " "\".framework/Versions/\". " + "For cfbundles the content folder is " + "\".bundle/Contents\" (unless the extension is changed). " "See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target " "properties for specifying files meant for Headers, PrivateHeaders, " "or Resources directories."); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9a698c0..6e33b71 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -194,6 +194,22 @@ void cmTarget::DefineProperties(cmake *cm) "the target is built."); cm->DefineProperty + ("BUNDLE", cmProperty::TARGET, + "This target is a CFBundle on the Mac.", + "If a module library target has this property set to true it will " + "be built as a CFBundle when built on the mac. It will have the " + "directory structure required for a CFBundle and will be suitable " + "to be used for creating Browser Plugins or other application " + "resources."); + + cm->DefineProperty + ("BUNDLE_EXTENSION", cmProperty::TARGET, + "The file extension used to name a BUNDLE target on the Mac.", + "The default value is \"bundle\" - you can also use \"plugin\" or " + "whatever file extension is required by the host app for your " + "bundle."); + + cm->DefineProperty ("FRAMEWORK", cmProperty::TARGET, "This target is a framework on the Mac.", "If a shared library target has this property set to true it will " @@ -1204,6 +1220,14 @@ bool cmTarget::IsAppBundleOnApple() } //---------------------------------------------------------------------------- +bool cmTarget::IsCFBundleOnApple() +{ + return (this->GetType() == cmTarget::MODULE_LIBRARY && + this->Makefile->IsOn("APPLE") && + this->GetPropertyAsBool("BUNDLE")); +} + +//---------------------------------------------------------------------------- class cmTargetTraceDependencies { public: diff --git a/Source/cmTarget.h b/Source/cmTarget.h index f2b7d61..b0e20ba 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -430,6 +430,9 @@ public: Apple. */ bool IsFrameworkOnApple(); + /** Return whether this target is a CFBundle (plugin) on Apple. */ + bool IsCFBundleOnApple(); + /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple(); diff --git a/Tests/CFBundleTest/CMakeLists.txt b/Tests/CFBundleTest/CMakeLists.txt new file mode 100644 index 0000000..347578b --- /dev/null +++ b/Tests/CFBundleTest/CMakeLists.txt @@ -0,0 +1,53 @@ +#this is adapted from FireBreath (http://www.firebreath.org) + +cmake_minimum_required(VERSION 2.8) + +project(CFBundleTest) + +include(PluginConfig.cmake) + +message ("Creating Mac Browser Plugin project ${PROJECT_NAME}") +set(SOURCES + np_macmain.cpp + Localized.r + ${CMAKE_CURRENT_BINARY_DIR}/Info.plist + ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings + ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc +) + +add_library( ${PROJECT_NAME} MODULE + ${SOURCES} + ) + +set (RCFILES ${CMAKE_CURRENT_SOURCE_DIR}/Localized.r) + +configure_file(Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) +configure_file(InfoPlist.strings.in ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings) + +# Compile the resource file +find_program(RC_COMPILER Rez NO_DEFAULT_PATHS) + +execute_process(COMMAND + ${RC_COMPILER} ${RCFILES} -useDF -o ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc + ) + +set_source_files_properties( + ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc + PROPERTIES GENERATED 1 + ) +# note that for some reason, the makefile and xcode generators use a different +# property to indicate where the Info.plist file is :-/ For that reason, we +# specify it twice so it will work both places +set_target_properties(CFBundleTest PROPERTIES + BUNDLE 1 + BUNDLE_EXTENSION plugin + XCODE_ATTRIBUTE_WRAPPER_EXTENSION plugin #sets the extension to .plugin + XCODE_ATTRIBUTE_MACH_O_TYPE mh_bundle + XCODE_ATTRIBUTE_INFOPLIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/Info.plist + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist + LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_SOURCE_DIR}/ExportList_plugin.txt\"") + +set_source_files_properties( + ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings + ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc + PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/English.lproj") diff --git a/Tests/CFBundleTest/ExportList_plugin.txt b/Tests/CFBundleTest/ExportList_plugin.txt new file mode 100644 index 0000000..31d6f64 --- /dev/null +++ b/Tests/CFBundleTest/ExportList_plugin.txt @@ -0,0 +1,3 @@ +_NP_GetEntryPoints +_NP_Initialize +_NP_Shutdown diff --git a/Tests/CFBundleTest/Info.plist.in b/Tests/CFBundleTest/Info.plist.in new file mode 100644 index 0000000..638002f --- /dev/null +++ b/Tests/CFBundleTest/Info.plist.in @@ -0,0 +1,54 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${PLUGIN_NAME} + CFBundleGetInfoString + ${PLUGIN_NAME} ${FBSTRING_PLUGIN_VERSION}, ${FBSTRING_LegalCopyright} + CFBundleIdentifier + com.${ACTIVEX_PROGID} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BRPL + CFBundleShortVersionString + ${PLUGIN_NAME} ${FBSTRING_PLUGIN_VERSION} + CFBundleSignature + ???? + CFBundleVersion + ${FBSTRING_PLUGIN_VERSION} + CFPlugInDynamicRegisterFunction + + CFPlugInDynamicRegistration + NO + CFPlugInFactories + + 00000000-0000-0000-0000-000000000000 + MyFactoryFunction + + CFPlugInTypes + + 00000000-0000-0000-0000-000000000000 + + 00000000-0000-0000-0000-000000000000 + + + CFPlugInUnloadFunction + + WebPluginName + ${FBSTRING_ProductName} + WebPluginDescription + ${FBSTRING_FileDescription} + WebPluginMIMETypes + + ${FBSTRING_MIMEType} + + WebPluginTypeDescription + ${FBSTRING_FileDescription} + + + + diff --git a/Tests/CFBundleTest/InfoPlist.strings.in b/Tests/CFBundleTest/InfoPlist.strings.in new file mode 100644 index 0000000..790ead0 --- /dev/null +++ b/Tests/CFBundleTest/InfoPlist.strings.in @@ -0,0 +1,4 @@ +/* Localized versions of Info.plist keys */ + +CFBundleName = "${PLUGIN_NAME}.plugin"; +NSHumanReadableCopyright = "${FBSTRING_LegalCopyright}"; diff --git a/Tests/CFBundleTest/Localized.r b/Tests/CFBundleTest/Localized.r new file mode 100644 index 0000000..e988e26 --- /dev/null +++ b/Tests/CFBundleTest/Localized.r @@ -0,0 +1,18 @@ +#include + +resource 'STR#' (126) +{ { + "${FBSTRING_LegalCopyright}", + "${FBSTRING_ProductName}" +} }; + +resource 'STR#' (127) +{ { + "${FBSTRING_FileDescription}" +} }; + +resource 'STR#' (128) +{ { + "${FBSTRING_MIMEType}", + "${FBSTRING_FileExtents}" +} }; diff --git a/Tests/CFBundleTest/Localized.rsrc b/Tests/CFBundleTest/Localized.rsrc new file mode 100644 index 0000000..cbf3523 Binary files /dev/null and b/Tests/CFBundleTest/Localized.rsrc differ diff --git a/Tests/CFBundleTest/PluginConfig.cmake b/Tests/CFBundleTest/PluginConfig.cmake new file mode 100644 index 0000000..763ddcc --- /dev/null +++ b/Tests/CFBundleTest/PluginConfig.cmake @@ -0,0 +1,21 @@ +#/**********************************************************\ +# Auto-Generated Plugin Configuration file +# for CFTestPlugin +#\**********************************************************/ + +set(PLUGIN_NAME "CFTestPlugin") +set(PLUGIN_PREFIX "CFTP") +set(COMPANY_NAME "FBDevTeam") + +set(MOZILLA_PLUGINID "@firebreath.googlecode.com/CFTestPlugin") + +# strings +set(FBSTRING_CompanyName "Firebreath Dev Team") +set(FBSTRING_FileDescription "CFBundle Test Plugin - Plugin for testing cmake patch to improve FireBreath project generation") +set(FBSTRING_PLUGIN_VERSION "1.0.0") +set(FBSTRING_LegalCopyright "Copyright 2010 Firebreath Dev Team") +set(FBSTRING_PluginFileName "np${PLUGIN_NAME}.dll") +set(FBSTRING_ProductName "CFTestPlugin") +set(FBSTRING_FileExtents "") +set(FBSTRING_PluginName "CFTestPlugin") +set(FBSTRING_MIMEType "application/x-fbtestplugin") diff --git a/Tests/CFBundleTest/README.txt b/Tests/CFBundleTest/README.txt new file mode 100644 index 0000000..248651b --- /dev/null +++ b/Tests/CFBundleTest/README.txt @@ -0,0 +1,16 @@ + +CFBundle test project. The generated .plugin/ bundle from either makefiles or XCode should look like this: + +./Contents +./Contents/Info.plist +./Contents/MacOS +./Contents/MacOS/CFBundleTest +./Contents/Resources +./Contents/Resources/English.lproj +./Contents/Resources/English.lproj/InfoPlist.strings +./Contents/Resources/English.lproj/Localized.rsrc + +file Contents/MacOS/CFBundleTest should return something like: +Contents/MacOS/CFBundleTest: Mach-O 64-bit bundle x86_64 + +It is okay if it is a 32 bit binary; if it is not Mach-O, or is spelled differently, it is not okay. diff --git a/Tests/CFBundleTest/VerifyResult.cmake b/Tests/CFBundleTest/VerifyResult.cmake new file mode 100644 index 0000000..e622900 --- /dev/null +++ b/Tests/CFBundleTest/VerifyResult.cmake @@ -0,0 +1,32 @@ +if(NOT DEFINED CTEST_CONFIGURATION_TYPE) + message(FATAL_ERROR "expected variable CTEST_CONFIGURATION_TYPE not defined") +endif() + +if(NOT DEFINED dir) + message(FATAL_ERROR "expected variable dir not defined") +endif() + +if(NOT DEFINED gen) + message(FATAL_ERROR "expected variable gen not defined") +endif() + +message(STATUS "CTEST_CONFIGURATION_TYPE='${CTEST_CONFIGURATION_TYPE}'") +message(STATUS "dir='${dir}'") +message(STATUS "gen='${gen}'") + +if(gen MATCHES "Make" OR + "${CTEST_CONFIGURATION_TYPE}" STREQUAL "" OR + "${CTEST_CONFIGURATION_TYPE}" STREQUAL "." OR + "${CTEST_CONFIGURATION_TYPE}" STREQUAL "NoConfig") + set(expected_filename "${dir}/CFBundleTest.plugin/Contents/MacOS/CFBundleTest") +else() + set(expected_filename "${dir}/${CTEST_CONFIGURATION_TYPE}/CFBundleTest.plugin/Contents/MacOS/CFBundleTest") +endif() + +if(NOT EXISTS "${expected_filename}") + message(FATAL_ERROR "test fails: expected output file does not exist [${expected_filename}]") +endif() + +file(COPY "${expected_filename}" + DESTINATION "${dir}/LatestBuildResult" + ) diff --git a/Tests/CFBundleTest/np_macmain.cpp b/Tests/CFBundleTest/np_macmain.cpp new file mode 100644 index 0000000..78004d0 --- /dev/null +++ b/Tests/CFBundleTest/np_macmain.cpp @@ -0,0 +1,49 @@ +/***********************************************************\ + Written by: Richard Bateman (taxilian) + + Based on the default np_macmain.cpp from FireBreath + http://firebreath.googlecode.com + + This file has been stripped to prevent it from accidently + doing anything useful. +\***********************************************************/ + + +#include + +typedef void (*NPP_ShutdownProcPtr)(void); +typedef short NPError; + +#pragma GCC visibility push(default) + +struct NPNetscapeFuncs; +struct NPPluginFuncs; + +extern "C" { + NPError NP_Initialize(NPNetscapeFuncs *browserFuncs); + NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs); + NPError NP_Shutdown(void); +} + +#pragma GCC visibility pop + +void initPluginModule() +{ +} + +NPError NP_GetEntryPoints(NPPluginFuncs* pFuncs) +{ + printf("NP_GetEntryPoints()\n"); + return 0; +} + +NPError NP_Initialize(NPNetscapeFuncs* pFuncs) +{ + printf("NP_Initialize()\n"); + return 0; +} + +NPError NP_Shutdown() +{ + return 0; +} diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index faaa177..3da12d9 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1110,6 +1110,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest") + ADD_TEST(CFBundleTest ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CFBundleTest" + "${CMake_BINARY_DIR}/Tests/CFBundleTest" + --build-two-config + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project CFBundleTest + --test-command + ${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=\${CTEST_CONFIGURATION_TYPE} + -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest + -Dgen=${CMAKE_TEST_GENERATOR} + -P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake) + LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") + ADD_TEST_MACRO(ObjC++ ObjC++) ENDIF (APPLE AND CMAKE_COMPILER_IS_GNUCXX) -- cgit v0.12 From 42b26ee5db46d8f8ee5b79e234fd212d61e5b3a3 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 11 Jan 2011 15:24:50 -0500 Subject: ExternalProject Test: Increase test timeout value Previously, it was hard-coded at 1000 seconds. Now it uses the value of CMAKE_LONG_TEST_TIMEOUT, which has a minimum value of 1500 seconds, but might have a longer value depending on the CTEST_TEST_TIMEOUT value of the driving dashboard. This should help avoid test failures on overloaded dashboard machines where it really does take that long to finish the test successfully. --- Tests/CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index faaa177..d872fa7 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -792,11 +792,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CTEST_COMMAND} -V ) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject") - # The ExternalProject test takes 900 seconds on some machines! - GET_TEST_PROPERTY(ExternalProject TIMEOUT PREVIOUS_TIMEOUT) - IF("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - SET_TESTS_PROPERTIES(ExternalProject PROPERTIES TIMEOUT 1000) - ENDIF("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + SET_TESTS_PROPERTIES(ExternalProject PROPERTIES + TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) # do each of the tutorial steps FOREACH(STP RANGE 1 7) -- cgit v0.12 From cabc407912bb3bc0bb954e317a999cb2ee64de57 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 11 Jan 2011 16:48:37 -0500 Subject: CFBundle Test: Add PATHS for finding Rez (#11295) Some older dashboard machines do not have Rez in /usr/bin like us modern folk. But most of them will have it in /Developer/Tools... So make sure we look there. --- Tests/CFBundleTest/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/CFBundleTest/CMakeLists.txt b/Tests/CFBundleTest/CMakeLists.txt index 347578b..8fd9efd 100644 --- a/Tests/CFBundleTest/CMakeLists.txt +++ b/Tests/CFBundleTest/CMakeLists.txt @@ -25,7 +25,10 @@ configure_file(Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) configure_file(InfoPlist.strings.in ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings) # Compile the resource file -find_program(RC_COMPILER Rez NO_DEFAULT_PATHS) +find_program(RC_COMPILER Rez NO_DEFAULT_PATHS PATHS /Developer/Tools) +if(NOT RC_COMPILER) + message(FATAL_ERROR "could not find Rez to build resources from .r file...") +endif() execute_process(COMMAND ${RC_COMPILER} ${RCFILES} -useDF -o ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc -- cgit v0.12 From 799efb4a2c173e44ae2244448658f2f00ade4778 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 12 Jan 2011 09:32:11 -0500 Subject: CMake 2.8.4-rc1 --- CMakeLists.txt | 6 +- ChangeLog.manual | 308 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 311 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4508e33..ea35e21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -419,9 +419,9 @@ ENDIF() # The CMake version number. SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 8) -SET(CMake_VERSION_PATCH 3) -#SET(CMake_VERSION_TWEAK 0) -#SET(CMake_VERSION_RC 1) +SET(CMake_VERSION_PATCH 4) +SET(CMake_VERSION_TWEAK 0) +SET(CMake_VERSION_RC 1) # Releases define a tweak level. IF(DEFINED CMake_VERSION_TWEAK) diff --git a/ChangeLog.manual b/ChangeLog.manual index c2e2cdf..bccf485 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,311 @@ +Changes in CMake 2.8.4-rc1 (since 2.8.3) +---------------------------------------- +Alex Neundorf (32): + Add support for nasm assembler, patch by Peter Collingbourne (see #10069) + Improve misleading comments. + Add missing copyright headers + We already have 2010, fix copyright year. + Make FindBISON work properly with non-C locales (#11326) + Add support for yasm, a nasm compatible assembler + Use CMAKE_ASM_NASM_FLAGS for nasm instead of FLAGS + Remove trailing whitespace and minor formatting changes for the dot-code + Move the code for collecting targets and libraries into separate functions + Properly insert all targets, also those which don't link to anything. + Generate separate dot files for each target, and a big one with everything. + Move the code for generating dot-files into separate class cmGraphVizWriter + Fix #11421: FindQt3.cmake doesn't honor the REQUIRED keyword + Remove trailing whitespace + Don't enforce VERBOSE makefiles for the CodeBlocks generator + Remove the "early alpha stage" comments about Eclipse and C::B + Don't disable colors in the CodeBlocks generator and minor cleanup. + Some more fixes for nasm support, from Etienne (#10069) + Enable/disable generating graphs depending on the target type + Use std::cout instead of fprintf + Collect targets and libs on demand instead of in the ctor + Exclude targets from the graphviz file based on a regex + Include CMakeDetermineCompilerId in CMakeDetermineASMCompiler.cmake (#11467) + Fix typos in the doc + Add cache var CMAKE_ECLIPSE_MAKE_ARGUMENTS when using the Eclipse generator + Add ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT as a ADVANCED cache variable (#9631) + Fix crash in Eclipse generator with empty project (#11616) + Fix indentation in cmPolicies::ApplyPolicyVersion() + Remove trailing whitespace + Prefer files from CMAKE_ROOT when including from CMAKE_ROOT + Improve documentation and messages for the new CMP0017 + Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017 + +Alexey Ozeritsky (5): + FindBLAS works in C/C++ projects without Fortran + ACML find fixes (issue 0011219) + find ACML fixes + fix for Fortran-only projects + FindLAPACK works with C/C++ only projects (issue 0009976) + +Andrius Å tikonas (1): + Modules: Fix spelling 'becase' -> 'because'. + +Ben Boeckel (25): + Fix parsing of cache variables without a type + Use cmCacheManager to load entries from the cache + Support manual cache entries + Condense parsing of cache entries + Use FPHSA in FindOpenGL + Ignore strerror_r since CMake isn't threaded + Use _POLL_EMUL_H_ instead of HAVE_POLL_FINE + Rename WorkingDirectory test + Add WORKING_DIRECTORY argument to add_test + Add tests for WORKING_DIRECTORY arg to add_test + Rename the project to match the test + Fix header includes for C++ and Visual Studio + Add ctype.h include for toupper() + Flip slashes around on Windows + Use --><-- markers to denote the path + Simplify the _default_cwd derivation + Only test the default cwd with Makefiles + Group adding tests with its properties + Fully specify the path to old-signature add_test + Use iostream to make Borland happy + Check for poll when looking for _POLL_EMUL_H_ + Toss out strerror_r macros + Fix missed _POLL_EMUL_H_ and HAVE_POLL combo + Make TestsWorkingDirectory test a C file + Pass the expected value as the first argument + +Bill Hoffman (17): + Fixes for the OSF operating system build. + Add a fix for the inline keyword on the osf os. + Add a "Contract" test for VTK. The test downloads and builds VTK. + Fix contract test so it is not hard coded to the vtk542 test. + Fix incremental linking for VS2010 with nmake or make. + Change cpack run and verify script to work with multi-config generators. + Fix vs2010 project generation error when HEADER_FILE_ONLY is set. + Add more documentation for LANGUAGE property. + Add flags to resource builds on vs 2010 with a test. + Disable incremental testing for this test, it crashes vs9 linker. + Only run resource test for MSVC compilers. + Add support for windows resources with mingw/msys. + Add support for windres to cygwin. + Add testing for windows resources for mingw/msys/cygwin and remove for watcom. + Enable resource building with the intel compiler on windows. + Add support for source files in custom targets for VS 10 (Bug#11330). + Change the nightly tests to build from the nightly branch and not next. + +Brad King (90): + Store direct dependencies in solutions for VS >= 8 + BUG: Fix compiler flag test for non-English MSVC (#11336) + Document custom command behavior without DEPENDS (#11407) + Consolidate duplicate link rule make dependency code + Define LINK_DEPENDS target property (#11406) + KWSys: Teach SystemInformation about WinXP Pro and Win7 + Fix Intel .vfproj SubSystem attribute values + Set Intel .vfproj RuntimeLibrary attribute + Create Fortran info variables for .mod behavior + Teach CMake about Cray C, C++, and Fortran compilers + Speedup find_* commands (#11412) + Prefer non-empty prefixes when matching lib names (#11468) + Record edge type in global dependency graph + Use modern global dependency graph for VS < 8 deps + Allow add_dependencies() on imported targets (#10395) + Pass Mac linker flag through PGI compiler using "-Wl," + Modernize FindITK module (#11494) + Fix find_* argument parsing crash (#11513) + Skip VS <= 7.1 dependency analysis for VS >= 8 + Enable 64-bit tools with VS 2010 Express (#9981, #10722) + KWSys: Associate installed library with an EXPORT + Fix try_compile RemoveFile anti-virus loop (#11503) + Fix Fortran .mod timestamps with Cray compiler + Make Fortran $obj.provides.build targets not .PHONY + Honor custom command dependencies on imported targets (#10395) + Improve signature of cmLocalGenerator::GetRealDependency + Skip file-level dependencies on custom targets (#11332) + Simplify VS generator ConstructScript interface + Factor out common custom command generator + Remove cmLocalGenerator::GetRealLocation + KWSys: Remove realpath from SystemTools::GetPath (#10335) + Fix parallel "make install" of CMake itself + CTest: Fix ctest_sleep documentation (#11554) + Fix soname in cross-compiled targets with Mac host (#11547) + Detect object files in implicit link information + Allow Fortran platform files to set empty values + Recognize the NAG Fortran compiler + Add NAG Fortran compiler information files + FortranCInterface: Recognize NAG Fortran module symbols + Remove unused variable "rootdir" in VS generators + Avoid msbuild idiosyncrasy that builds multiple configs (#11594) + Remove unused parameter "root" in some VS generator methods + Fix dependency tracing of INSTALL and PACKAGE (#11598) + Remove unused GLOBAL_TARGET generation code + KWSys: Use EXPORT name only if installing library + Write full version into try_compile CMakeLists + KWSys: Do not mangle UNC paths in ConvertToUnixOutputPath (#10206) + Normalize add_custom_command OUTPUT names (#10485) + Make link rule depend on ".def" file (#11014) + Document target_link_libraries target scope (#11058) + Record backtrace in cmCustomCommand + Factor generator expression docs out of add_test + Factor per-config sample targets out of 'Testing' test + Optionally suppress errors in cmGeneratorExpression + Record set of targets used in cmGeneratorExpression + Introduce "generator expression" syntax to custom commands (#11209) + CTest: Fix test DEPEND cycle detection + Make Intel defines consistent with MSVC on Windows (#9904) + CTest: Fix line-too-long style in DEPEND cycle error + Detect Fortran target architecture on Windows + Modernize Intel compiler info on Windows + Remove unused old-style g++ info file + CheckCCompilerFlag: Strict signature of 'main' (#11615) + Warn in find(GLOB) docs about bad use case (#11617) + Remove call to SystemTools::GetMaximumFilePathLength + Xcode: Generate native 3.2 projects + Declare min CMake version in --system-information project + Cygwin: Fix tests to check CYGWIN instead of WIN32 + Cygwin: Do not define 'WIN32' (#10122) + Revert "Remove unused parameter "root" in some VS generator methods" + Revert "Avoid msbuild idiosyncrasy that builds multiple configs" (#11633) + Avoid msbuild ".\" idiosyncrasy that builds multiple configs (#11594) + Mark CustomCommand test perconfig.out as SYMBOLIC + CTest: Factor out duplicate Git author/committer code + KWSys: Avoid buffer overflow in SystemInformation (#11018) + Fix sentence break in add_test documentation + Pass Mac linker flag through all compilers with -Wl, + KWSys: Avoid passing string literal as char* + Avoid passing string literal to char* type + Fix constness in compiler id detection + Build enable_language command during bootstrap + Map multiple /FI flags for VS < 10 (#11649) + KWSys: Remove useless include (#11648) + Allow users to specify defaults for unset policies + ccmake: Use LSB 4.0 curses API conditionally + CTest: Do not truncate UTF-8 test output too early (#10656) + ccmake: Use LSB 4.0 getmaxyx conditionally + Allow platform files to set large archive rules (#11674) + Document reading LOCATION early as undefined (#11671) + Document reading LOCATION_ early as undefined (#11671) + +Brian Bassett (1): + VS: Fix linking of Fortran-only DLL projects (#10803) + +Campbell Barton (1): + Honor RULE_MESSAGES property for build target messages + +Chuck Atkins (1): + CTest: Teach launcher to ignore empty/no-op make commands + +Clinton Stimpson (11): + Fix regex for moc includes when looking for frameworks. + cmake-gui: use BundleUtilities in place of custom script. + Fix regression in 2dae2f1 which added find of Qt imports dir. + Force cmake to run again when qrc dependency scanning needs to happen. + Fix regression to allow specifying a CMakeCache.txt file on the command line. + BundleUtilities: only do rpath strip on copied prerequisites. + Fix build issues cross compiling with static Qt. + CTest: multiple ctest_test calls w/LABEL regexs (#11487) + cmake-gui: always enable generate button. + allow absolute paths for dbus interface. + Add support for using static/dynamic Qt plugins. + +Craig Scott (1): + ccmake: Port for LSB 4.0 (#11648) + +Dave Abrahams (1): + FindPerlLibs: Fix for Mac locally applied patches + +David Cole (31): + Add a contract test for building the CSE. + Enable overriding contract test timeout values. + Update tag in the Contracts/cse-snapshot test. + Make HTML test fail when --nonet arg is not available. + Begin post-2.8.3 development + No CMake.HTML test if xmllint has no --nonet. + Suppress "loop was vectorized" "warnings." + Add contract test for Trilinos 10.6.1 snapshot. + Honor FOLDER on include_external_msproject targets (#11436) + Correct misspelling in error message text. + BundleUtilities: error if fixup_bundle_item called on non-embedded item + VS10: stop build on custom command error (#11533) + CPack: look for makensis in the PATH (#8210) + VS10: avoid warning, no nologo when verbose (#10587) + Use m prefix in shorttag value to indicate "md5 of tarball" + Establish pass criteria for the Trilinos contract test. + Suppress erroneous warnings from Intel compiler + Avoid running CMake.Install test simultaneously with other tests + VS10: Finish Midl support (#11461) + Prohibit space in HOME value for VSMidl test. + KWSys: Fix CPU speed calculations (#9963) + KWSys: Retrieve QNX specific memory and processor info (#11329) + Improve build error detection. + VSMidl Test: Use correct include_directories with VS6 (#11461) + Add PATH_SUFFIXES for finding git. + ExternalProject: Avoid bleed-through output when logging. + Fix WOW64 registry mode on Windows 2000 (#10759) + ExternalProject: Replace location tags in CMAKE_CACHE_ARGS + CPack: Detect more URLs in CPACK_NSIS_MENU_LINKS (#10644) + KWSys: Fix WOW64 registry mode on Windows 2000 (#10759) + CPack: Add CPACK_NSIS_INSTALL_ROOT variable (#9148) + +Eric NOULARD (13): + CPackRPM add basic component support to CPackRPM + CPack fix kwstyle breakage and make CPackRPM backward compatible + CPack backward compatibility fix 2.8.3-2.8.2 (bug 11452) + CPack Fix KWStyle error + CPack Honor CPACK_MONOLITHIC_INSTALL at CPack time too + CPack use IsOn when it's better than IsSet + CPackRPM fix bug 0011595 : Can't generate RPMs (on FC11...) + CPack new tests for component install + CPack Default component test for ZIP should be OK + CPackTest spit out more output in case of failure + Arrange output in a better way + Precise the project config type when invoking cpack + CPackSTGZ quote here-doc, fix bug10518 + +Kai Wasserbäch (1): + FindTCL: Fix TCL and TK version variable references (#11528) + +Marcus D. Hanwell (5): + BUG 11451 - pass CMAKE_EXTRA_GENERATOR down. + Added CMAKE_CACHE_ARGS to ExternalProject. + Escape file write expansion, and build up lists. + Fixed bug where last entry would be lost. + Python additional version support, bug #10279. + +Matthias Kretz (1): + Inline help in vim with vertical split. + +Mike McQuaid (6): + Fix incorrect variable documentation (#11127) + Add variable for InstallRequiredSystemLibraries dir (#11140) + InstallRequiredSystemLibraries debug-only (#11141) + Allow NSIS package or uninstall icon (#11143) + Add CPACK_NSIS_EXECUTABLES_DIRECTORY (#7828) + Add CPack NSIS MUI_FINISHPAGE_RUN support (#11144) + +Philip Lowman (8): + 11363: FindBoost.cmake fails to find debug libraries in tagged layout install + 11429: FindGTK2 does not find libraries built for Visual Studio 2010 + 11430: FindBullet doesn't find header files installed by Bullet >= 2.77 + 11384: FindCxxTest now includes test code in VS project + [patch] Add Boost 1.45 to search, simplify a check removing VERSION_LESS + Add Boost 1.46 + Fix spelling BOOST_LIBRARYDIR message. Add error for common misspellings. + Lowercase all function names and improve consistency + +Rolf Eike Beer (2): + allow STRING(SUBSTRING) work with length -1 as "rest of the string" + Add the WORKING_DIRECTORY property to tests + +Wojciech Migda (1): + Recognize the Texas Instruments DSP compiler (#11645) + +Yaakov Selkowitz (2): + Cygwin: Use 'cyg' prefix for module DLLs (#10122) + Cygwin: Fix release script libncurses search patterns (#10766) + +Zach Mullen (4): + Remove debugging message from parallel ctest + CTest git update should pass the committer as well as the author + Support explicitly set test costs in non-parallel testing. + Test TIMEOUT property explicitly set to zero should be honored + No changes in CMake 2.8.3 since 2.8.3-rc4. Changes in CMake 2.8.3-rc4 (since 2.8.3-rc3) -- cgit v0.12 From 8704525f201452929a2bec96fb04387c97ad8a79 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 14 Jan 2011 10:03:22 -0500 Subject: Reject directory names containing '=' (#11689) Some characters are not well-supported by native build systems. Reject paths containing such characters before even trying to configure a project. --- Source/cmake.cxx | 24 ++++++++++++++++++++++++ Source/cmake.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 1b49837..bc3245e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1946,8 +1946,32 @@ int cmake::Configure() } +bool cmake::RejectUnsupportedPaths(const char* desc, std::string const& path) +{ + // Some characters are not well-supported by native build systems. + std::string::size_type pos = path.find_first_of("="); + if(pos == std::string::npos) + { + return false; + } + cmOStringStream e; + e << "The path to the " << desc << " directory:\n" + << " " << path << "\n" + << "contains unsupported character '" << path[pos] << "'.\n" + << "Please use a different " << desc << " directory name."; + cmListFileBacktrace bt; + this->IssueMessage(cmake::FATAL_ERROR, e.str(), bt); + return true; +} + int cmake::ActualConfigure() { + if(this->RejectUnsupportedPaths("source", this->cmHomeDirectory) || + this->RejectUnsupportedPaths("binary", this->HomeOutputDirectory)) + { + return 1; + } + // Construct right now our path conversion table before it's too late: this->UpdateConversionPathTable(); this->CleanupCommandsAndMacros(); diff --git a/Source/cmake.h b/Source/cmake.h index 435d38b..6744ca1 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -435,6 +435,8 @@ protected: ///! Find the full path to one of the cmake programs like ctest, cpack, etc. std::string FindCMakeProgram(const char* name) const; + + bool RejectUnsupportedPaths(const char* desc, std::string const& path); private: cmake(const cmake&); // Not implemented. void operator=(const cmake&); // Not implemented. -- cgit v0.12 From 43cb9b8276a70d153d56a69d5c61daaf2bc51b78 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Fri, 14 Jan 2011 21:26:19 -0700 Subject: Change to use fphsa to check required variables and version. Also, set the required variables based on components, if specified. Also, don't make finding uic required if not using QtGui. --- Modules/FindQt4.cmake | 179 +++++++++++++------------------------------------- 1 file changed, 46 insertions(+), 133 deletions(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index d9d6ea7..70e69b0 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -9,7 +9,7 @@ # QT_LIBRARIES variable. # # Typical usage could be something like: -# find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtXml REQUIRED ) +# find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml) # include(${QT_USE_FILE}) # add_executable(myexe main.cpp) # target_link_libraries(myexe ${QT_LIBRARIES}) @@ -354,6 +354,7 @@ ENDIF(QT_QT_LIBRARY) INCLUDE(CheckSymbolExists) INCLUDE(MacroAddFileDependencies) +INCLUDE(FindPackageHandleStandardArgs) SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake) @@ -469,6 +470,7 @@ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS DOC "The qmake executable for the Qt installation to use" ) +# double check that it was a Qt4 qmake, if not, re-find with different names IF (QT_QMAKE_EXECUTABLE) IF(QT_QMAKE_EXECUTABLE_LAST) @@ -477,8 +479,6 @@ IF (QT_QMAKE_EXECUTABLE) SET(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE) - SET(QT4_QMAKE_FOUND FALSE) - _qt4_query_qmake(QT_VERSION QTVERSION) # check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path @@ -495,74 +495,9 @@ IF (QT_QMAKE_EXECUTABLE) ENDIF(QT_QMAKE_EXECUTABLE) ENDIF(NOT QTVERSION) - # check that we found the Qt4 qmake, Qt3 qmake output won't match here - STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}") - IF (qt_version_tmp) - - # we need at least version 4.0.0 - IF (NOT QT_MIN_VERSION) - SET(QT_MIN_VERSION "4.0.0") - ENDIF (NOT QT_MIN_VERSION) - - #now parse the parts of the user given version string into variables - STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}") - IF (NOT req_qt_major_vers) - MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"") - ENDIF (NOT req_qt_major_vers) - - # now parse the parts of the user given version string into variables - STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}") - - # Suppport finding at least a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 ) - # This implementation is a hack to avoid duplicating code and make sure we stay - # source-compatible with CMake 2.6.x - IF( Qt4_FIND_VERSION ) - SET( QT_MIN_VERSION ${Qt4_FIND_VERSION} ) - SET( req_qt_major_vers ${Qt4_FIND_VERSION_MAJOR} ) - SET( req_qt_minor_vers ${Qt4_FIND_VERSION_MINOR} ) - SET( req_qt_patch_vers ${Qt4_FIND_VERSION_PATCH} ) - ENDIF( Qt4_FIND_VERSION ) - - IF (NOT req_qt_major_vers EQUAL 4) - MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"") - ENDIF (NOT req_qt_major_vers EQUAL 4) - - # and now the version string given by qmake - STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}") - - # compute an overall version number which can be compared at once - MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}") - MATH(EXPR found_vers "${QT_VERSION_MAJOR}*10000 + ${QT_VERSION_MINOR}*100 + ${QT_VERSION_PATCH}") - - # Support finding *exactly* a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 EXACT ) - IF( Qt4_FIND_VERSION_EXACT ) - IF(found_vers EQUAL req_vers) - SET( QT4_QMAKE_FOUND TRUE ) - ELSE(found_vers EQUAL req_vers) - SET( QT4_QMAKE_FOUND FALSE ) - IF (found_vers LESS req_vers) - SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE) - ELSE (found_vers LESS req_vers) - SET(QT4_INSTALLED_VERSION_TOO_NEW TRUE) - ENDIF (found_vers LESS req_vers) - ENDIF(found_vers EQUAL req_vers) - ELSE( Qt4_FIND_VERSION_EXACT ) - IF (found_vers LESS req_vers) - SET(QT4_QMAKE_FOUND FALSE) - SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE) - ELSE (found_vers LESS req_vers) - SET(QT4_QMAKE_FOUND TRUE) - ENDIF (found_vers LESS req_vers) - ENDIF( Qt4_FIND_VERSION_EXACT ) - ENDIF (qt_version_tmp) - ENDIF (QT_QMAKE_EXECUTABLE) -IF (QT4_QMAKE_FOUND) +IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # ask qmake for the mkspecs directory # we do this first because QT_LIBINFIX might be set @@ -1072,32 +1007,7 @@ IF (QT4_QMAKE_FOUND) # get the directory of the current file, used later on in the file GET_FILENAME_COMPONENT( _qt4_current_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) - ###################################### - # - # decide if Qt got found - # - ###################################### - - # if the includes,libraries,moc,uic and rcc are found then we have it - IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND - QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY) - SET( QT4_FOUND "YES" ) - INCLUDE(FindPackageMessage) - FIND_PACKAGE_MESSAGE(Qt4 "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})" - "[${QT_LIBRARY_DIR}][${QT_INCLUDE_DIR}][${QT_MOC_EXECUTABLE}][${QT_UIC_EXECUTABLE}][${QT_RCC_EXECUTABLE}]") - ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND - QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY) - SET( QT4_FOUND "NO") - SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE) - IF( Qt4_FIND_REQUIRED) - MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!") - ENDIF( Qt4_FIND_REQUIRED) - ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND - QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY) - SET(QT_FOUND ${QT4_FOUND}) - - ############################################### # # configuration/system dependent settings @@ -1189,44 +1099,47 @@ IF (QT4_QMAKE_FOUND) INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake") +ENDIF(QT_QMAKE_EXECUTABLE AND QTVERSION) - ####################################### - # - # compatibility settings - # - ####################################### - # Backwards compatibility for CMake1.4 and 1.2 - SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} ) - SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} ) - - SET( QT_QT_LIBRARY "") - -ELSE(QT4_QMAKE_FOUND) - - SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE) - - # The code below is overly complex to make sure we do not break compatibility with CMake 2.6.x - # For CMake 2.8, it should be simplified by getting rid of QT4_INSTALLED_VERSION_TOO_OLD and - # QT4_INSTALLED_VERSION_TOO_NEW - IF(Qt4_FIND_REQUIRED) - IF(QT4_INSTALLED_VERSION_TOO_OLD) - IF( Qt4_FIND_VERSION_EXACT ) - MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, version ${QT_MIN_VERSION} is required") - ELSE( Qt4_FIND_VERSION_EXACT ) - MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required") - ENDIF( Qt4_FIND_VERSION_EXACT ) - ELSE(QT4_INSTALLED_VERSION_TOO_OLD) - IF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW ) - MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too new, version ${QT_MIN_VERSION} is required") - ELSE( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW ) - MESSAGE( FATAL_ERROR "Qt qmake not found!") - ENDIF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW ) - ENDIF(QT4_INSTALLED_VERSION_TOO_OLD) - ELSE(Qt4_FIND_REQUIRED) - IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY) - MESSAGE(STATUS "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required") - ENDIF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY) - ENDIF(Qt4_FIND_REQUIRED) - -ENDIF (QT4_QMAKE_FOUND) +#support old QT_MIN_VERSION if set, but not if version is supplied by find_package() +IF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) + SET(Qt4_FIND_VERSION ${QT_MIN_VERSION}) +ENDIF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) + +IF( Qt4_FIND_COMPONENTS ) + + # if components specified in find_package(), make sure each of those pieces were found + SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR) + FOREACH( component ${Qt4_FIND_COMPONENTS} ) + STRING( TOUPPER ${component} _COMPONENT ) + SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) + ENDFOREACH( component ) + + if(Qt4_FIND_COMPONENTS MATCHES QtGui) + SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE) + endif(Qt4_FIND_COMPONENTS MATCHES QtGui) + +ELSE( Qt4_FIND_COMPONENTS ) + + # if no components specified, we'll make a default set of required variables to say Qt is found + SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR + QT_LIBRARY_DIR QT_QTCORE_LIBRARY) + +ENDIF( Qt4_FIND_COMPONENTS ) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 + REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} + VERSION_VAR QTVERSION + ) + +####################################### +# +# compatibility settings +# +####################################### +# Backwards compatibility for CMake1.4 and 1.2 +SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} ) +SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} ) +SET( QT_QT_LIBRARY "") +SET(QT_FOUND ${QT4_FOUND}) -- cgit v0.12 From 4c1c358332e9dd2b9ec165450f64d3a542e3433a Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 20 Jan 2011 11:45:39 -0500 Subject: FindQt4: Include builtin FindPackageHandleStandardArgs directly Apply to FindQt4 change from commit b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake everywhere, 2010-09-28). --- Modules/FindQt4.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 70e69b0..ec04cd2 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -354,7 +354,7 @@ ENDIF(QT_QT_LIBRARY) INCLUDE(CheckSymbolExists) INCLUDE(MacroAddFileDependencies) -INCLUDE(FindPackageHandleStandardArgs) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake) -- cgit v0.12 From 7befc00783ca9739e7585ff4d2b645a762a38396 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 Jan 2011 16:29:52 -0500 Subject: Handle trailing slashes on add_custom_command DEPENDS --- Source/cmLocalGenerator.cxx | 1 + Tests/CustomCommandWorkingDirectory/CMakeLists.txt | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d3cbc1f..cd265c1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1893,6 +1893,7 @@ bool cmLocalGenerator::GetRealDependency(const char* inName, { // This is a full path. Return it as given. dep = inName; + cmSystemTools::ConvertToUnixSlashes(dep); return true; } diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt index 57cb712..d272ffe 100644 --- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt +++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt @@ -9,8 +9,7 @@ ADD_CUSTOM_COMMAND( ) SET_SOURCE_FILES_PROPERTIES( - "${TestWorkingDir_BINARY_DIR}/working.c" - "${TestWorkingDir_BINARY_DIR}/customTarget.c" + "${TestWorkingDir_BINARY_DIR}/customTarget.c" PROPERTIES GENERATED 1) ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c" @@ -23,3 +22,14 @@ ADD_CUSTOM_TARGET( ) ADD_DEPENDENCIES(working Custom) + +file(MAKE_DIRECTORY ${TestWorkingDir_BINARY_DIR}/work) +add_custom_command( + OUTPUT working2.c # Relative to build tree + COMMAND "${CMAKE_COMMAND}" -E copy ${TestWorkingDir_SOURCE_DIR}/working.c.in ../working2.c + DEPENDS ${TestWorkingDir_SOURCE_DIR}/working.c.in/ # trailing slash should be removed + WORKING_DIRECTORY ${TestWorkingDir_BINARY_DIR}/work + ) +add_executable(working2 working2.c ${TestWorkingDir_BINARY_DIR}/customTarget.c) + +add_dependencies(working2 Custom2) -- cgit v0.12 From 88548a45fbd35205469ac9fd332349551e172496 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 Jan 2011 16:32:17 -0500 Subject: Handle relative WORKING_DIRECTORY in add_custom_(command|target) This also fixes handling of trailing slashes in the directory name. --- Source/cmAddCustomCommandCommand.cxx | 7 +++++++ Source/cmAddCustomCommandCommand.h | 2 ++ Source/cmAddCustomTargetCommand.cxx | 8 ++++++++ Source/cmAddCustomTargetCommand.h | 2 ++ Tests/CustomCommandWorkingDirectory/CMakeLists.txt | 11 +++++++++-- 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 7af6ec8..502829e 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -286,6 +286,13 @@ bool cmAddCustomCommandCommand return false; } + // Convert working directory to a full path. + if(!working.empty()) + { + const char* build_dir = this->Makefile->GetCurrentOutputDirectory(); + working = cmSystemTools::CollapseFullPath(working.c_str(), build_dir); + } + // Choose which mode of the command to use. bool escapeOldStyle = !verbatim; if(source.empty() && output.empty()) diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h index 490e043..47b542c 100644 --- a/Source/cmAddCustomCommandCommand.h +++ b/Source/cmAddCustomCommandCommand.h @@ -110,6 +110,8 @@ public: "will be treated as PRE_LINK.\n" "If WORKING_DIRECTORY is specified the command will be executed " "in the directory given. " + "If it is a relative path it will be interpreted relative to the " + "build tree directory corresponding to the current source directory. " "If COMMENT is set, the value will be displayed as a " "message before the commands are executed at build time. " "If APPEND is specified the COMMAND and DEPENDS option values " diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index edb787b..27dea98 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -166,6 +166,14 @@ bool cmAddCustomTargetCommand } } + // Convert working directory to a full path. + if(!working_directory.empty()) + { + const char* build_dir = this->Makefile->GetCurrentOutputDirectory(); + working_directory = + cmSystemTools::CollapseFullPath(working_directory.c_str(), build_dir); + } + // Add the utility target to the makefile. bool escapeOldStyle = !verbatim; cmTarget* target = diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h index 7a2b396..6d94fb2 100644 --- a/Source/cmAddCustomTargetCommand.h +++ b/Source/cmAddCustomTargetCommand.h @@ -79,6 +79,8 @@ public: "empty target will be created. " "If WORKING_DIRECTORY is set, then the command will be run in that " "directory. " + "If it is a relative path it will be interpreted relative to the " + "build tree directory corresponding to the current source directory. " "If COMMENT is set, the value will be displayed as a " "message before the commands are executed at build time. " "Dependencies listed with the DEPENDS argument may reference files " diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt index d272ffe..36d32e4 100644 --- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt +++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt @@ -10,6 +10,7 @@ ADD_CUSTOM_COMMAND( SET_SOURCE_FILES_PROPERTIES( "${TestWorkingDir_BINARY_DIR}/customTarget.c" + "${TestWorkingDir_BINARY_DIR}/customTarget2.c" PROPERTIES GENERATED 1) ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c" @@ -28,8 +29,14 @@ add_custom_command( OUTPUT working2.c # Relative to build tree COMMAND "${CMAKE_COMMAND}" -E copy ${TestWorkingDir_SOURCE_DIR}/working.c.in ../working2.c DEPENDS ${TestWorkingDir_SOURCE_DIR}/working.c.in/ # trailing slash should be removed - WORKING_DIRECTORY ${TestWorkingDir_BINARY_DIR}/work + WORKING_DIRECTORY work/ # Relative to build tree, trailing slash ) -add_executable(working2 working2.c ${TestWorkingDir_BINARY_DIR}/customTarget.c) +add_executable(working2 working2.c ${TestWorkingDir_BINARY_DIR}/customTarget2.c) + +add_custom_target( + Custom2 ALL + COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${TestWorkingDir_SOURCE_DIR}/customTarget.c ../customTarget2.c + WORKING_DIRECTORY work/ # Relative to build tree, trailing slash +) add_dependencies(working2 Custom2) -- cgit v0.12 From b5e369229900c121ab997b67d185026057f4a199 Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 28 Jan 2011 06:32:27 -0500 Subject: CTest: Mark DART_TESTING_TIMEOUT as advanced (#10150) Also, split a long line into two. And alphabetize the variables mentioned in the mark_as_advanced call. --- Modules/CTest.cmake | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index bb76ddd..c261eb3 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -63,7 +63,8 @@ OPTION(BUILD_TESTING "Build the testing tree." ON) # function to turn generator name into a version string # like vs7 vs71 vs8 vs9 FUNCTION(GET_VS_VERSION_STRING generator var) - STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER "${generator}") + STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" + NUMBER "${generator}") IF("${generator}" MATCHES "Visual Studio 7 .NET 2003") SET(ver_string "vs71") ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003") @@ -253,15 +254,16 @@ IF(BUILD_TESTING) ENDIF(CTEST_USE_LAUNCHERS) MARK_AS_ADVANCED( + BZRCOMMAND + BZR_UPDATE_OPTIONS COVERAGE_COMMAND + CTEST_SUBMIT_RETRY_DELAY + CTEST_SUBMIT_RETRY_COUNT CVSCOMMAND - SVNCOMMAND - BZRCOMMAND - HGCOMMAND - GITCOMMAND CVS_UPDATE_OPTIONS - SVN_UPDATE_OPTIONS - BZR_UPDATE_OPTIONS + DART_TESTING_TIMEOUT + GITCOMMAND + HGCOMMAND MAKECOMMAND MEMORYCHECK_COMMAND MEMORYCHECK_SUPPRESSIONS_FILE @@ -270,10 +272,9 @@ IF(BUILD_TESTING) SLURM_SBATCH_COMMAND SLURM_SRUN_COMMAND SITE - CTEST_SUBMIT_RETRY_DELAY - CTEST_SUBMIT_RETRY_COUNT + SVNCOMMAND + SVN_UPDATE_OPTIONS ) - # BUILDNAME IF(NOT RUN_FROM_DART) SET(RUN_FROM_CTEST_OR_DART 1) INCLUDE(CTestTargets) -- cgit v0.12 From e6221ed2c41de86020083c4d2af58c7b28d36bb0 Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 28 Jan 2011 09:52:47 -0500 Subject: Xcode: Allow override of CMAKE_CONFIGURATION_TYPES (#8914) --- Source/cmGlobalXCodeGenerator.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 1395865..d73c833 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -165,13 +165,16 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vectorconst& } else { - mf->AddCacheDefinition( - "CMAKE_CONFIGURATION_TYPES", - "Debug;Release;MinSizeRel;RelWithDebInfo", - "Semicolon separated list of supported configuration types, " - "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " - "anything else will be ignored.", - cmCacheManager::STRING); + if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) + { + mf->AddCacheDefinition( + "CMAKE_CONFIGURATION_TYPES", + "Debug;Release;MinSizeRel;RelWithDebInfo", + "Semicolon separated list of supported configuration types, " + "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " + "anything else will be ignored.", + cmCacheManager::STRING); + } } mf->AddDefinition("CMAKE_GENERATOR_CC", "gcc"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "g++"); -- cgit v0.12 From b1f52b1fd8dd13d22138b7b9c0701e699dbeb43c Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Fri, 28 Jan 2011 08:50:56 -0700 Subject: Fix grouping bug where "Ungrouped Entries" showed up as a child. --- Source/QtDialog/QCMakeCacheView.cxx | 14 ++++++++++---- Source/QtDialog/QCMakeCacheView.h | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 562396d..72e9b24 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -293,6 +293,8 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) parentItems.append(new QStandardItem()); parentItems[0]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole); parentItems[1]->setData(QBrush(QColor(255,100,100)), Qt::BackgroundColorRole); + parentItems[0]->setData(1, GroupRole); + parentItems[1]->setData(1, GroupRole); root->appendRow(parentItems); int num = props2.size(); @@ -314,6 +316,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) QStandardItem* parentItem = new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key); root->appendRow(parentItem); + parentItem->setData(1, GroupRole); int num = props2.size(); for(int i=0; igetPropertyData(idx, prop); - props.append(prop); + if(!data(idx, GroupRole).toInt()) + { + // get data + QCMakeProperty prop; + this->getPropertyData(idx, prop); + props.append(prop); + } // go to the next in the tree while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid()) diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h index 58bbd2d..0a628b9 100644 --- a/Source/QtDialog/QCMakeCacheView.h +++ b/Source/QtDialog/QCMakeCacheView.h @@ -67,7 +67,9 @@ public: enum { HelpRole = Qt::ToolTipRole, TypeRole = Qt::UserRole, AdvancedRole, - StringsRole}; + StringsRole, + GroupRole + }; enum ViewType { FlatView, GroupView }; -- cgit v0.12 From a6a21c85ed759d3c1cfeb0db63007dd5d78c24e0 Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 28 Jan 2011 14:58:04 -0500 Subject: Tests: Eliminate unnecessary files and variables. 1: The CTestTestFailedSubmits tests do not need to run the CTEST_MEMCHECK command. It is covered by the CTestTest2 test. If more coverage *is* required, choose a test that runs by itself once to add it to... This one gets used several times in a loop to test submission failure via the various submission protocols. With memchecking on, each test here takes 1000 seconds or more on a "fast" build... 2: Other ctest tests do not need any of the CTEST_MEMORYCHECK_* variables defined. They don't even call CTEST_MEMCHECK, or -D NightlyMemCheck, or anything. So: remove the unnecessary set calls. 3: CTestTest3 has gone intentionally unused for months because it did not add any coverage and caused no ends of sporadic randomish failures when network connectivity was spotty. Remove its directory. Never add it again. --- Tests/CTestTest3/test.cmake.in | 120 ---------------------------- Tests/CTestTestBadExe/test.cmake.in | 3 - Tests/CTestTestChecksum/test.cmake.in | 3 - Tests/CTestTestCostSerial/test.cmake.in | 3 - Tests/CTestTestCrash/test.cmake.in | 3 - Tests/CTestTestCycle/test.cmake.in | 3 - Tests/CTestTestDepends/test.cmake.in | 3 - Tests/CTestTestFailedSubmits/test.cmake.in | 4 - Tests/CTestTestFailure/testNoBuild.cmake.in | 3 - Tests/CTestTestFailure/testNoExe.cmake.in | 3 - Tests/CTestTestParallel/test.cmake.in | 3 - Tests/CTestTestResourceLock/test.cmake.in | 3 - Tests/CTestTestScheduler/test.cmake.in | 3 - Tests/CTestTestStopTime/test.cmake.in | 3 - Tests/CTestTestSubdir/test.cmake.in | 3 - Tests/CTestTestTimeout/test.cmake.in | 3 - Tests/CTestTestZeroTimeout/test.cmake.in | 3 - 17 files changed, 169 deletions(-) delete mode 100644 Tests/CTestTest3/test.cmake.in diff --git a/Tests/CTestTest3/test.cmake.in b/Tests/CTestTest3/test.cmake.in deleted file mode 100644 index 1e8ea50..0000000 --- a/Tests/CTestTest3/test.cmake.in +++ /dev/null @@ -1,120 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) - -MACRO(PROJECT_START NAME) - MESSAGE("###################################################") - MESSAGE("") - MESSAGE("Start project: ${NAME}") - MESSAGE("") - MESSAGE("###################################################") -ENDMACRO(PROJECT_START) - -# Project 1 -PROJECT_START("KWSys from CVS") - -# Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest3") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest3-CVS") - -# --- -SET(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CVS/KWSys") -SET(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CVS/KWSysBin") -SET(CTEST_UPDATE_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") -# for unix purify has to be used as a linker, and -# will not work with ctest. So disable it so -# that it is not attempted. -IF(UNIX) - IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify) - SET(CTEST_MEMORYCHECK_COMMAND) - ENDIF() -ENDIF() -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") -SET(CTEST_CHECKOUT_COMMAND "\"${CTEST_UPDATE_COMMAND}\" -q -z3 \"-d:pserver:anoncvs@www.cmake.org:/cvsroot/KWSys\" co -r CTest-Testing-Tag KWSys") - -CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " -CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ -CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ -CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@ -CMAKE_CXX_COMPILER:STRING=@CMAKE_CXX_COMPILER@ -CMAKE_C_COMPILER_ARG1:STRING=@CMAKE_C_COMPILER_ARG1@ -CMAKE_CXX_COMPILER_ARG1:STRING=@CMAKE_CXX_COMPILER_ARG1@ - -# This one is needed for testing advanced ctest features -CTEST_TEST_KWSYS:BOOL=ON -") - -SET(CTEST_CUSTOM_WARNING_MATCH CommandLineArguments) - -CTEST_START(Nightly) -CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}") -CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5 SCHEDULE_RANDOM ON) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - -set(CTEST_DROP_METHOD "@protocol@") -set(CTEST_DROP_SITE "@server@") -set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") - -CTEST_SUBMIT(RETURN_VALUE res) - -#SET(svncommand "@SVNCOMMAND@") -set(svncommand FALSE) # turn this off until namic svn cmake is back -IF(svncommand) - # Project 2 - PROJECT_START("KWSys from SVN") - - # Settings: - SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest3") - SET(CTEST_SITE "@SITE@") - SET(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest3-SVN") - - # --- - SET(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/SVN/kwsys") - SET(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/SVN/kwsysBin") - SET(CTEST_UPDATE_COMMAND "@SVNCOMMAND@") - SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") - SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") - SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") - SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") - SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") - SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") - SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - SET(CTEST_CHECKOUT_COMMAND "\"${CTEST_UPDATE_COMMAND}\" co \"http://svn.na-mic.org:8000/svn/CMake/Source/kwsys/\" -r 500") - - CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - - FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " - CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ - CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ - CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@ - CMAKE_CXX_COMPILER:STRING=@CMAKE_CXX_COMPILER@ - CMAKE_C_COMPILER_ARG1:STRING=@CMAKE_C_COMPILER_ARG1@ - CMAKE_CXX_COMPILER_ARG1:STRING=@CMAKE_CXX_COMPILER_ARG1@ - - # This one is needed for testing advanced ctest features - CTEST_TEST_KWSYS:BOOL=ON - ") - - CTEST_START(Experimental) - CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) - CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5 SCHEDULE_RANDOM ON) - CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5) - CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - CTEST_SUBMIT(RETURN_VALUE res) - -ELSE(svncommand) - MESSAGE("Cannot find SVN command: ${svncommand}") -ENDIF(svncommand) diff --git a/Tests/CTestTestBadExe/test.cmake.in b/Tests/CTestTestBadExe/test.cmake.in index 743e835..5d22d35 100644 --- a/Tests/CTestTestBadExe/test.cmake.in +++ b/Tests/CTestTestBadExe/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadEx SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in index c3c41a5..8413544 100644 --- a/Tests/CTestTestChecksum/test.cmake.in +++ b/Tests/CTestTestChecksum/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParal SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in index ce4d60a..ca216e3 100644 --- a/Tests/CTestTestCostSerial/test.cmake.in +++ b/Tests/CTestTestCostSerial/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostS SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCrash/test.cmake.in b/Tests/CTestTestCrash/test.cmake.in index 259c8659..5cec594 100644 --- a/Tests/CTestTestCrash/test.cmake.in +++ b/Tests/CTestTestCrash/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCrash SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in index a17adca..201f604 100644 --- a/Tests/CTestTestCycle/test.cmake.in +++ b/Tests/CTestTestCycle/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in index ed4e182..36a1ebf 100644 --- a/Tests/CTestTestDepends/test.cmake.in +++ b/Tests/CTestTestDepends/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepen SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in index 9b581eb..b0e1632 100644 --- a/Tests/CTestTestFailedSubmits/test.cmake.in +++ b/Tests/CTestTestFailedSubmits/test.cmake.in @@ -22,9 +22,6 @@ SET(CTEST_BINARY_DIRECTORY "@build@") SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") @@ -39,7 +36,6 @@ CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" @ctest_coverage_labels_args@ RETURN_VALUE res) # ok to call ctest_submit - still avoids network activity because there is diff --git a/Tests/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in index b0bb039..7bc921a 100644 --- a/Tests/CTestTestFailure/testNoBuild.cmake.in +++ b/Tests/CTestTestFailure/testNoBuild.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailu SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in index 69d4f84..59c18d7 100644 --- a/Tests/CTestTestFailure/testNoExe.cmake.in +++ b/Tests/CTestTestFailure/testNoExe.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailu SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestParallel/test.cmake.in b/Tests/CTestTestParallel/test.cmake.in index 6ca15f6..83845de 100644 --- a/Tests/CTestTestParallel/test.cmake.in +++ b/Tests/CTestTestParallel/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParal SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in index 0f353b8..98c5901 100644 --- a/Tests/CTestTestResourceLock/test.cmake.in +++ b/Tests/CTestTestResourceLock/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResou SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in index 2a91829..505bd7c 100644 --- a/Tests/CTestTestScheduler/test.cmake.in +++ b/Tests/CTestTestScheduler/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSched SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in index 6a5534e..2d03686 100644 --- a/Tests/CTestTestStopTime/test.cmake.in +++ b/Tests/CTestTestStopTime/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopT SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestSubdir/test.cmake.in b/Tests/CTestTestSubdir/test.cmake.in index c8d4fda..f240473 100644 --- a/Tests/CTestTestSubdir/test.cmake.in +++ b/Tests/CTestTestSubdir/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSubdi SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in index 6ed11a4..8a8dc24 100644 --- a/Tests/CTestTestTimeout/test.cmake.in +++ b/Tests/CTestTestTimeout/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeo SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in index 0ff32a4..56bae9d 100644 --- a/Tests/CTestTestZeroTimeout/test.cmake.in +++ b/Tests/CTestTestZeroTimeout/test.cmake.in @@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroT SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") SET(CTEST_TEST_TIMEOUT 2) -- cgit v0.12 From 92ced20fa13cd2b4ed45a80d265a590d2291f8ee Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Sun, 30 Jan 2011 13:11:25 +0100 Subject: CPack Tests the different ways of packaging components --- Tests/CMakeLists.txt | 56 +++++++++++++--------- Tests/CPackComponentsForAll/CMakeLists.txt | 12 ++--- .../MyLibCPackConfig-AllGroupsInOne.cmake.in | 18 +++++++ .../MyLibCPackConfig-AllInOne.cmake.in | 18 +++++++ .../MyLibCPackConfig-IgnoreGroup.cmake.in | 18 +++++++ .../MyLibCPackConfig-OnePackPerGroup.cmake.in | 18 +++++++ .../MyLibCPackConfig.cmake.in | 7 --- .../RunCPackVerifyResult.cmake | 12 +++++ 8 files changed, 123 insertions(+), 36 deletions(-) create mode 100644 Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in create mode 100644 Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in create mode 100644 Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in create mode 100644 Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in delete mode 100644 Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index cbca02d..5f0bf25 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -563,30 +563,40 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ IF(CTEST_RUN_CPackComponentsForAll) set(CPackComponentsForAll_EXTRA_OPTIONS) - - set(CPackRun_CPackGen "-DCPackGen=ZIP") set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}") - set(CPackRun_CPackComponentWay "-DCPackComponentWay=default") - - ADD_TEST(CPackComponentsForAll-ZIP-default ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll" - "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-project CPackComponentsForAll - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-options - -DCPACK_BINARY_ZIP:BOOL=ON - ${CPackComponentsForAll_EXTRA_OPTIONS} - --graphviz=CPackComponentsForAll.dot - --test-command ${CMAKE_CMAKE_COMMAND} - "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent" - "${CPackRun_CPackCommand}" - "${CPackRun_CPackGen}" - "${CPackRun_CPackComponentWay}" - -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") - - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll") + # set up list of CPack generators + list(APPEND GENLST "ZIP") + # set up list of component packaging ways + list(APPEND CWAYLST "default") + list(APPEND CWAYLST "OnePackPerGroup") + list(APPEND CWAYLST "IgnoreGroup") + list(APPEND CWAYLST "AllInOne") + list(APPEND CWAYLST "AllGroupsInOne") + foreach(CPackGen IN LISTS GENLST) + set(CPackRun_CPackGen "-DCPackGen=${CPackGen}") + foreach(CPackComponentWay IN LISTS CWAYLST) + set(CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}") + ADD_TEST(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll" + "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" + --build-generator ${CMAKE_TEST_GENERATOR} + --build-project CPackComponentsForAll + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-options + -DCPACK_BINARY_${CPackGen}:BOOL=ON + ${CPackRun_CPackComponentWay} + ${CPackComponentsForAll_EXTRA_OPTIONS} + --graphviz=CPackComponentsForAll.dot + --test-command ${CMAKE_CMAKE_COMMAND} + "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" + "${CPackRun_CPackCommand}" + "${CPackRun_CPackGen}" + "${CPackRun_CPackComponentWay}" + -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") + LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}") + endforeach(CPackComponentWay) + endforeach(CPackGen) ENDIF(CTEST_RUN_CPackComponentsForAll) # By default, turn this test off (because it takes a long time...) diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index 971b2dc..bcec509 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -107,14 +107,14 @@ set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full) # We may use the CPack specific config file in order -# to tailor CPack behavio on a CPack generator specific way +# to tailor CPack behavior on a CPack generator specific way # (Behavior would be different for RPM or TGZ or DEB ...) -if (USE_CPACK_PROJECT_CONFIG) +if (NOT ("${CPackComponentWay}" STREQUAL "default")) # Setup project specific CPack-time CPack Config file. - configure_file(${MyLib_SOURCE_DIR}/MyLibCPackConfig.cmake.in - ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake + configure_file(${CPackComponentsForAll_SOURCE_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake.in + ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake @ONLY) - set(CPACK_PROJECT_CONFIG_FILE ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake) -endif (USE_CPACK_PROJECT_CONFIG) + set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake) +endif (NOT ("${CPackComponentWay}" STREQUAL "default")) # Include CPack to introduce the appropriate targets include(CPack) \ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in new file mode 100644 index 0000000..3a7119e --- /dev/null +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in @@ -0,0 +1,18 @@ +# +# Activate component packaging +# +if(CPACK_GENERATOR MATCHES "ZIP") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "ZIP") + +if(CPACK_GENERATOR MATCHES "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "RPM") + +# +# Choose grouping way +# +set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE 1) +#set(CPACK_COMPONENTS_GROUPING) +#set(CPACK_COMPONENTS_IGNORE_GROUPS 1) +#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in new file mode 100644 index 0000000..9a40293 --- /dev/null +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in @@ -0,0 +1,18 @@ +# +# Activate component packaging +# +if(CPACK_GENERATOR MATCHES "ZIP") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "ZIP") + +if(CPACK_GENERATOR MATCHES "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "RPM") + +# +# Choose grouping way +# +#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE 1) +#set(CPACK_COMPONENTS_GROUPING) +#set(CPACK_COMPONENTS_IGNORE_GROUPS 1) +set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in new file mode 100644 index 0000000..92a97a5 --- /dev/null +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -0,0 +1,18 @@ +# +# Activate component packaging +# +if(CPACK_GENERATOR MATCHES "ZIP") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "ZIP") + +if(CPACK_GENERATOR MATCHES "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "RPM") + +# +# Choose grouping way +# +#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE) +#set(CPACK_COMPONENTS_GROUPING) +set(CPACK_COMPONENTS_IGNORE_GROUPS 1) +#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) \ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in new file mode 100644 index 0000000..4180891 --- /dev/null +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in @@ -0,0 +1,18 @@ +# +# Activate component packaging +# +if(CPACK_GENERATOR MATCHES "ZIP") + set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "ZIP") + +if(CPACK_GENERATOR MATCHES "RPM") + set(CPACK_RPM_COMPONENT_INSTALL "ON") +endif(CPACK_GENERATOR MATCHES "RPM") + +# +# Choose grouping way +# +#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE) +#set(CPACK_COMPONENTS_GROUPING) +#set(CPACK_COMPONENTS_IGNORE_GROUPS) +#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE) \ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in deleted file mode 100644 index 7ffafae..0000000 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in +++ /dev/null @@ -1,7 +0,0 @@ -if(CPACK_GENERATOR MATCHES "ZIP") -# set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) -endif(CPACK_GENERATOR MATCHES "ZIP") - -if(CPACK_GENERATOR MATCHES "TGZ") - set(CPACK_MONOLITHIC_INSTALL 1) -endif(CPACK_GENERATOR MATCHES "TGZ") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 11f72ec..d5137bd 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -49,6 +49,18 @@ if(CPackGen MATCHES "ZIP") if (${CPackComponentWay} STREQUAL "default") set(expected_count 1) endif(${CPackComponentWay} STREQUAL "default") + if (${CPackComponentWay} STREQUAL "OnePackPerGroup") + set(expected_count 2) + endif (${CPackComponentWay} STREQUAL "OnePackPerGroup") + if (${CPackComponentWay} STREQUAL "IgnoreGroup") + set(expected_count 4) + endif (${CPackComponentWay} STREQUAL "IgnoreGroup") + if (${CPackComponentWay} STREQUAL "AllInOne") + set(expected_count 1) + endif (${CPackComponentWay} STREQUAL "AllInOne") + if (${CPackComponentWay} STREQUAL "AllGroupsInOne") + set(expected_count 1) + endif (${CPackComponentWay} STREQUAL "AllGroupsInOne") endif(CPackGen MATCHES "ZIP") # Now verify if the number of expected file is OK -- cgit v0.12 From 76976a59e9edc550fbf5b7b7ac4dbc381c02d139 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 31 Jan 2011 00:01:10 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 33a8939..60d03d6 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 01) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 30) +SET(KWSYS_DATE_STAMP_DAY 31) -- cgit v0.12 From b8da1a1378a4e36d80bda0cd551cb27dcb0ec982 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Mon, 31 Jan 2011 17:25:29 +0100 Subject: Avoid foreach IN LISTS syntax which is not supported by CMake 2.6 --- Tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5f0bf25..2c11919 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -572,9 +572,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND CWAYLST "IgnoreGroup") list(APPEND CWAYLST "AllInOne") list(APPEND CWAYLST "AllGroupsInOne") - foreach(CPackGen IN LISTS GENLST) + foreach(CPackGen ${GENLST}) set(CPackRun_CPackGen "-DCPackGen=${CPackGen}") - foreach(CPackComponentWay IN LISTS CWAYLST) + foreach(CPackComponentWay ${CWAYLST}) set(CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}") ADD_TEST(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND} --build-and-test -- cgit v0.12 From 086cd2fa400cbfc1b5700cc3a322a66530ba3b84 Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 31 Jan 2011 13:03:26 -0500 Subject: CMake 2.8.4-rc2 --- CMakeLists.txt | 2 +- ChangeLog.manual | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd3be79..97fe0a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -432,7 +432,7 @@ SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 8) SET(CMake_VERSION_PATCH 4) SET(CMake_VERSION_TWEAK 0) -SET(CMake_VERSION_RC 1) +SET(CMake_VERSION_RC 2) # Releases define a tweak level. IF(DEFINED CMake_VERSION_TWEAK) diff --git a/ChangeLog.manual b/ChangeLog.manual index bccf485..b61bbdc 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,88 @@ +Changes in CMake 2.8.4-rc2 (since 2.8.4-rc1) +-------------------------------------------- +Alex Neundorf (3): + Make cmake build again with cmake < 2.6.3 + Strip trailing whitespace. + Fix parsing of compiler name with a version number + +Ben Boeckel (86): + ... 86 commit messages summarized as: + Fix ADD_TEST regression when WORKING_DIRECTORY not given + Add new "strict-mode" CMake variable checking + Activate / avoid using new command line arguments: + --warn-uninitialized + --warn-unused-vars + --no-warn-unused-cli + --check-system-vars + +Bill Hoffman (3): + For macros make sure the FilePath points to a valid pointer in the args. + Add a warning when variables are used uninitialized. + Make --strict-mode option, and integrate with cmake-gui + +Brad King (34): + bootstrap: Granular system library selection (#11431) + bootstrap: Clarify --init flag documentation (#11431) + bootstrap: --verbose implies verbose Makefiles (#11708) + Combine duplicate COMPILE_DEFINITIONS disclaimer + Document COMPILE_DEFINITIONS known limitations (#11660, #11712) + Document try_compile behavior more clearly (#11688) + Document Check(C|CXX)SourceCompiles behavior more clearly (#11688) + Fix get_(cmake|test)_property documentation (#11703) + Reference get_property() from old get_*_property() commands + Replace misleading example in the if() documentation (#10773) + Clarify auto-dereference cases in if() command (#11701) + Document CheckFunctionExists more clearly (#10044) + Document CheckSymbolExists more clearly (#11685) + Update CheckSymbolExists copyright year + Report directory with missing source file (#11677) + Test that missing source mentions directory (#11677) + Teach Simple_Mingw_Linux2Win test to use windres + Disable SubDirSpaces parens with GNU Make 3.82 (#11654) + libarchive: Fix major() check for LSB 4.0 (#11648) + Xcode: Make generation depend on all input directories + Recognize SCO UnixWare C/C++ compilers (#11700) + Factor SCO compiler info out of platform file (#11700) + Honor CMAKE_TRY_COMPILE_CONFIGURATION in Makefile generators (#10809) + Document CMAKE_TRY_COMPILE_CONFIGURATION variable + Honor VS_SCC_* properties in Fortran targets (#10237) + Normalize slashes in scanned #include lines (#10281) + Improve try_compile and try_run error messages + Use shortest extension to verify try_compile language (#11731) + Modules: Include builtin FindPackageHandleStandardArgs directly + Fix relative CMAKE_USER_MAKE_RULES_OVERRIDE (#11725) + Clarify CMAKE_USER_MAKE_RULES_OVERRIDE documentation (#11724) + Always place try_compile executables predictably (#11724) + try_compile: Allow only languages loaded in caller (#11469) + Fix ArgumentExpansion test expected results + +Clinton Stimpson (1): + Replace exec_program with execute_process for qmake queries. + +David Cole (16): + Update script with new machine name + VS10: Fix problems with InstallRequiredSystemLibraries. + Add CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS variable + Add CPACK_NSIS_INSTALL_ROOT for CMake's own installer (#9148) + Xcode: Disable implicit make rules in custom rules makefiles. + Add freeglut as library name (#10031) + Add new names for PNG and ZLIB libraries + Avoid exceptions when ccmake terminal window is too small (#11668) + VS10: Load projects with obj "source" files (#11147) + VS10: Enable using devenv as CMAKE_MAKE_PROGRAM (#11459) + Xcode: Fix crash: avoid strlen call on NULL char * + CTestTest2: Avoid running purify unless requested + VS10: Escape double quote chars in defines for rc files (#11695) + Fix line too long KWStyle issue (#11695) + Avoid space in rc /D values for VS6 and Cygwin (#11695) + VSResource: Avoid windres /D with quoted spaces (#11695) + +Marcus D. Hanwell (1): + Bug #11715 - generate header in the build tree. + +Nicolas Despres (1): + bootstrap: Add --enable-ccache option (#11707) + Changes in CMake 2.8.4-rc1 (since 2.8.3) ---------------------------------------- Alex Neundorf (32): -- cgit v0.12 From d503206fbea7aab6a4eaae08acf1ab53b0997df3 Mon Sep 17 00:00:00 2001 From: James Bigler Date: Fri, 28 Jan 2011 17:03:39 -0700 Subject: Add FloatingPointModel to the list of known VS7 generator flags. Added FloatingPointModel with /fp:precise, /fp:strict, and /fp:fast. --- Source/cmLocalVisualStudio7Generator.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index e839ed3..f65a134 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -381,6 +381,11 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = "Use sse2 instructions", "2", 0}, {"EnableEnhancedInstructionSet", "arch:SSE", "Use sse instructions", "1", 0}, + {"FloatingPointModel", "fp:precise", + "Use precise floating point model", "0", 0}, + {"FloatingPointModel", "fp:strict", + "Use strict floating point model", "1", 0}, + {"FloatingPointModel", "fp:fast", "Use fast floating point model", "2", 0}, {"FavorSizeOrSpeed", "Ot", "Favor fast code", "1", 0}, {"FavorSizeOrSpeed", "Os", "Favor small code", "2", 0}, {"CompileAs", "TC", "Compile as c code", "1", 0}, -- cgit v0.12 From 93f230e408cba124dc5ba97b1ef7f228ccb4fcc9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 31 Jan 2011 16:24:12 -0500 Subject: Pass -o after -c for Fortran to avoid mpif77 ordering bug When running $ mpif77 -c example.f -o example.f.o mpif77 recognizes -o and produces example.f.o, but when running $ mpif77 -o example.f.o -c example.f the -o option is ignored and the object file is example.o. Performing the same experiment on the underlying compiler tool or with the mpicc and mpiCC wrappers does not exhibit this behavior, so the issue appears to be specific to mpif77. Reported-by: Zhen Wang --- Modules/CMakeFortranInformation.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index f6a52c6..80f5e46 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -168,9 +168,10 @@ SET(CMAKE_Fortran_ARCHIVE_APPEND " r " SET(CMAKE_Fortran_ARCHIVE_FINISH " ") # compile a Fortran file into an object file +# (put -o after -c to workaround bug in at least one mpif77 wrapper) IF(NOT CMAKE_Fortran_COMPILE_OBJECT) SET(CMAKE_Fortran_COMPILE_OBJECT - " -o -c ") + " -c -o ") ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT) # link a fortran program -- cgit v0.12 From 0037dcb6af2e9c9172d4fe642fb9e0b718580053 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 17 Aug 2010 16:11:33 -0400 Subject: Removed most usage of Carbon in favour of CoreFoundation --- Source/CMakeLists.txt | 4 ++-- Source/CPack/OSXScriptLauncher.cxx | 1 - Tests/BundleTest/BundleLib.cxx | 4 ++-- Tests/BundleTest/BundleTest.cxx | 6 +++--- Tests/BundleTest/CMakeLists.txt | 12 ++++++------ bootstrap | 4 ++-- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 7722c19..278d4df 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -343,7 +343,7 @@ TARGET_LINK_LIBRARIES(CMakeLib cmsys ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES} ${CMAKE_CURL_LIBRARIES} ) -# On Apple we need Carbon +# On Apple we need CoreFoundation IF(APPLE) TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation") ENDIF(APPLE) @@ -465,7 +465,7 @@ IF(APPLE) ADD_EXECUTABLE(OSXScriptLauncher CPack/OSXScriptLauncher.cxx) TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys) - TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework Carbon") + TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation") ENDIF(APPLE) # Build CMake executable diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index 99ffecc..e0fbe9b 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -14,7 +14,6 @@ #include #include -#include #include // For the PATH_MAX constant diff --git a/Tests/BundleTest/BundleLib.cxx b/Tests/BundleTest/BundleLib.cxx index bab745e..b68ee25 100644 --- a/Tests/BundleTest/BundleLib.cxx +++ b/Tests/BundleTest/BundleLib.cxx @@ -3,7 +3,7 @@ #include #include -#include +#include int fileExists(char* filename) { @@ -51,7 +51,7 @@ int findBundleFile(char* exec, const char* file) int foo(char *exec) { - // Call a "Carbon" function... + // Call a CoreFoundation function... // CFBundleRef br = CFBundleGetMainBundle(); (void) br; diff --git a/Tests/BundleTest/BundleTest.cxx b/Tests/BundleTest/BundleTest.cxx index 29d17db..a66d601 100644 --- a/Tests/BundleTest/BundleTest.cxx +++ b/Tests/BundleTest/BundleTest.cxx @@ -1,6 +1,6 @@ #include -#include +#include extern int foo(char* exec); @@ -8,8 +8,8 @@ int main(int argc, char* argv[]) { printf("Started with: %d arguments\n", argc); - // Call a "Carbon" function... but pull in the link dependency on "-framework - // Carbon" via CMake's dependency chaining mechanism. This code exists to + // Call a CoreFoundation function... but pull in the link dependency on "-framework + // CoreFoundation" via CMake's dependency chaining mechanism. This code exists to // verify that the chaining mechanism works with "-framework blah" style // link dependencies. // diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt index 5ccf2bf..5342f49 100644 --- a/Tests/BundleTest/CMakeLists.txt +++ b/Tests/BundleTest/CMakeLists.txt @@ -25,14 +25,14 @@ SET_SOURCE_FILES_PROPERTIES( SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar") # Test building a bundle linking to a shared library where the -# shared library links to Carbon, but the executable does not -# explicitly link to Carbon, but the executable does *depend* -# on Carbon. There should be a link failure for the executable +# shared library links to CoreFoundation, but the executable does not +# explicitly link to CoreFoundation, but the executable does *depend* +# on CoreFoundation. There should be a link failure for the executable # if CMake's dependency chaining for libraries with "-framework # blah" style dependencies gets broken... # ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx) -TARGET_LINK_LIBRARIES(BundleTestLib "-framework Carbon") +TARGET_LINK_LIBRARIES(BundleTestLib "-framework CoreFoundation") ADD_EXECUTABLE(BundleTest MACOSX_BUNDLE @@ -43,8 +43,8 @@ ADD_EXECUTABLE(BundleTest ) TARGET_LINK_LIBRARIES(BundleTest BundleTestLib) # -# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework Carbon") -# (see above comments about Carbon) +# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework CoreFoundation") +# (see above comments about CoreFoundation) # # Test bundle installation. diff --git a/bootstrap b/bootstrap index b95e36a..c999888 100755 --- a/bootstrap +++ b/bootstrap @@ -666,9 +666,9 @@ if ${cmake_system_cygwin}; then cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import" fi -# Add Carbon framework on Darwin +# Add CoreFoundation framework on Darwin if ${cmake_system_darwin}; then - cmake_ld_flags="${LDFLAGS} -framework Carbon" + cmake_ld_flags="${LDFLAGS} -framework CoreFoundation" fi # Add BeOS toolkits... -- cgit v0.12 From 4f1e1fe7821da7d5af17d18f031f72daa05c89e1 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 1 Feb 2011 00:01:11 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 60d03d6..99262dd 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 01) +SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 31) +SET(KWSYS_DATE_STAMP_DAY 01) -- cgit v0.12 From 6cf5772a934f8408dbf0615a0a981239f461a28f Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Tue, 1 Feb 2011 13:12:58 -0500 Subject: VS7/8/9: Map whole program optimization flags (#10263) --- Source/cmLocalVisualStudio7Generator.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index f65a134..4f0cbb9 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -456,6 +456,10 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = "Turn off Run time type information for c++", "FALSE", 0}, {"SmallerTypeCheck", "RTCc", "smaller type check", "TRUE", 0}, {"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "TRUE", 0}, + {"WholeProgramOptimization", "GL", + "Enables whole program optimization", "TRUE", 0}, + {"WholeProgramOptimization", "GL-", + "Disables whole program optimization", "FALSE", 0}, {"WarnAsError", "WX", "Treat warnings as errors", "TRUE", 0}, {"BrowseInformation", "FR", "Generate browse information", "1", 0}, {0,0,0,0,0} -- cgit v0.12 From 15e422249eab4d920ffeb3de08057d35f3bc6387 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 1 Feb 2011 13:32:43 -0500 Subject: VS9: Map enable/disable PREfast flags (#10638) --- Source/cmGlobalVisualStudio8Generator.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 2d080df..b066179 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -358,6 +358,9 @@ static cmVS7FlagTable cmVS8ExtraFlagTable[] = {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, + {"EnablePREfast", "analyze", "", "TRUE", 0}, + {"EnablePREfast", "analyze-", "", "FALSE", 0}, + {0,0,0,0,0} }; cmIDEFlagTable const* cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8() -- cgit v0.12 From d421a433a89064926ae6aad532850b8bed113562 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 1 Feb 2011 14:16:30 -0500 Subject: Strip trailing space from xcode-select output (#10723) Otherwise, subsequent use of the output does not work as intended. --- Modules/Platform/Darwin.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index a99ff4a..c11c8fb 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -68,7 +68,8 @@ IF(NOT _CMAKE_OSX_SDKS) FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select) IF(CMAKE_XCODE_SELECT) EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path" - OUTPUT_VARIABLE OSX_DEVELOPER_ROOT) + OUTPUT_VARIABLE OSX_DEVELOPER_ROOT + OUTPUT_STRIP_TRAILING_WHITESPACE) FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*") ENDIF(CMAKE_XCODE_SELECT) ENDIF(NOT _CMAKE_OSX_SDKS) -- cgit v0.12 From ea9de57750775dd80e83f6b6d5bd930a221b6f32 Mon Sep 17 00:00:00 2001 From: Sebastian Herbst Date: Tue, 9 Mar 2010 20:59:01 +0100 Subject: VS8/9: Add flag map entries for /Zc:wchar_t (#10397) --- Source/cmGlobalVisualStudio8Generator.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index b066179..ef723b7 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -358,8 +358,14 @@ static cmVS7FlagTable cmVS8ExtraFlagTable[] = {"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0}, {"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0}, - {"EnablePREfast", "analyze", "", "TRUE", 0}, - {"EnablePREfast", "analyze-", "", "FALSE", 0}, + {"EnablePREfast", "analyze", "", "true", 0}, + {"EnablePREfast", "analyze-", "", "false", 0}, + + // Language options + {"TreatWChar_tAsBuiltInType", "Zc:wchar_t", + "wchar_t is a built-in type", "true", 0}, + {"TreatWChar_tAsBuiltInType", "Zc:wchar_t-", + "wchar_t is not a built-in type", "false", 0}, {0,0,0,0,0} }; -- cgit v0.12 From e9425d405373947662957a847a6827a4cd46670d Mon Sep 17 00:00:00 2001 From: Sebastian Herbst Date: Tue, 9 Mar 2010 21:00:56 +0100 Subject: VS7/8/9: Add flag map for string pooling option (#10397) --- Source/cmLocalVisualStudio7Generator.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 4f0cbb9..de53025 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -462,6 +462,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = "Disables whole program optimization", "FALSE", 0}, {"WarnAsError", "WX", "Treat warnings as errors", "TRUE", 0}, {"BrowseInformation", "FR", "Generate browse information", "1", 0}, + {"StringPooling", "GF", "Enable StringPooling", "TRUE", 0}, {0,0,0,0,0} }; -- cgit v0.12 From 816c9d1aa1f2b42d40c81a991b68c96eb12b6d26 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 1 Feb 2011 15:37:25 -0500 Subject: CTest: Add alias for make test target (#4564) Clients may define CTEST_TEST_TARGET_ALIAS in a project's initial cache to get a target of another name that executes the same underlying command as "make test" --- Modules/CTestTargets.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake index e3ef86c..d66874d 100644 --- a/Modules/CTestTargets.cmake +++ b/Modules/CTestTargets.cmake @@ -84,4 +84,12 @@ IF(NOT _CTEST_TARGETS_ADDED) ENDFOREACH(testtype) ENDFOREACH(mode) ENDIF("${CMAKE_GENERATOR}" MATCHES Make) + + # If requested, add an alias that is the equivalent of the built-in "test" + # or "RUN_TESTS" target: + IF(CTEST_TEST_TARGET_ALIAS) + ADD_CUSTOM_TARGET(${CTEST_TEST_TARGET_ALIAS} + ${CMAKE_CTEST_COMMAND} ${__conf_types} + ) + ENDIF() ENDIF(NOT _CTEST_TARGETS_ADDED) -- cgit v0.12 From bd7dd34aba1d4d9bf0dce6465e1fbc14ace321f8 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 2 Feb 2011 00:02:06 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 99262dd..c5d6c9f 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 01) +SET(KWSYS_DATE_STAMP_DAY 02) -- cgit v0.12 From 94d1684a8fd0de4310874cd582636a8e26402da2 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 2 Feb 2011 18:18:14 -0500 Subject: Add CMAKE_SCRIPT_MODE_FILE variable (#2828) New CMake variable is set when processing a -P script file, but not when configuring a project. --- Source/cmDocumentVariables.cxx | 8 ++++++++ Source/cmGetCMakePropertyCommand.cxx | 21 +++++++++++---------- Source/cmMakefile.cxx | 5 +++++ Source/cmMakefile.h | 7 ++++++- Source/cmake.cxx | 6 ++++++ Tests/CMakeTests/StringTestScript.cmake | 2 ++ 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 6fffecb..897881c 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -97,6 +97,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables that Provide Information"); cm->DefineProperty + ("CMAKE_SCRIPT_MODE_FILE", cmProperty::VARIABLE, + "Full path to the -P script file currently being processed. ", + "When run in -P script mode, CMake sets this variable to the full " + "path of the script file. When run to configure a CMakeLists.txt " + "file, this variable is not set.", false, + "Variables that Provide Information"); + + cm->DefineProperty ("CMAKE_BUILD_TOOL", cmProperty::VARIABLE, "Tool used for the actual build process.", "This variable is set to the program that will be" diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index e3448de..8bb5487 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -22,21 +22,22 @@ bool cmGetCMakePropertyCommand this->SetError("called with incorrect number of arguments"); return false; } - + std::vector::size_type cc; std::string variable = args[0]; std::string output = "NOTFOUND"; - if ( args[1] == "VARIABLES") + if ( args[1] == "VARIABLES" ) { int cacheonly = 0; std::vector vars = this->Makefile->GetDefinitions(cacheonly); - for ( cc = 0; cc < vars.size(); cc ++ ) + if (vars.size()>0) { - if ( cc > 0 ) - { - output += ";"; - } + output = vars[0]; + } + for ( cc = 1; cc < vars.size(); ++cc ) + { + output += ";"; output += vars[cc]; } } @@ -62,15 +63,15 @@ bool cmGetCMakePropertyCommand } else { - const char *prop = + const char *prop = this->Makefile->GetCMakeInstance()->GetProperty(args[1].c_str()); if (prop) { output = prop; } } + this->Makefile->AddDefinition(variable.c_str(), output.c_str()); - + return true; } - diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e14e44d..daea7bf 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2744,6 +2744,11 @@ void cmMakefile::SetHomeOutputDirectory(const char* lib) } } +void cmMakefile::SetScriptModeFile(const char* scriptfile) +{ + this->AddDefinition("CMAKE_SCRIPT_MODE_FILE", scriptfile); +} + //---------------------------------------------------------------------------- cmSourceFile* cmMakefile::GetSource(const char* sourceName) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 837a352..ebe2801 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -411,7 +411,12 @@ public: return this->HomeOutputDirectory.c_str(); } //@} - + + /** + * Set CMAKE_SCRIPT_MODE_FILE variable when running a -P script. + */ + void SetScriptModeFile(const char* scriptfile); + //@{ /** * Set/Get the start directory (or output directory). The start directory diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bab0aaf..e063ea6 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -510,6 +510,12 @@ void cmake::ReadListFile(const char *path) (cmSystemTools::GetCurrentWorkingDirectory().c_str()); lg->GetMakefile()->SetStartDirectory (cmSystemTools::GetCurrentWorkingDirectory().c_str()); + if (this->GetScriptMode()) + { + std::string file(cmSystemTools::CollapseFullPath(path)); + cmSystemTools::ConvertToUnixSlashes(file); + lg->GetMakefile()->SetScriptModeFile(file.c_str()); + } if (!lg->GetMakefile()->ReadListFile(0, path)) { cmSystemTools::Error("Error processing file:", path); diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake index 3703856..d1db2ee 100644 --- a/Tests/CMakeTests/StringTestScript.cmake +++ b/Tests/CMakeTests/StringTestScript.cmake @@ -194,6 +194,8 @@ elseif(testname STREQUAL random_with_various_alphabets) # pass string(RANDOM LENGTH 78 ALPHABET "~`!@#$%^&*()_-+={}[]\\|:\\;'\",.<>/?" v) message(STATUS "v='${v}'") + message(STATUS "CMAKE_SCRIPT_MODE_FILE='${CMAKE_SCRIPT_MODE_FILE}'") + else() # fail message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'") -- cgit v0.12 From 106958c047c9af783b0216916c8e0d8c52595ff6 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 2 Feb 2011 21:17:23 -0500 Subject: Add CMAKE_ARGC and CMAKE_ARGV0..N-1 variables (#2828) For now, these variables are only available in -P script mode. --- Source/cmDocumentVariables.cxx | 16 ++++++++++++++++ Source/cmMakefile.cxx | 16 ++++++++++++++++ Source/cmMakefile.h | 5 +++++ Source/cmake.cxx | 13 ++++++++----- Source/cmake.h | 2 +- 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 897881c..a08f95c 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -105,6 +105,22 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables that Provide Information"); cm->DefineProperty + ("CMAKE_ARGC", cmProperty::VARIABLE, + "Number of command line arguments passed to CMake in script mode. ", + "When run in -P script mode, CMake sets this variable to the number " + "of command line arguments. See also CMAKE_ARGV0, 1, 2 ... ", false, + "Variables that Provide Information"); + + cm->DefineProperty + ("CMAKE_ARGV0", cmProperty::VARIABLE, + "Command line argument passed to CMake in script mode. ", + "When run in -P script mode, CMake sets this variable to " + "the first command line argument. It then also sets CMAKE_ARGV1, " + "CMAKE_ARGV2, ... and so on, up to the number of command line arguments " + "given. See also CMAKE_ARGC.", false, + "Variables that Provide Information"); + + cm->DefineProperty ("CMAKE_BUILD_TOOL", cmProperty::VARIABLE, "Tool used for the actual build process.", "This variable is set to the program that will be" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index daea7bf..3fa846a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2749,6 +2749,22 @@ void cmMakefile::SetScriptModeFile(const char* scriptfile) this->AddDefinition("CMAKE_SCRIPT_MODE_FILE", scriptfile); } +void cmMakefile::SetArgcArgv(const std::vector& args) +{ + cmOStringStream strStream; + strStream << args.size(); + this->AddDefinition("CMAKE_ARGC", strStream.str().c_str()); + //this->MarkVariableAsUsed("CMAKE_ARGC"); + + for (unsigned int t = 0; t < args.size(); ++t) + { + cmOStringStream tmpStream; + tmpStream << "CMAKE_ARGV" << t; + this->AddDefinition(tmpStream.str().c_str(), args[t].c_str()); + //this->MarkVariableAsUsed(tmpStream.str().c_str()); + } +} + //---------------------------------------------------------------------------- cmSourceFile* cmMakefile::GetSource(const char* sourceName) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index ebe2801..1c1aef3 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -417,6 +417,11 @@ public: */ void SetScriptModeFile(const char* scriptfile); + /** + * Set CMAKE_ARGC, CMAKE_ARGV0 ... variables. + */ + void SetArgcArgv(const std::vector& args); + //@{ /** * Set/Get the start directory (or output directory). The start directory diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e063ea6..215971f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -462,7 +462,7 @@ bool cmake::SetCacheArgs(const std::vector& args) } } std::cerr << "loading initial cache file " << path.c_str() << "\n"; - this->ReadListFile(path.c_str()); + this->ReadListFile(args, path.c_str()); } else if(arg.find("-P",0) == 0) { @@ -478,13 +478,13 @@ bool cmake::SetCacheArgs(const std::vector& args) cmSystemTools::Error("No cmake script provided."); return false; } - this->ReadListFile(path.c_str()); + this->ReadListFile(args, path.c_str()); } } return true; } -void cmake::ReadListFile(const char *path) +void cmake::ReadListFile(const std::vector& args, const char *path) { // if a generator was not yet created, temporarily create one cmGlobalGenerator *gg = this->GetGlobalGenerator(); @@ -515,6 +515,8 @@ void cmake::ReadListFile(const char *path) std::string file(cmSystemTools::CollapseFullPath(path)); cmSystemTools::ConvertToUnixSlashes(file); lg->GetMakefile()->SetScriptModeFile(file.c_str()); + + lg->GetMakefile()->SetArgcArgv(args); } if (!lg->GetMakefile()->ReadListFile(0, path)) { @@ -2203,13 +2205,14 @@ int cmake::ActualConfigure() void cmake::PreLoadCMakeFiles() { + std::vector args; std::string pre_load = this->GetHomeDirectory(); if ( pre_load.size() > 0 ) { pre_load += "/PreLoad.cmake"; if ( cmSystemTools::FileExists(pre_load.c_str()) ) { - this->ReadListFile(pre_load.c_str()); + this->ReadListFile(args, pre_load.c_str()); } } pre_load = this->GetHomeOutputDirectory(); @@ -2218,7 +2221,7 @@ void cmake::PreLoadCMakeFiles() pre_load += "/PreLoad.cmake"; if ( cmSystemTools::FileExists(pre_load.c_str()) ) { - this->ReadListFile(pre_load.c_str()); + this->ReadListFile(args, pre_load.c_str()); } } } diff --git a/Source/cmake.h b/Source/cmake.h index 1bb42d3..7c75c2f 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -406,7 +406,7 @@ protected: bool DoSuppressDevWarnings; ///! read in a cmake list file to initialize the cache - void ReadListFile(const char *path); + void ReadListFile(const std::vector& args, const char *path); ///! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file. /// If it is set, truncate it to 50kb -- cgit v0.12 From 26eba9cb9c1cbdc7739a9a26aeb4b8f00802f56d Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 3 Feb 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index c5d6c9f..1641be5 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 02) +SET(KWSYS_DATE_STAMP_DAY 03) -- cgit v0.12 From c310450daf346aafe1e9b230752952228a7e7815 Mon Sep 17 00:00:00 2001 From: David Cole Date: Thu, 3 Feb 2011 10:21:32 -0500 Subject: Silence the may be used uninitialized warnings: initialize stuff. --- Source/CPack/cmCPackOSXX11Generator.cxx | 2 +- Source/CPack/cmCPackPackageMakerGenerator.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 2d4bb97..0e8cbc0 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -150,7 +150,7 @@ int cmCPackOSXX11Generator::PackageFiles() // since we get random dashboard failures with this one // try running it more than once int numTries = 4; - bool res; + bool res = false; while(numTries > 0) { res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index ef81da8..0c4b1a6 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -320,7 +320,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string output; int retVal = 1; int numTries = 4; - bool res; + bool res = false; while(numTries > 0) { res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, -- cgit v0.12 From aa78a60ca65b37472a6cb217a269ebd5e1a37b6e Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 4 Feb 2011 00:01:22 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 1641be5..19928cc 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 03) +SET(KWSYS_DATE_STAMP_DAY 04) -- cgit v0.12 From 7a1027a1b6d1544bae9329f42c0872a551859572 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Thu, 3 Feb 2011 16:37:04 -0700 Subject: When checking find_package() components, special case qtmain. Its just a library on Windows only. Fixes bug #11791. --- Modules/FindQt4.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index ec04cd2..31fa43c 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1112,7 +1112,13 @@ IF( Qt4_FIND_COMPONENTS ) SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR) FOREACH( component ${Qt4_FIND_COMPONENTS} ) STRING( TOUPPER ${component} _COMPONENT ) - SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) + if(${_COMPONENT} STREQUAL "QTMAIN") + IF(Q_WS_WIN) + SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY) + ENDIF(Q_WS_WIN) + else(${_COMPONENT} STREQUAL "QTMAIN") + SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) + endif(${_COMPONENT} STREQUAL "QTMAIN") ENDFOREACH( component ) if(Qt4_FIND_COMPONENTS MATCHES QtGui) -- cgit v0.12 From a58ace68ce3a0ca69d0f7e3f103eab65d7302a9a Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 4 Feb 2011 10:38:22 -0500 Subject: Fix KWStyle line-too-long complaint (#2828) --- Source/cmake.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 215971f..8dbc952 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -484,7 +484,8 @@ bool cmake::SetCacheArgs(const std::vector& args) return true; } -void cmake::ReadListFile(const std::vector& args, const char *path) +void cmake::ReadListFile(const std::vector& args, + const char *path) { // if a generator was not yet created, temporarily create one cmGlobalGenerator *gg = this->GetGlobalGenerator(); -- cgit v0.12 From 2434d8826ee193f38090d97f73bdbf276bf7df10 Mon Sep 17 00:00:00 2001 From: Kovarththanan Rajaratnam Date: Sun, 21 Mar 2010 12:20:48 +0100 Subject: Documentation: document platform specific -E commands (#10446) Signed-off-by: Kovarththanan Rajaratnam --- Source/cmakemain.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index a51673c..c63f667 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -74,8 +74,10 @@ static const char * cmDocumentationOptions[][3] = "information. Commands available are: chdir, copy, copy_if_different " "copy_directory, compare_files, echo, echo_append, environment, " "make_directory, md5sum, remove_directory, remove, tar, time, " - "touch, touch_nocreate, write_regv, delete_regv, comspec, " - "create_symlink."}, + "touch, touch_nocreate. In addition, some platform specific commands " + "are available. " + "Windows: comspec, delete_regv, write_regv. " + "UNIX: create_symlink."}, {"-i", "Run in wizard mode.", "Wizard mode runs cmake interactively without a GUI. The user is " "prompted to answer questions about the project configuration. " -- cgit v0.12 From 1019d8272758ba615aface2291faca2bd53a5f0b Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 4 Feb 2011 11:36:21 -0500 Subject: Documentation: Sync two differing copies of -E docs (#10446) Alphabetize both lists. Put platform-specific docs in both places too. --- Source/cmake.cxx | 20 +++++++++++--------- Source/cmakemain.cxx | 10 +++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bab0aaf..a1a3a68 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -979,37 +979,39 @@ void CMakeCommandUsage(const char* program) errorStream << "Usage: " << program << " -E [command] [arguments ...]\n" << "Available commands: \n" + << " build build_dir - build the project in build_dir.\n" << " chdir dir cmd [args]... - run command in a given directory\n" - << " rename oldname newname - rename a file or directory " - "(on one volume)\n" + << " compare_files file1 file2 - check if file1 is same as file2\n" << " copy file destination - copy file to destination (either file " "or directory)\n" - << " copy_if_different in-file out-file - copy file if input has " - "changed\n" << " copy_directory source destination - copy directory 'source' " "content to directory 'destination'\n" - << " compare_files file1 file2 - check if file1 is same as file2\n" + << " copy_if_different in-file out-file - copy file if input has " + "changed\n" << " echo [string]... - displays arguments as text\n" << " echo_append [string]... - displays arguments as text but no new " "line\n" << " environment - display the current environment\n" << " make_directory dir - create a directory\n" << " md5sum file1 [...] - compute md5sum of files\n" - << " remove_directory dir - remove a directory and its contents\n" << " remove [-f] file1 file2 ... - remove the file(s), use -f to force " "it\n" + << " remove_directory dir - remove a directory and its contents\n" + << " rename oldname newname - rename a file or directory " + "(on one volume)\n" << " tar [cxt][vfz][cvfj] file.tar " "file/dir1 file/dir2 ... - create a tar " "archive\n" << " time command [args] ... - run command and return elapsed time\n" << " touch file - touch a file.\n" << " touch_nocreate file - touch a file but do not create it.\n" - << " build build_dir - build the project in build_dir.\n" #if defined(_WIN32) && !defined(__CYGWIN__) - << " write_regv key value - write registry value\n" - << " delete_regv key - delete registry value\n" + << "Available on Windows only:\n" << " comspec - on windows 9x use this for RunCommand\n" + << " delete_regv key - delete registry value\n" + << " write_regv key value - write registry value\n" #else + << "Available on UNIX only:\n" << " create_symlink old new - create a symbolic link new -> old\n" #endif ; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index c63f667..a5dca18 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -71,13 +71,13 @@ static const char * cmDocumentationOptions[][3] = {"-E", "CMake command mode.", "For true platform independence, CMake provides a list of commands " "that can be used on all systems. Run with -E help for the usage " - "information. Commands available are: chdir, copy, copy_if_different " - "copy_directory, compare_files, echo, echo_append, environment, " - "make_directory, md5sum, remove_directory, remove, tar, time, " + "information. Commands available are: build, chdir, compare_files, copy, " + "copy_directory, copy_if_different, echo, echo_append, environment, " + "make_directory, md5sum, remove, remove_directory, rename, tar, time, " "touch, touch_nocreate. In addition, some platform specific commands " "are available. " - "Windows: comspec, delete_regv, write_regv. " - "UNIX: create_symlink."}, + "On Windows: comspec, delete_regv, write_regv. " + "On UNIX: create_symlink."}, {"-i", "Run in wizard mode.", "Wizard mode runs cmake interactively without a GUI. The user is " "prompted to answer questions about the project configuration. " -- cgit v0.12 From 00e7ea76e83153db1f95289a4b101b3031c97b99 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Fri, 4 Feb 2011 20:31:18 +0100 Subject: Fix crash in GraphVizWriter when GRAPHVIZ_TARGET_IGNORE_REGEX is used GraphVizWriter could crash if GRAPHVIZ_TARGET_IGNORE_REGEX was set. Patch from Christian Ehrlicher. Alex --- Source/cmGraphVizWriter.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index bdb33bc..de95aa5 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -272,6 +272,12 @@ void cmGraphVizWriter::WriteConnections(const char* targetName, std::map::const_iterator libNameIt = this->TargetNamesNodes.find(libName); + // can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used + if(libNameIt == this->TargetNamesNodes.end()) + { + continue; + } + std::string connectionName = myNodeName; connectionName += "-"; connectionName += libNameIt->second; -- cgit v0.12 From d27dfc25c11516f775255dc1b4ff6eaf8df42eb5 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 5 Feb 2011 00:01:10 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 19928cc..5c95d49 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 04) +SET(KWSYS_DATE_STAMP_DAY 05) -- cgit v0.12 From f97a1c6493770c2a17923a0696c4bac08284271b Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 6 Feb 2011 00:01:10 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 5c95d49..5567430 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 05) +SET(KWSYS_DATE_STAMP_DAY 06) -- cgit v0.12 From 494bb8ada786be70f39807a574bea6a1ef98654d Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Sun, 6 Feb 2011 21:23:10 +0100 Subject: CPackRPM honors all the different ways of packaging components RPM cannot easily 'merge' differents directory into a single RPM with shared prefix. So more flexibility has been added to generic CPackGenerator in order to let the specific generator chose the local installation directory for each component. --- Source/CPack/cmCPackArchiveGenerator.cxx | 2 - Source/CPack/cmCPackGenerator.cxx | 36 +++++- Source/CPack/cmCPackGenerator.h | 13 +++ Source/CPack/cmCPackRPMGenerator.cxx | 188 ++++++++++++++++++++++++++++--- Source/CPack/cmCPackRPMGenerator.h | 13 +++ 5 files changed, 229 insertions(+), 23 deletions(-) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 46be99b..febf205 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -226,8 +226,6 @@ int cmCPackArchiveGenerator::PackageFiles() cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl); - PrepareGroupingKind(); - if (SupportsComponentInstallation()) { // CASE 1 : COMPONENT ALL-IN-ONE package // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index feda52c..69d9b8c 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -684,7 +684,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( if (componentInstall) { tempInstallDirectory += "/"; - tempInstallDirectory += installComponent; + // Some CPack generators would rather chose + // the local installation directory suffix. + // Some (e.g. RPM) use + // one install directory for each component **GROUP** + // instead of the default + // one install directory for each component. + tempInstallDirectory += + GetComponentInstallDirNameSuffix(installComponent); } if (!setDestDir) @@ -873,6 +880,12 @@ int cmCPackGenerator::DoPackage() return 0; } + // Digest Component grouping specification + if ( !this->PrepareGroupingKind() ) + { + return 0; + } + if ( cmSystemTools::IsOn( this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY")) ) { @@ -1251,11 +1264,11 @@ int cmCPackGenerator::PrepareGroupingKind() cmCPackLogger(cmCPackLog::LOG_VERBOSE, "[" << this->Name << "]" << " requested component grouping = "<< groupingType <Name << "]" << " requested component grouping type <"<< groupingType - << "> UNKNOWN not in (ALL_GROUP_IN_ONE," - "ALL_COMPONENT_IN_ONE,IGNORE)" < UNKNOWN not in (ALL_GROUPS_IN_ONE," + "ALL_COMPONENTS_IN_ONE,IGNORE)" <Name << "]" + << " requested component grouping = (" + << "ALL_GROUPS_IN_ONE=" << allGroupInOne + << ", ALL_COMPONENTS_IN_ONE=" << allComponentInOne + << ", IGNORE_GROUPS=" << ignoreComponentGroup + << ")" + << std::endl); // Some components were defined but NO group // force ignoreGroups if (this->ComponentGroups.empty() && (!this->Components.empty()) @@ -1288,6 +1309,11 @@ int cmCPackGenerator::PrepareGroupingKind() return 1; } +std::string cmCPackGenerator::GetComponentInstallDirNameSuffix( + const std::string& componentName) { + return componentName; +} + //---------------------------------------------------------------------- bool cmCPackGenerator::SupportsComponentInstallation() const { diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index f44a334..d4b1b16 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -132,6 +132,19 @@ protected: virtual int PrepareGroupingKind(); /** + * Some CPack generators may prefer to have + * CPack install all components belonging to the same + * [component] group to be install in the same directory. + * The default behavior is to install each component in + * a separate directory. + * @param[in] componentName the name of the component to be installed + * @return the name suffix the generator wants for the specified component + * default is "componentName" + */ + virtual std::string GetComponentInstallDirNameSuffix( + const std::string& componentName); + + /** * Package the list of files and/or components which * has been prepared by the beginning of DoPackage. * @pre @ref toplevel has been filled-in diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index a5db78f..a5a9753 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -35,26 +35,63 @@ int cmCPackRPMGenerator::InitializeInternal() } //---------------------------------------------------------------------- -int cmCPackRPMGenerator::PackageFiles() +int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) { int retval = 1; - /* Digest Component grouping specification */ - retval = PrepareGroupingKind(); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " - << toplevel << std::endl); + /* Reset package file name list it will be populated during the + * component packaging run*/ + packageFileNames.clear(); + std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); - /* Are we in the component packaging case */ - if (SupportsComponentInstallation() & (!this->ComponentGroups.empty())) + // The default behavior is to have one package by component group + // unless CPACK_COMPONENTS_IGNORE_GROUP is specified. + if (!ignoreGroup) + { + std::map::iterator compGIt; + for (compGIt=this->ComponentGroups.begin(); + compGIt!=this->ComponentGroups.end(); ++compGIt) + { + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: " + << compGIt->first + << std::endl); + // Begin the archive for this group + std::string localToplevel(initialTopLevel); + std::string packageFileName( + cmSystemTools::GetParentDirectory(toplevel.c_str()) + ); + std::string outputFileName( + std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + +"-"+compGIt->first + this->GetOutputExtension() + ); + + localToplevel += "/"+ compGIt->first; + /* replace the TEMP DIRECTORY with the component one */ + this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str()); + packageFileName += "/"+ outputFileName; + /* replace proposed CPACK_OUTPUT_FILE_NAME */ + this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); + /* replace the TEMPORARY package file name */ + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", + packageFileName.c_str()); + // Tell CPackRPM.cmake the name of the component GROUP. + this->SetOption("CPACK_RPM_PACKAGE_COMPONENT",compGIt->first.c_str()); + if (!this->ReadListFile("CPackRPM.cmake")) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackRPM.cmake" << std::endl); + retval = 0; + } + // add the generated package to package file names list + packageFileNames.push_back(packageFileName); + } + } + // CPACK_COMPONENTS_IGNORE_GROUPS is set + // We build 1 package per component + else { - /* Reset package file name list it will be populated during the - * component packaging run*/ - packageFileNames.clear(); - std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); - /* One Package per component CASE */ - /* Iterate over components */ std::map::iterator compIt; for (compIt=this->Components.begin(); - compIt!=this->Components.end(); ++compIt ) + compIt!=this->Components.end(); ++compIt ) { std::string localToplevel(initialTopLevel); std::string packageFileName( @@ -82,12 +119,101 @@ int cmCPackRPMGenerator::PackageFiles() "Error while execution CPackRPM.cmake" << std::endl); retval = 0; } - // add the generated package to package file names list packageFileNames.push_back(packageFileName); } } - /* This is the non component case */ + return retval; +} + +//---------------------------------------------------------------------- +int cmCPackRPMGenerator::PackageComponentsAllInOne(bool allComponent) +{ + int retval = 1; + std::string compInstDirName; + /* Reset package file name list it will be populated during the + * component packaging run*/ + packageFileNames.clear(); + std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); + + // all GROUP in one vs all COMPONENT in one + if (allComponent) + { + compInstDirName = "ALL_COMPONENTS_IN_ONE"; + } + else + { + compInstDirName = "ALL_GROUPS_IN_ONE"; + } + + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Packaging all groups in one package..." + "(CPACK_COMPONENTS_ALL_[GROUPS_]IN_ONE_PACKAGE is set)" + << std::endl); + + // The ALL GROUPS in ONE package case + std::string localToplevel(initialTopLevel); + std::string packageFileName( + cmSystemTools::GetParentDirectory(toplevel.c_str()) + ); + std::string outputFileName( + std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + +"-ALL"+ this->GetOutputExtension() + ); + // all GROUP in one vs all COMPONENT in one + localToplevel += "/"+compInstDirName; + + /* replace the TEMP DIRECTORY with the component one */ + this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str()); + packageFileName += "/"+ outputFileName; + /* replace proposed CPACK_OUTPUT_FILE_NAME */ + this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str()); + /* replace the TEMPORARY package file name */ + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", + packageFileName.c_str()); + // Tell CPackRPM.cmake the name of the component GROUP. + this->SetOption("CPACK_RPM_PACKAGE_COMPONENT",compInstDirName.c_str()); + if (!this->ReadListFile("CPackRPM.cmake")) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error while execution CPackRPM.cmake" << std::endl); + retval = 0; + } + // add the generated package to package file names list + packageFileNames.push_back(packageFileName); + + return 1; +} + +//---------------------------------------------------------------------- +int cmCPackRPMGenerator::PackageFiles() +{ + int retval = 1; + + cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " + << toplevel << std::endl); + + /* Are we in the component packaging case */ + if (SupportsComponentInstallation()) { + // CASE 1 : COMPONENT ALL-IN-ONE package + // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested + // then the package file is unique and should be open here. + if (allComponentInOne || + (allGroupInOne && (!this->ComponentGroups.empty())) + ) + { + return PackageComponentsAllInOne(allComponentInOne); + } + // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one) + // There will be 1 package for each component group + // however one may require to ignore component group and + // in this case you'll get 1 package for each component. + else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup)) + { + return PackageComponents(ignoreComponentGroup); + } + } + // CASE 3 : NON COMPONENT package. else { if (!this->ReadListFile("CPackRPM.cmake")) @@ -118,3 +244,33 @@ bool cmCPackRPMGenerator::SupportsComponentInstallation() const } } +std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix( + const std::string& componentName) + { + if (ignoreComponentGroup) { + return componentName; + } + + if (allComponentInOne) { + return std::string("ALL_COMPONENTS_IN_ONE"); + } + // We have to find the name of the COMPONENT GROUP + // the current COMPONENT belongs to. + std::string groupVar = "CPACK_COMPONENT_" + + cmSystemTools::UpperCase(componentName) + "_GROUP"; + if (NULL != GetOption(groupVar.c_str())) + { + if (allGroupInOne) + { + return std::string("ALL_GROUPS_IN_ONE"); + } + else + { + return std::string(GetOption(groupVar.c_str())); + } + } + else + { + return componentName; + } + } diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h index 57d5cca..7c2e434 100644 --- a/Source/CPack/cmCPackRPMGenerator.h +++ b/Source/CPack/cmCPackRPMGenerator.h @@ -38,8 +38,21 @@ public: protected: virtual int InitializeInternal(); virtual int PackageFiles(); + /** + * The method used to package files when component + * install is used. This will create one + * archive for each component group. + */ + int PackageComponents(bool ignoreGroup); + /** + * Special case of component install where all + * components will be put in a single installer. + */ + int PackageComponentsAllInOne(bool allComponent); virtual const char* GetOutputExtension() { return ".rpm"; } virtual bool SupportsComponentInstallation() const; + virtual std::string GetComponentInstallDirNameSuffix( + const std::string& componentName); }; -- cgit v0.12 From d7a51814a3886d99e8191183b21cb17198c05d34 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 7 Feb 2011 00:01:33 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 5567430..d97397f 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 06) +SET(KWSYS_DATE_STAMP_DAY 07) -- cgit v0.12 From 41b7b3efa4e2684085be7c7dd76baea17f269988 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 7 Feb 2011 10:06:50 -0500 Subject: libarchive: Define major/minor/makedev only where needed (#11648) If neither MAJOR_IN_MKDEV or MAJOR_IN_SYSMACROS is defined then provide our own implementation of these macros locally. This complements the change in commit cf5ad183 (Fix major() check for LSB 4.0, 2011-01-12). This patch is based on upstream libarchive SVN commit 1553 (Shuffle the major/minor/makedev support a bit; this should work on both Windows and Haiku, 2009-10-31). Inspired-by: Tim Kientzle --- Utilities/cmlibarchive/libarchive/archive_entry.c | 15 +++++++++++---- Utilities/cmlibarchive/libarchive/archive_entry_xattr.c | 7 ------- Utilities/cmlibarchive/libarchive/archive_windows.h | 5 ----- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Utilities/cmlibarchive/libarchive/archive_entry.c b/Utilities/cmlibarchive/libarchive/archive_entry.c index d75dde5..c304231 100644 --- a/Utilities/cmlibarchive/libarchive/archive_entry.c +++ b/Utilities/cmlibarchive/libarchive/archive_entry.c @@ -32,12 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4 #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef MAJOR_IN_MKDEV +#if MAJOR_IN_MKDEV #include -#else -#ifdef MAJOR_IN_SYSMACROS +#define HAVE_MAJOR +#elif MAJOR_IN_SYSMACROS #include -#endif +#define HAVE_MAJOR #endif #ifdef HAVE_LIMITS_H #include @@ -75,6 +75,13 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4 #undef max #define max(a, b) ((a)>(b)?(a):(b)) +#if !defined(HAVE_MAJOR) && !defined(major) +/* Replacement for major/minor/makedev. */ +#define major(x) ((int)(0x00ff & ((x) >> 8))) +#define minor(x) ((int)(0xffff00ff & (x))) +#define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min))) +#endif + /* Play games to come up with a suitable makedev() definition. */ #ifdef __QNXNTO__ /* QNX. */ diff --git a/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c b/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c index c35c7b3..28b8ff5 100644 --- a/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c +++ b/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c @@ -32,13 +32,6 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4 #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef MAJOR_IN_MKDEV -#include -#else -#ifdef MAJOR_IN_SYSMACROS -#include -#endif -#endif #ifdef HAVE_LIMITS_H #include #endif diff --git a/Utilities/cmlibarchive/libarchive/archive_windows.h b/Utilities/cmlibarchive/libarchive/archive_windows.h index 17f5698..f85f3f0 100644 --- a/Utilities/cmlibarchive/libarchive/archive_windows.h +++ b/Utilities/cmlibarchive/libarchive/archive_windows.h @@ -94,11 +94,6 @@ #endif #endif -/* Replacement for major/minor/makedev. */ -#define major(x) ((int)(0x00ff & ((x) >> 8))) -#define minor(x) ((int)(0xffff00ff & (x))) -#define makedev(maj,min) ((0xff00 & ((maj)<<8))|(0xffff00ff & (min))) - /* Alias the Windows _function to the POSIX equivalent. */ #define access _access #define chdir __la_chdir -- cgit v0.12 From 2d14b15ec22a83ef78b0b9f1e5947f281e35d11a Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 7 Feb 2011 16:55:07 -0500 Subject: Clarify list subcommand documentation (#8154) Make it clear that list subcommands that modify the list do so in the current CMake variable scope, regardless of the original scope of the list variable involved. --- Source/cmListCommand.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h index 7f229fa..d215295 100644 --- a/Source/cmListCommand.h +++ b/Source/cmListCommand.h @@ -83,6 +83,14 @@ public: "REMOVE_DUPLICATES will remove duplicated items in the list.\n" "REVERSE reverses the contents of the list in-place.\n" "SORT sorts the list in-place alphabetically.\n" + "The list subcommands APPEND, INSERT, REMOVE_AT, REMOVE_ITEM, " + "REMOVE_DUPLICATES, REVERSE and SORT may create new values for " + "the list within the current CMake variable scope. Similar to " + "the SET command, the LIST command creates new variable values " + "in the current scope, even if the list itself is actually " + "defined in a parent scope. To propagate the results of these " + "operations upwards, use SET with PARENT_SCOPE, SET with CACHE " + "INTERNAL, or some other means of value propagation.\n" "NOTES: A list in cmake is a ; separated group of strings. " "To create a list the set command can be used. For example, " "set(var a b c d e) creates a list with a;b;c;d;e, and " -- cgit v0.12 From 68c004aa11e2a6e16ebbd20f954e0299a31c8d56 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 8 Feb 2011 00:01:10 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index d97397f..8a2177b 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 07) +SET(KWSYS_DATE_STAMP_DAY 08) -- cgit v0.12 From ee55a4f70906a41db18df07de89383f0aa948c71 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 8 Feb 2011 15:22:50 -0500 Subject: libarchive: Use OpenSSL only if CMAKE_USE_OPENSSL (#11815) OpenSSL is not part of the Linux Standard Base but its headers and libraries may still be found at build time even though they may not be available at runtime. Use it only if explicitly allowed. --- Utilities/cmlibarchive/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index 6472ec5..08cda1e 100644 --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt @@ -274,7 +274,11 @@ LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) # # Find OpenSSL # -FIND_PACKAGE(OpenSSL) +IF(CMAKE_USE_OPENSSL) + FIND_PACKAGE(OpenSSL) +ELSE() + SET(OPENSSL_FOUND 0) +ENDIF() IF(OPENSSL_FOUND) INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) @@ -296,7 +300,11 @@ LA_CHECK_INCLUDE_FILE("sha256.h" HAVE_SHA256_H) # # Find MD5/RMD160/SHA library # -FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto) +IF(CMAKE_USE_OPENSSL) + FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto) +ELSE() + SET(CRYPTO_LIBRARY "") +ENDIF() IF(CRYPTO_LIBRARY) LIST(APPEND ADDITIONAL_LIBS ${CRYPTO_LIBRARY}) ELSE(CRYPTO_LIBRARY) -- cgit v0.12 From 7258b0674cf64292751dcd36d734688031fffa4c Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 9 Feb 2011 00:01:11 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 8a2177b..6a25a79 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 08) +SET(KWSYS_DATE_STAMP_DAY 09) -- cgit v0.12 From 85163fba18cbf9149f3107c1ec35ac489d1ce641 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 9 Feb 2011 09:05:07 -0500 Subject: Add link flag table entries for VS 7,8,9 Map the following MS linker flags: /CLRUNMANAGEDCODECHECK /CLRUNMANAGEDCODECHECK:NO /DELAY:UNLOAD /DELAYSIGN /DELAYSIGN:NO /DYNAMICBASE /DYNAMICBASE:NO /NOASSEMBLY /NOENTRY /NXCOMPAT /NXCOMPAT:NO /RELEASE --- Source/cmLocalVisualStudio7Generator.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index e839ed3..0c5f0dc 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -466,6 +466,14 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE", 0}, {"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1", 0}, {"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2", 0}, + {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0}, + {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0}, + {"DataExecutionPrevention", "NXCOMPAT:NO", + "Not known to work with Windows Data Execution Prevention", "1", 0}, + {"DataExecutionPrevention", "NXCOMPAT", + "Known to work with Windows Data Execution Prevention", "2", 0}, + {"DelaySign", "DELAYSIGN:NO", "", "false", 0}, + {"DelaySign", "DELAYSIGN", "", "true", 0}, {"EntryPointSymbol", "ENTRY:", "sets the starting address", "", cmVS7FlagTable::UserValue}, {"IgnoreDefaultLibraryNames", "NODEFAULTLIB:", "default libs to ignore", "", @@ -478,8 +486,16 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"EnableCOMDATFolding", "OPT:NOICF", "Do not remove redundant COMDATs", "1", 0}, {"EnableCOMDATFolding", "OPT:ICF", "Remove redundant COMDATs", "2", 0}, + {"ResourceOnlyDLL", "NOENTRY", "Create DLL with no entry point", "true", 0}, {"OptimizeReferences", "OPT:NOREF", "Keep unreferenced data", "1", 0}, {"OptimizeReferences", "OPT:REF", "Eliminate unreferenced data", "2", 0}, + {"Profile", "PROFILE", "", "true", 0}, + {"RandomizedBaseAddress", "DYNAMICBASE:NO", + "Image may not be rebased at load-time", "1", 0}, + {"RandomizedBaseAddress", "DYNAMICBASE", + "Image may be rebased at load-time", "2", 0}, + {"SetChecksum", "RELEASE", "Enable setting checksum in header", "true", 0}, + {"SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0}, {"TargetMachine", "MACHINE:I386", "Machine x86", "1", 0}, {"TargetMachine", "MACHINE:X86", "Machine x86", "1", 0}, {"TargetMachine", "MACHINE:AM33", "Machine AM33", "2", 0}, @@ -498,6 +514,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"TargetMachine", "MACHINE:SH5", "Machine SH5", "15", 0}, {"TargetMachine", "MACHINE:THUMB", "Machine THUMB", "16", 0}, {"TargetMachine", "MACHINE:X64", "Machine x64", "17", 0}, + {"TurnOffAssemblyGeneration", "NOASSEMBLY", + "No assembly even if CLR information is present in objects.", "true", 0}, {"ModuleDefinitionFile", "DEF:", "add an export def file", "", cmVS7FlagTable::UserValue}, {"GenerateMapFile", "MAP", "enable generation of map file", "TRUE", 0}, -- cgit v0.12 From 98b448ee9e1fc12181667c5f7431163097466daf Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 9 Feb 2011 12:59:09 -0500 Subject: VS2010: Fixed GenerateManifest flag (#10704) Thanks to "McBen " for the patch. (Did not preserve original commit author information because we have a push check for first and last name, and do not accept authors with only an alias...) --- Source/cmIDEOptions.cxx | 6 ++++++ Source/cmIDEOptions.h | 1 + Source/cmVisualStudio10TargetGenerator.cxx | 14 +++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index 7acb0f0..d9c0e87 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -171,3 +171,9 @@ void cmIDEOptions::AddFlag(const char* flag, const char* value) { this->FlagMap[flag] = value; } + +//---------------------------------------------------------------------------- +void cmIDEOptions::RemoveFlag(const char* flag) +{ + this->FlagMap.erase(flag); +} diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index a156b23..a5be8fb 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -28,6 +28,7 @@ public: void AddDefine(const std::string& define); void AddDefines(const char* defines); void AddFlag(const char* flag, const char* value); + void RemoveFlag(const char* flag); protected: // create a map of xml tags to the values they should have in the output diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4cb745e..8a27ffd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -167,6 +167,7 @@ void cmVisualStudio10TargetGenerator::Generate() // Write the encoding header into the file char magic[] = {0xEF,0xBB, 0xBF}; this->BuildFileStream->write(magic, 3); + this->WriteString("\n",0); this->WriteString("WritePlatformConfigTag("LinkIncremental", configName.c_str(), 3); *this->BuildFileStream << incremental << "\n"; + + const char* manifest = "true"; + if(flags.find("MANIFEST:NO") != flags.npos) + { + manifest = "false"; + } + this->WritePlatformConfigTag("GenerateManifest", configName.c_str(), 3); + *this->BuildFileStream << manifest + << "\n"; } //---------------------------------------------------------------------------- @@ -1326,7 +1336,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& linkDirs += "%(AdditionalLibraryDirectories)"; linkOptions.AddFlag("AdditionalLibraryDirectories", linkDirs.c_str()); linkOptions.AddFlag("AdditionalDependencies", libs.c_str()); - linkOptions.AddFlag("Version", "0.0"); + linkOptions.AddFlag("Version", ""); if(linkOptions.IsDebug() || flags.find("/debug") != flags.npos) { linkOptions.AddFlag("GenerateDebugInformation", "true"); @@ -1369,6 +1379,8 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& linkOptions.AddFlag("ModuleDefinitionFile", this->ModuleDefinitionFile.c_str()); } + + linkOptions.RemoveFlag("GenerateManifest"); linkOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); linkOptions.OutputFlagMap(*this->BuildFileStream, " "); -- cgit v0.12 From fbca267331b1d85f92ea27dfcb9490369c56cf77 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 9 Feb 2011 11:42:34 -0500 Subject: VS: Only use /MANIFEST if hasManifest is true (#11216) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Jörg Riedel for the patch. --- Source/cmake.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bab0aaf..4ade5da 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -4108,7 +4108,10 @@ int cmake::VisualStudioLinkNonIncremental(std::vector& args, return -1; } // Run the link command as given - linkCommand.push_back("/MANIFEST"); + if (hasManifest) + { + linkCommand.push_back("/MANIFEST"); + } if(!cmake::RunCommand("LINK", linkCommand, verbose)) { return -1; -- cgit v0.12 From 667cf5b96368205544fb82ccce81358957987720 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 9 Feb 2011 13:22:32 -0500 Subject: Make file DOWNLOAD less noisy (#11761) Thanks to Daniel Nelson for the suggestion and the patch. --- Source/cmFileCommand.cxx | 4 ---- Tests/CMakeTests/FileDownloadTest.cmake.in | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 8ebd41f..37fced2 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2658,10 +2658,6 @@ cmFileCommand::HandleDownloadCommand(std::vector if (expectedMD5sum == actualMD5sum) { - this->Makefile->DisplayStatus( - "FILE(DOWNLOAD) returning early: file already exists with " - "expected MD5 sum", -1); - if(statusVar.size()) { cmOStringStream result; diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in index 578f510..9dc2ebb 100644 --- a/Tests/CMakeTests/FileDownloadTest.cmake.in +++ b/Tests/CMakeTests/FileDownloadTest.cmake.in @@ -37,5 +37,7 @@ file(DOWNLOAD ${url} ${dir}/file3.png TIMEOUT 2 + STATUS status EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1 ) +message(STATUS "${status}") -- cgit v0.12 From 6e02a3b2bf43f4785bb21eb1cf8bbc26ac1abc12 Mon Sep 17 00:00:00 2001 From: Marco Craveiro Date: Wed, 12 Jan 2011 22:43:24 +0000 Subject: CTest: Use the gcov --preserve-paths flag (#11717) To avoid name clashes. Before this commit, name clashes can occur when invoking gcov on a project that uses the same file name in different directories. The --preserve-paths flag ensures all file names have a complete path, avoiding name clashes. --- Source/CTest/cmCTestCoverageHandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 6863adc..005651f 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -825,7 +825,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( // Call gcov to get coverage data for this *.gcda file: // std::string fileDir = cmSystemTools::GetFilenamePath(it->c_str()); - std::string command = "\"" + gcovCommand + "\" -l -o \"" + fileDir + std::string command = "\"" + gcovCommand + "\" -l -p -o \"" + fileDir + "\" \"" + *it + "\""; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, command.c_str() -- cgit v0.12 From e53b7cbadf1b7faf353e91b6041a697a90d9584d Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 10 Feb 2011 00:01:03 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 6a25a79..3c05b52 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 09) +SET(KWSYS_DATE_STAMP_DAY 10) -- cgit v0.12 From 5cdd05bc685b21911553fc3bd8d0b179501d9a2e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Feb 2011 08:20:33 -0500 Subject: Fix documentation of MSVC_VERSION (#11833) Previously the example version number was wrong. Instead list all the known versions with correct numbers. --- Source/cmDocumentVariables.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 6fffecb..0cd5fa2 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -867,8 +867,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("MSVC_VERSION", cmProperty::VARIABLE, "The version of Microsoft Visual C/C++ being used if any.", - "The version of Microsoft Visual C/C++ being used if any. " - "For example 1300 is MSVC 6.0.", + "Known version numbers are:\n" + " 1200 = VS 6.0\n" + " 1300 = VS 7.0\n" + " 1310 = VS 7.1\n" + " 1400 = VS 8.0\n" + " 1500 = VS 9.0\n" + " 1600 = VS 10.0\n" + "", false, "Variables That Describe the System"); -- cgit v0.12 From bff5772084392d74aa3eb04188af4abb82c3ab21 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 10 Feb 2011 13:46:35 -0500 Subject: FindPerlLibs: Add notice of copyright I'm the original author of this module. See bug #7898. --- Modules/FindPerlLibs.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake index 422282f..8188b44 100644 --- a/Modules/FindPerlLibs.cmake +++ b/Modules/FindPerlLibs.cmake @@ -22,6 +22,7 @@ #============================================================================= # Copyright 2004-2009 Kitware, Inc. +# Copyright 2008 Andreas Schneider # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. -- cgit v0.12 From 2516c05c2c73e768a7ec082a6fed8b2168489f6a Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Feb 2011 16:17:44 -0500 Subject: VS: Create a Fortran DLL's import library directory The Intel Fortran plugin forgets to create the output directory into which it will write a DLL's import library. Utilize the fix added by commit f4b3bdc6 (Create an exe's implib output dir for VS, 2009-06-15) and generalized by commit 764ac980 (Generalize exe implib dir creation for VS, 2009-06-16). Create a pre-link rule to make the directory. --- Source/cmLocalVisualStudio6Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 2 +- Source/cmLocalVisualStudioGenerator.cxx | 8 ++++++-- Source/cmLocalVisualStudioGenerator.h | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 7aabf4d..095e1a7 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -863,7 +863,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target, event.Write(target.GetPreBuildCommands()); event.Write(target.GetPreLinkCommands()); cmsys::auto_ptr pcc( - this->MaybeCreateImplibDir(target, configName)); + this->MaybeCreateImplibDir(target, configName, false)); if(pcc.get()) { event.Write(*pcc); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index e839ed3..bc50dad 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1695,7 +1695,7 @@ void cmLocalVisualStudio7Generator event.Start(tool); event.Write(target.GetPreLinkCommands()); cmsys::auto_ptr pcc( - this->MaybeCreateImplibDir(target, configName)); + this->MaybeCreateImplibDir(target, configName, this->FortranProject)); if(pcc.get()) { event.Write(*pcc); diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index 9164beb..39f9962 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -32,13 +32,17 @@ cmLocalVisualStudioGenerator::~cmLocalVisualStudioGenerator() //---------------------------------------------------------------------------- cmsys::auto_ptr cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target, - const char* config) + const char* config, + bool isFortran) { cmsys::auto_ptr pcc; // If an executable exports symbols then VS wants to create an // import library but forgets to create the output directory. - if(target.GetType() != cmTarget::EXECUTABLE) { return pcc; } + // The Intel Fortran plugin always forgets to the directory. + if(target.GetType() != cmTarget::EXECUTABLE && + !(isFortran && target.GetType() == cmTarget::SHARED_LIBRARY)) + { return pcc; } std::string outDir = target.GetDirectory(config, false); std::string impDir = target.GetDirectory(config, true); if(impDir == outDir) { return pcc; } diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index 1954ac5..22112b3 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -47,7 +47,7 @@ protected: /** Construct a custom command to make exe import lib dir. */ cmsys::auto_ptr - MaybeCreateImplibDir(cmTarget& target, const char* config); + MaybeCreateImplibDir(cmTarget& target, const char* config, bool isFortran); // Safe object file name generation. void ComputeObjectNameRequirements(std::vector const&); -- cgit v0.12 From 831c5ebe581e4b5cc0dfb02c6f5e8ef4e955492f Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 11 Feb 2011 00:01:07 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 3c05b52..5968f19 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 10) +SET(KWSYS_DATE_STAMP_DAY 11) -- cgit v0.12 From 3b77516862e6e7991a5c6f16a0979dccfa439fce Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 11 Feb 2011 08:54:38 -0500 Subject: Fix linker flag initialization from LDFLAGS (#11840) When initializing CMAKE_(EXE|SHARED|MODULE)_LINKER_FLAGS from LDFLAGS and CMAKE_(EXE|SHARED|MODULE)_LINKER_FLAGS_INIT quote the whole string in case both are set. Reported-by: Daniel R. Gomez --- Modules/CMakeCommonLanguageInclude.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake index 237f8dd..a2929f1 100644 --- a/Modules/CMakeCommonLanguageInclude.cmake +++ b/Modules/CMakeCommonLanguageInclude.cmake @@ -16,7 +16,7 @@ # cache values that can be initialized in the platform-compiler.cmake file # it may be included by more than one language. -SET (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} +SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" CACHE STRING "Flags used by the linker.") @@ -70,11 +70,11 @@ IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) # shared linker flags -SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS} +SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" CACHE STRING "Flags used by the linker during the creation of dll's.") # module linker flags -SET (CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} +SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" CACHE STRING "Flags used by the linker during the creation of modules.") SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL -- cgit v0.12 From 84dafee565cd49fd26b2018f82059ad5eed99cb1 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 12 Feb 2011 00:01:05 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 5968f19..1a92984 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 11) +SET(KWSYS_DATE_STAMP_DAY 12) -- cgit v0.12 From cb94587a88866f3278676ea011c78e1c9d3663ec Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sat, 12 Feb 2011 21:49:08 +0100 Subject: Fix XML escaping for the project() name in Eclipse projects (#11658) Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 0ef771f..4cd052a 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -875,8 +875,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const fout << "\n" "\n" "\n" - "GetProjectName() << ".null.1\"" - " name=\"" << mf->GetProjectName() << "\"/>\n" + "EscapeForXML(mf->GetProjectName()) + << ".null.1\" name=\"" << this->EscapeForXML(mf->GetProjectName()) + << "\"/>\n" "\n" "\n" ; @@ -927,7 +928,8 @@ cmExtraEclipseCDT4Generator::GenerateProjectName(const std::string& name, const std::string& type, const std::string& path) { - return name + (type.empty() ? "" : "-") + type + "@" + path; + return cmExtraEclipseCDT4Generator::EscapeForXML(name) + +(type.empty() ? "" : "-") + type + "@" + path; } std::string cmExtraEclipseCDT4Generator::EscapeForXML(const std::string& value) -- cgit v0.12 From 8074bca93ca3774d3ce8ca9195f1f08d36d6e7bb Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sat, 12 Feb 2011 21:54:02 +0100 Subject: Fix XML escaping for target names in Eclipse project files (#11658) Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 4cd052a..cd22291 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -1001,15 +1001,16 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout, const std::string& path, const char* prefix) { + std::string targetXml = cmExtraEclipseCDT4Generator::EscapeForXML(target); fout << - "\n" "" << cmExtraEclipseCDT4Generator::GetEclipsePath(make) << "\n" "" << makeArgs << "\n" - "" << target << "\n" + "" << targetXml << "\n" "true\n" "false\n" "\n" -- cgit v0.12 From 79e13af195e8664a18449b09d3bc2f0e04c80992 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sat, 12 Feb 2011 22:01:27 +0100 Subject: Add XML escaping for directory name in Eclipse projects (#11658) Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index cd22291..eb78647 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -431,7 +431,8 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories( { emittedDirs.insert(dir); fout << "\n"; } } @@ -1002,9 +1003,10 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout, const char* prefix) { std::string targetXml = cmExtraEclipseCDT4Generator::EscapeForXML(target); + std::string pathXml = cmExtraEclipseCDT4Generator::EscapeForXML(path); fout << "\n" "" << cmExtraEclipseCDT4Generator::GetEclipsePath(make) -- cgit v0.12 From e8a97e075aa571b31287b23c80fcbadf892ce5c0 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 13 Feb 2011 01:15:11 +0100 Subject: Eclipse projects: created one linked resource for each subproject Now a virtual folder "Subprojects" is created, and in this virtual folder is a linked resource for each project(). This can be considered a fix for #11657 Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 71 +++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index eb78647..c4ea425 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -102,7 +102,7 @@ void cmExtraEclipseCDT4Generator::CreateSourceProjectFile() const fout << "\n" "\n" - "\t" << name << "\n" + "\t" << this->EscapeForXML(name) << "\n" "\t\n" "\t\n" "\t\n" @@ -376,11 +376,10 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() "\t\n" ; - // TODO: refactor this + fout << "\t\n"; // create linked resources if (this->IsOutOfSourceBuild) { - fout << "\t\n"; // create a linked resource to CMAKE_SOURCE_DIR // (this is not done anymore for each project because of // http://public.kitware.com/Bug/view.php?id=9978 and because I found it @@ -399,18 +398,48 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() this->SrcLinkedResources.push_back(sourceLinkedResourceName); } - // for EXECUTABLE_OUTPUT_PATH when not in binary dir - this->AppendOutLinkedResource(fout, - mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"), - mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH")); - // for LIBRARY_OUTPUT_PATH when not in binary dir - this->AppendOutLinkedResource(fout, - mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"), - mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH")); + } + + // for each sub project create a linked resource to the source dir + // - only if it is an out-of-source build + this->AppendLinkedResource(fout, "[Subprojects]", + "virtual:/virtual"); - fout << "\t\n"; + for (std::map >::const_iterator + it = this->GlobalGenerator->GetProjectMap().begin(); + it != this->GlobalGenerator->GetProjectMap().end(); + ++it) + { + std::string linkSourceDirectory = this->GetEclipsePath( + it->second[0]->GetMakefile()->GetStartDirectory()); + // a linked resource must not point to a parent directory of .project or + // .project itself + if ((this->HomeOutputDirectory != linkSourceDirectory) && + !cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(), + linkSourceDirectory.c_str())) + { + std::string linkName = "[Subprojects]/"; + linkName += it->first; + this->AppendLinkedResource(fout, linkName, + this->GetEclipsePath(linkSourceDirectory)); + this->SrcLinkedResources.push_back(it->first); + } } + // I'm not sure this makes too much sense. There can be different + // output directories in different subdirs, so we would need more of them. + + // for EXECUTABLE_OUTPUT_PATH when not in binary dir + this->AppendOutLinkedResource(fout, + mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"), + mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH")); + // for LIBRARY_OUTPUT_PATH when not in binary dir + this->AppendOutLinkedResource(fout, + mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"), + mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH")); + + fout << "\t\n"; + fout << "\n"; } @@ -551,14 +580,15 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const it != this->SrcLinkedResources.end(); ++it) { - fout << "\n"; + fout << "EscapeForXML(*it) + << "\"/>\n"; // exlude source directory from output search path // - only if not named the same as an output directory if (!cmSystemTools::FileIsDirectory( std::string(this->HomeOutputDirectory + "/" + *it).c_str())) { - excludeFromOut += *it + "/|"; + excludeFromOut += this->EscapeForXML(*it) + "/|"; } } excludeFromOut += "**/CMakeFiles/"; @@ -573,7 +603,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const it != this->OutLinkedResources.end(); ++it) { - fout << "\n"; + fout << "EscapeForXML(*it) + << "\"/>\n"; } // add pre-processor definitions to allow eclipse to gray out sections @@ -1055,11 +1086,13 @@ void cmExtraEclipseCDT4Generator { fout << "\t\t\n" - "\t\t\t" << name << "\n" + "\t\t\t" + << cmExtraEclipseCDT4Generator::EscapeForXML(name) + << "\n" "\t\t\t2\n" - "\t\t\t" - << path - << "\n" + "\t\t\t" + << cmExtraEclipseCDT4Generator::EscapeForXML(path) + << "\n" "\t\t\n" ; } -- cgit v0.12 From d26ef5c1180835d8cb32b1783b6e01806905b1e8 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 13 Feb 2011 00:01:07 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 1a92984..e307220 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 12) +SET(KWSYS_DATE_STAMP_DAY 13) -- cgit v0.12 From 2a9f7f96b804ed929c56826c8477895c5924befe Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 13 Feb 2011 22:53:43 +0100 Subject: Also add the SOURCES from add_custom_target() to CodeBlocks projects (#11736) Since CMake 2.6.3 add_custom_target() has a SOURCES option, this was not yet considered in the C::B generator. Also, now GENERATED files are not added to the project. Alex --- Source/cmExtraCodeBlocksGenerator.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index a5650d4..4f93067 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -416,11 +416,18 @@ void cmExtraCodeBlocksGenerator case cmTarget::STATIC_LIBRARY: case cmTarget::SHARED_LIBRARY: case cmTarget::MODULE_LIBRARY: + case cmTarget::UTILITY: // can have sources since 2.6.3 { const std::vector&sources=ti->second.GetSourceFiles(); for (std::vector::const_iterator si=sources.begin(); si!=sources.end(); si++) { + // don't add source files which have the GENERATED property set: + if ((*si)->GetPropertyAsBool("GENERATED")) + { + continue; + } + // check whether it is a C/C++ implementation file bool isCFile = false; if ((*si)->GetLanguage() && (*(*si)->GetLanguage() == 'C')) -- cgit v0.12 From 2a2fca24aa0058bb12f20d3d860c23123f902b74 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 14 Feb 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index e307220..12e3989 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 13) +SET(KWSYS_DATE_STAMP_DAY 14) -- cgit v0.12 From d4884710a4db8a24e08b47617c912ba83deb1e39 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 15 Feb 2011 00:01:14 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 12e3989..2fc5086 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 14) +SET(KWSYS_DATE_STAMP_DAY 15) -- cgit v0.12 From acd8161bad5d2106f176cd464819df5fbedf2ec7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 15 Feb 2011 08:46:50 -0500 Subject: ccmake: Remove extra parens around comparison The Clang compiler warns about extra parenthesis in the code if ((form->curpage == field->page)) ~ ^ ~ because the idiom is commonly used when an assignment is intended instead of a comparison. Remove the extra enclosing layer. --- Source/CursesDialog/form/frm_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index 03896c2..f234722 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -1086,7 +1086,7 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts) if (form->status & _POSTED) { - if ((form->curpage == field->page)) + if (form->curpage == field->page) { if (changed_opts & O_VISIBLE) { -- cgit v0.12 From 1bb4c7be11b2fb7a19aeedfffdbb341553aae9d2 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 15 Feb 2011 10:31:54 -0500 Subject: CMake 2.8.4 --- CMakeLists.txt | 2 +- ChangeLog.manual | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97fe0a8..91267cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -432,7 +432,7 @@ SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 8) SET(CMake_VERSION_PATCH 4) SET(CMake_VERSION_TWEAK 0) -SET(CMake_VERSION_RC 2) +#SET(CMake_VERSION_RC 2) # Releases define a tweak level. IF(DEFINED CMake_VERSION_TWEAK) diff --git a/ChangeLog.manual b/ChangeLog.manual index b61bbdc..20998a3 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,23 @@ +Changes in CMake 2.8.4 (since 2.8.4-rc2) +---------------------------------------- +Alex Neundorf (1): + Fix crash in GraphVizWriter when GRAPHVIZ_TARGET_IGNORE_REGEX is used + +Andreas Schneider (1): + FindPerlLibs: Add notice of copyright + +Brad King (3): + libarchive: Define major/minor/makedev only where needed (#11648) + libarchive: Use OpenSSL only if CMAKE_USE_OPENSSL (#11815) + Fix documentation of MSVC_VERSION (#11833) + +David Cole (1): + Silence the may be used uninitialized warnings: initialize stuff. + +Eric NOULARD (2): + CPack Tests the different ways of packaging components + Avoid foreach IN LISTS syntax which is not supported by CMake 2.6 + Changes in CMake 2.8.4-rc2 (since 2.8.4-rc1) -------------------------------------------- Alex Neundorf (3): -- cgit v0.12 From 4d1240eb0a8d0f867d7e15fe63fc6389ea550e60 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 15 Feb 2011 11:45:45 -0500 Subject: Begin post-2.8.4 development --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91267cb..23525c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -431,8 +431,8 @@ ENDIF() SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 8) SET(CMake_VERSION_PATCH 4) -SET(CMake_VERSION_TWEAK 0) -#SET(CMake_VERSION_RC 2) +#SET(CMake_VERSION_TWEAK 0) +#SET(CMake_VERSION_RC 1) # Releases define a tweak level. IF(DEFINED CMake_VERSION_TWEAK) -- cgit v0.12 From 1462561a8cab7cf3cad9979019778f3c13b0bdf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=BCtz?= Date: Tue, 15 Feb 2011 11:20:47 +0100 Subject: Add a string(FIND) sub-command (#11795) --- Source/cmStringCommand.cxx | 68 ++++++++++++++++++++++++++++- Source/cmStringCommand.h | 6 +++ Tests/CMakeTests/StringTest.cmake.in | 2 +- Tests/CMakeTests/StringTestScript.cmake | 77 +++++++++++++++++++++++++++++++++ 4 files changed, 151 insertions(+), 2 deletions(-) diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 949fcf5..1f873e2 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -72,7 +72,11 @@ bool cmStringCommand { return this->HandleRandomCommand(args); } - + else if(subCommand == "FIND") + { + return this->HandleFindCommand(args); + } + std::string e = "does not recognize sub-command "+subCommand; this->SetError(e.c_str()); return false; @@ -499,6 +503,68 @@ void cmStringCommand::StoreMatches(cmMakefile* mf,cmsys::RegularExpression& re) } //---------------------------------------------------------------------------- +bool cmStringCommand::HandleFindCommand(std::vector const& + args) +{ + // check if all required parameters were passed + if(args.size() < 4 || args.size() > 5) + { + this->SetError("sub-command FIND requires 3 or 4 parameters."); + return false; + } + + // check if the reverse flag was set or not + bool reverseMode = false; + if(args.size() == 5 && args[4] == "REVERSE") + { + reverseMode = true; + } + + // if we have 5 arguments the last one must be REVERSE + if(args.size() == 5 && args[4] != "REVERSE") + { + this->SetError("sub-command FIND: unknown last parameter"); + return false; + } + + // local parameter names. + const std::string& sstring = args[1]; + const std::string& schar = args[2]; + const std::string& outvar = args[3]; + + // ensure that the user cannot accidentally specify REVERSE as a variable + if(outvar == "REVERSE") + { + this->SetError("sub-command FIND does not allow to select REVERSE as " + "the output variable. " + "Maybe you missed the actual output variable?"); + return false; + } + + // try to find the character and return its position + size_t pos; + if(!reverseMode) + { + pos = sstring.find(schar); + } + else + { + pos = sstring.rfind(schar); + } + if(std::string::npos != pos) + { + std::stringstream s; + s << pos; + this->Makefile->AddDefinition(outvar.c_str(), s.str().c_str()); + return true; + } + + // the character was not found, but this is not really an error + this->Makefile->AddDefinition(outvar.c_str(), "-1"); + return true; +} + +//---------------------------------------------------------------------------- bool cmStringCommand::HandleCompareCommand(std::vector const& args) { diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 2a916b4..9586449 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -90,6 +90,7 @@ public: " string(STRIP )\n" " string(RANDOM [LENGTH ] [ALPHABET ]\n" " [RANDOM_SEED ] )\n" + " string(FIND [REVERSE])\n" "REGEX MATCH will match the regular expression once and store the " "match in the output variable.\n" "REGEX MATCHALL will match the regular expression as many times as " @@ -117,6 +118,10 @@ public: "characters and default alphabet is all numbers and upper and " "lower case letters. If an integer RANDOM_SEED is given, its " "value will be used to seed the random number generator.\n" + "FIND will return the position where the given substring was found " + "in the supplied string. If the REVERSE flag was used, the command " + "will search for the position of the last occurrence of the " + "specified substring.\n" "The following characters have special meaning in regular expressions:\n" " ^ Matches at beginning of a line\n" " $ Matches at end of a line\n" @@ -152,6 +157,7 @@ protected: bool HandleSubstringCommand(std::vector const& args); bool HandleStripCommand(std::vector const& args); bool HandleRandomCommand(std::vector const& args); + bool HandleFindCommand(std::vector const& args); class RegexReplacement { diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in index 54fee7f..6bb60f4 100644 --- a/Tests/CMakeTests/StringTest.cmake.in +++ b/Tests/CMakeTests/StringTest.cmake.in @@ -1,7 +1,7 @@ # Execute each test listed in StringTestScript.cmake: # set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/StringTestScript.cmake") -set(number_of_tests_expected 52) +set(number_of_tests_expected 69) include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake") execute_all_script_tests(${scriptname} number_of_tests_executed) diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake index 3703856..8dfdc89 100644 --- a/Tests/CMakeTests/StringTestScript.cmake +++ b/Tests/CMakeTests/StringTestScript.cmake @@ -194,6 +194,83 @@ elseif(testname STREQUAL random_with_various_alphabets) # pass string(RANDOM LENGTH 78 ALPHABET "~`!@#$%^&*()_-+={}[]\\|:\\;'\",.<>/?" v) message(STATUS "v='${v}'") +elseif(testname STREQUAL string_find_with_no_parameter) # fail + string(FIND) + +elseif(testname STREQUAL string_find_with_one_parameter) # fail + string(FIND "CMake is great.") + +elseif(testname STREQUAL string_find_with_two_parameters) # fail + string(FIND "CMake is great." "a") + +elseif(testname STREQUAL string_find_with_three_parameters) # pass + string(FIND "CMake is great." "a" v) + message(STATUS "v='${v}'") + +elseif(testname STREQUAL string_find_with_four_parameters) # fail + string(FIND "CMake is great." "a" v v2) + +elseif(testname STREQUAL string_find_reverse_with_no_parameter) # fail + string(FIND REVERSE) + +elseif(testname STREQUAL string_find_reverse_with_one_parameter) # fail + string(FIND "CMake is great." REVERSE) + +elseif(testname STREQUAL string_find_reverse_with_two_parameters) # fail + string(FIND "CMake is great." "a" REVERSE) + +elseif(testname STREQUAL string_find_reverse_with_three_parameters) # pass + string(FIND "CMake is great." "a" v REVERSE) + message(STATUS "v='${v}'") + +elseif(testname STREQUAL string_find_reverse_with_four_parameters_part1) # fail + string(FIND "CMake is great." "a" v v2 REVERSE) + +elseif(testname STREQUAL string_find_reverse_with_four_parameters_part2) # fail + string(FIND "CMake is great." "a" v REVERSE v2) + +elseif(testname STREQUAL string_find_with_no_possible_result) # pass + string(FIND "CMake is a great application." "z" v) + message(STATUS "v='${v}'") + if(NOT(-1 EQUAL ${v})) + message(SEND_ERROR "FIND sub-command should return -1 but returned ${v}.") + endif(NOT(-1 EQUAL ${v})) + +elseif(testname STREQUAL string_find_reverse_with_no_possible_result) # pass + string(FIND "CMake is a great application." "z" v REVERSE) + message(STATUS "v='${v}'") + if(NOT(-1 EQUAL ${v})) + message(SEND_ERROR "FIND REVERSE sub-command should return -1 but returned ${v}.") + endif(NOT(-1 EQUAL ${v})) + +elseif(testname STREQUAL string_find_with_required_result) # pass + string(FIND "CMake is a great application." "g" v) + message(STATUS "v='${v}'") + if(NOT(11 EQUAL ${v})) + message(SEND_ERROR "FIND sub-command should return 11 but returned ${v}.") + endif(NOT(11 EQUAL ${v})) + +elseif(testname STREQUAL string_find_reverse_with_required_result) # pass + string(FIND "CMake is a great application." "e" v REVERSE) + message(STATUS "v='${v}'") + if(NOT(13 EQUAL ${v})) + message(SEND_ERROR "FIND REVERSE sub-command should return 13 but returned ${v}.") + endif(NOT(13 EQUAL ${v})) + +elseif(testname STREQUAL string_find_word_reverse_with_required_result) # pass + string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v) + message(STATUS "v='${v}'") + if(NOT(24 EQUAL ${v})) + message(SEND_ERROR "FIND sub-command should return 24 but returned ${v}.") + endif(NOT(24 EQUAL ${v})) + +elseif(testname STREQUAL string_find_reverse_word_reverse_with_required_result) # pass + string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v REVERSE) + message(STATUS "v='${v}'") + if(NOT(62 EQUAL ${v})) + message(SEND_ERROR "FIND sub-command should return 62 but returned ${v}.") + endif(NOT(62 EQUAL ${v})) + else() # fail message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'") -- cgit v0.12 From 0cf1d72e3c1be9218f4dc0d1dcc0aaf03f160684 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Tue, 15 Feb 2011 19:55:36 +0100 Subject: CPackRPM fix IRIX compiler warning (variable never used) --- Source/CPack/cmCPackRPMGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index a5a9753..2d675c1 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -182,7 +182,7 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(bool allComponent) // add the generated package to package file names list packageFileNames.push_back(packageFileName); - return 1; + return retval; } //---------------------------------------------------------------------- -- cgit v0.12 From 8caed602080c6e052adec1d38dba8a37d3a76f58 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 16 Feb 2011 00:01:10 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 2fc5086..1bcbf98 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 15) +SET(KWSYS_DATE_STAMP_DAY 16) -- cgit v0.12 From e0d64d5cb159d2de493a1074beef122fbf8ad5b9 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 17 Feb 2011 00:01:11 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 1bcbf98..ed3b71c 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 16) +SET(KWSYS_DATE_STAMP_DAY 17) -- cgit v0.12 From 006124b44618db3ed672c7ea069b174b966429a1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 17 Feb 2011 08:44:22 -0500 Subject: Avoid direct use of std::stringstream In method cmStringCommand::HandleFindCommand added by parent commit use the cmOStringStream compatibility wrapper instead of std::stringstream. --- Source/cmStringCommand.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 1f873e2..19d2369 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -553,7 +553,7 @@ bool cmStringCommand::HandleFindCommand(std::vector const& } if(std::string::npos != pos) { - std::stringstream s; + cmOStringStream s; s << pos; this->Makefile->AddDefinition(outvar.c_str(), s.str().c_str()); return true; -- cgit v0.12 From 16b99e6caec41aaa4366b5f49e2d3b2de1225001 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 18 Feb 2011 00:01:33 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index ed3b71c..a4b408a 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 17) +SET(KWSYS_DATE_STAMP_DAY 18) -- cgit v0.12 From 8af8eab7a43aa80ba89d082e23928e19265be885 Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 18 Feb 2011 13:10:26 -0500 Subject: Use stable_sort to preserve test order (#11877) Using sort results in a possibly-modified sorting when all elements are "tied" - use stable_sort instead to preserve the original ordering of tied elements. --- Source/CTest/cmCTestMultiProcessHandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index f3a4457..2cae802 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -484,7 +484,7 @@ void cmCTestMultiProcessHandler::CreateTestCostList() } TestComparator comp(this); - std::sort(SortedTests.begin(), SortedTests.end(), comp); + std::stable_sort(SortedTests.begin(), SortedTests.end(), comp); } //--------------------------------------------------------- -- cgit v0.12 From 9e81dddc4f1a85345fac95d30edc07d954166123 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 19 Feb 2011 00:01:08 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index a4b408a..c596da2 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 18) +SET(KWSYS_DATE_STAMP_DAY 19) -- cgit v0.12 From 4167be052f3f68e637bb491a0b725f476bc3d46b Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Sat, 19 Feb 2011 15:30:02 -0700 Subject: Fix issues with find_path() for QtCore include dir on Mac. Fixes 11868. --- Modules/FindQt4.cmake | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 79a3d51..5e14903 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -607,14 +607,25 @@ IF (QT4_QMAKE_FOUND) FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4 HINTS ${QT_LIBRARY_DIR_TMP} - NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH + NO_DEFAULT_PATH ) FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4 HINTS ${QT_LIBRARY_DIR_TMP} - NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH + NO_DEFAULT_PATH ) + IF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG) + FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE + NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4 + HINTS ${QT_LIBRARY_DIR_TMP} + ) + FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG + NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4 + HINTS ${QT_LIBRARY_DIR_TMP} + ) + ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG) + # try dropping a hint if trying to use Visual Studio with Qt built by mingw IF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) IF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) @@ -644,10 +655,13 @@ IF (QT4_QMAKE_FOUND) ENDIF() IF (APPLE) + SET(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK}) IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE) + SET(CMAKE_FIND_FRAMEWORK FIRST) ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE) + SET(CMAKE_FIND_FRAMEWORK LAST) ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) MARK_AS_ADVANCED(QT_USE_FRAMEWORKS) ENDIF (APPLE) @@ -663,8 +677,7 @@ IF (QT4_QMAKE_FOUND) _qt4_query_qmake(QT_INSTALL_HEADERS qt_headers) SET(QT_QTCORE_INCLUDE_DIR NOTFOUND) FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore - HINTS ${qt_headers} - ${QT_LIBRARY_DIR}/QtCore.framework/Headers + HINTS ${qt_headers} ${QT_LIBRARY_DIR} PATH_SUFFIXES QtCore ) @@ -682,6 +695,10 @@ IF (QT4_QMAKE_FOUND) ENDIF() ENDIF() + IF(APPLE) + SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD}) + ENDIF(APPLE) + # Set QT_INCLUDE_DIR based on QT_HEADERS_DIR IF(QT_HEADERS_DIR) IF(QT_USE_FRAMEWORKS) -- cgit v0.12 From dff3d7da3fecac13de1d7893afa79007a4fc052a Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 20 Feb 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index c596da2..8f4c05f 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 19) +SET(KWSYS_DATE_STAMP_DAY 20) -- cgit v0.12 From 1ca15f85f10704b382d5459f88d57839b7462c55 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 21 Feb 2011 00:01:05 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 8f4c05f..6392180 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 20) +SET(KWSYS_DATE_STAMP_DAY 21) -- cgit v0.12 From 6a61a8a5383fe7418cdd893c97328a27b86b08da Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 21 Feb 2011 13:30:10 -0500 Subject: Honor module .def files with MinGW tools (#9997) Since commit 024d05ad (Fix use of module .def files for MS tools, 2009-09-29) module .def files work for any platform that sets CMAKE_LINK_DEF_FILE_FLAG correctly. Set it in the Windows-GNU platform information file to enable support with MinGW tools. Also enable the test added by commit 0db2c850 (Test use of module .def files for MS tools, 2009-09-29) for MinGW and MSYS generators. --- Modules/Platform/Windows-GNU.cmake | 1 + Tests/CMakeLists.txt | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 7084b83..8df0bcb 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -43,6 +43,7 @@ endif() set(CMAKE_DL_LIBS "") set(CMAKE_LIBRARY_PATH_FLAG "-L") set(CMAKE_LINK_LIBRARY_FLAG "-l") +set(CMAKE_LINK_DEF_FILE_FLAG "-Wl,") set(CMAKE_LINK_LIBRARY_SUFFIX "") set(CMAKE_CREATE_WIN32_EXE "-mwindows") diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2c11919..5dc35ba 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1082,8 +1082,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ IF(CMAKE_TEST_MSVC) ADD_TEST_MACRO(ForceInclude foo) ADD_TEST_MACRO(PrecompiledHeader foo) + ENDIF() + IF(CMAKE_TEST_MSVC OR + "${CMAKE_TEST_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles") ADD_TEST_MACRO(ModuleDefinition example_exe) - ENDIF(CMAKE_TEST_MSVC) + ENDIF() ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables) -- cgit v0.12 From 73bbef36d03cce70c7a3c29845d545afc67d81b8 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 22 Feb 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 6392180..8d4ad8b 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 21) +SET(KWSYS_DATE_STAMP_DAY 22) -- cgit v0.12 From fabdf7aa323a08f20dcb62ca8002b7b878fa4bea Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Feb 2011 15:56:02 -0500 Subject: libarchive: Remove unused build/windows directory (#11885) The directory contains some files with unclear licensing anyway. --- Utilities/cmlibarchive/build/windows/mvcpp.nt | 117 ----- .../cmlibarchive/build/windows/vc71/libarchive.sln | 23 - .../build/windows/vc71/libarchive.vcproj | 327 -------------- .../cmlibarchive/build/windows/vc80/libarchive.sln | 25 -- .../build/windows/vc80/libarchive.vcproj | 455 ------------------- .../vc80/libarchive_test/libarchive_test.vcproj | 495 --------------------- .../cmlibarchive/build/windows/vc90/libarchive.sln | 25 -- .../build/windows/vc90/libarchive.vcproj | 456 ------------------- .../vc90/libarchive_test/libarchive_test.vcproj | 494 -------------------- Utilities/cmlibarchive/build/windows/wccpp.nt | 107 ----- 10 files changed, 2524 deletions(-) delete mode 100644 Utilities/cmlibarchive/build/windows/mvcpp.nt delete mode 100644 Utilities/cmlibarchive/build/windows/vc71/libarchive.sln delete mode 100644 Utilities/cmlibarchive/build/windows/vc71/libarchive.vcproj delete mode 100644 Utilities/cmlibarchive/build/windows/vc80/libarchive.sln delete mode 100644 Utilities/cmlibarchive/build/windows/vc80/libarchive.vcproj delete mode 100644 Utilities/cmlibarchive/build/windows/vc80/libarchive_test/libarchive_test.vcproj delete mode 100644 Utilities/cmlibarchive/build/windows/vc90/libarchive.sln delete mode 100644 Utilities/cmlibarchive/build/windows/vc90/libarchive.vcproj delete mode 100644 Utilities/cmlibarchive/build/windows/vc90/libarchive_test/libarchive_test.vcproj delete mode 100644 Utilities/cmlibarchive/build/windows/wccpp.nt diff --git a/Utilities/cmlibarchive/build/windows/mvcpp.nt b/Utilities/cmlibarchive/build/windows/mvcpp.nt deleted file mode 100644 index 228fc5d..0000000 --- a/Utilities/cmlibarchive/build/windows/mvcpp.nt +++ /dev/null @@ -1,117 +0,0 @@ -#/* FILE: mvcpp.nt -# * -# * Copyright (c) 2008 -# * TouchNet Information Systems, Inc. -# * All Rights Reserved -# * -# * This program is an unpublished copyright work of TouchNet Information -# * Systems, Inc. of Lenexa, KS. The program, all information disclosed -# * and the matter shown and described hereon or herewith are confidential -# * and proprietary to TouchNet Information Systems, Inc. -# * -# ****************************************************************************** -# * -# * $LastChangedBy: kientzle $ -# * $Locker: $ -# * $ProjectName: $ -# * $ProjectRevision: $ -# * $LastChangedRevision: 29 $ -# * $LastChangedDate: 2008-05-05 18:10:33 -0400 (Mon, 05 May 2008) $ -# * $State$ -# * $RCSfile$ -# * $Source$ -# * -# * Change Log: -# * $Log: $ -# * -# */ - -.SUFFIXES : .c .cpp .obm - -ZLIB_INCL=\3rdParty\ZLib\Current\Include - -EXTRA_DEFINES=/DLIBARCHIVE_STATIC=1 - -!ifdef DEBUG -DEST_PATH=.\lib\mvcpp\debug -OBJ_DIR=obj\debug -COMPILE_FLAG=/MTd /DDEBUG=1 $(EXTRA_DEFINES) /Zi /Fd$(OBJ_DIR)\libarchive.pdb -!else -DEST_PATH=.\lib\mvcpp -OBJ_DIR=obj -COMPILE_FLAG=/MT $(EXTRA_DEFINES) /Fd$(OBJ_DIR)\libarchive.pdb -!endif - -INCLUDE=.;$(MSDEVDIR)\INCLUDE;$(ZLIB_INCL); -INCLUDE_OPTS= - -NT_CPP=cl -NT_C=cl -NT_LIBRARIAN=lib - -### -NT_C_OPTS=$(COMPILE_FLAG) /GX /Zl /Zp1 /nologo /c /G5 /Oi /Ot /TC /DVC_EXTRANLEAN /DWIN32_LEAN_AND_MEAN $(INCLUDE_OPTS) -NT_CPP_OPTS=$(COMPILE_FLAG) /GX /Zl /Zp1 /nologo /c /G5 /Oi /Ot /TP /DVC_EXTRANLEAN /DWIN32_LEAN_AND_MEAN $(INCLUDE_OPTS) -NT_LIB_OPTS= - -.cpp{$(OBJ_DIR)}.obm: - -md $(OBJ_DIR) > nul 2>nul - $(NT_CPP) $(NT_CPP_OPTS) -Fo$*.obm $< - -.c{$(OBJ_DIR)}.obm: - -md $(OBJ_DIR) > nul 2>nul - $(NT_C) $(NT_C_OPTS) -Fo$*.obm $< - - -OBJS=\ - $(OBJ_DIR)\archive_check_magic.obm $(OBJ_DIR)\archive_entry.obm \ - $(OBJ_DIR)\archive_entry_copy_stat.obm $(OBJ_DIR)\archive_entry_link_resolver.obm \ - $(OBJ_DIR)\archive_entry_stat.obm $(OBJ_DIR)\archive_entry_strmode.obm \ - $(OBJ_DIR)\archive_read.obm $(OBJ_DIR)\archive_read_data_into_fd.obm \ - $(OBJ_DIR)\archive_read_extract.obm $(OBJ_DIR)\archive_read_open_fd.obm \ - $(OBJ_DIR)\archive_read_open_file.obm $(OBJ_DIR)\archive_read_open_filename.obm \ - $(OBJ_DIR)\archive_read_open_memory.obm $(OBJ_DIR)\archive_read_support_compression_all.obm \ - $(OBJ_DIR)\archive_read_support_compression_bzip2.obm \ - $(OBJ_DIR)\archive_read_support_compression_compress.obm \ - $(OBJ_DIR)\archive_read_support_compression_gzip.obm \ - $(OBJ_DIR)\archive_read_support_compression_none.obm \ - $(OBJ_DIR)\archive_read_support_compression_program.obm \ - $(OBJ_DIR)\archive_read_support_format_all.obm \ - $(OBJ_DIR)\archive_read_support_format_ar.obm \ - $(OBJ_DIR)\archive_read_support_format_cpio.obm \ - $(OBJ_DIR)\archive_read_support_format_empty.obm \ - $(OBJ_DIR)\archive_read_support_format_iso9660.obm \ - $(OBJ_DIR)\archive_read_support_format_mtree.obm \ - $(OBJ_DIR)\archive_read_support_format_tar.obm \ - $(OBJ_DIR)\archive_read_support_format_zip.obm \ - $(OBJ_DIR)\archive_string.obm $(OBJ_DIR)\archive_string_sprintf.obm \ - $(OBJ_DIR)\archive_util.obm $(OBJ_DIR)\archive_virtual.obm \ - $(OBJ_DIR)\archive_write.obm $(OBJ_DIR)\archive_write_disk.obm \ - $(OBJ_DIR)\archive_write_disk_set_standard_lookup.obm \ - $(OBJ_DIR)\archive_write_open_fd.obm $(OBJ_DIR)\archive_write_open_file.obm \ - $(OBJ_DIR)\archive_write_open_filename.obm $(OBJ_DIR)\archive_write_open_memory.obm \ - $(OBJ_DIR)\archive_write_set_compression_bzip2.obm $(OBJ_DIR)\archive_write_set_compression_compress.obm \ - $(OBJ_DIR)\archive_write_set_compression_gzip.obm $(OBJ_DIR)\archive_write_set_compression_none.obm \ - $(OBJ_DIR)\archive_write_set_compression_program.obm $(OBJ_DIR)\archive_write_set_format.obm \ - $(OBJ_DIR)\archive_write_set_format_ar.obm $(OBJ_DIR)\archive_write_set_format_by_name.obm \ - $(OBJ_DIR)\archive_write_set_format_cpio.obm $(OBJ_DIR)\archive_write_set_format_cpio_newc.obm \ - $(OBJ_DIR)\archive_write_set_format_pax.obm $(OBJ_DIR)\archive_write_set_format_shar.obm \ - $(OBJ_DIR)\archive_write_set_format_ustar.obm $(OBJ_DIR)\filter_fork.obm \ - $(OBJ_DIR)\libarchive-nonposix.obm - -all: CLEAN $(DEST_PATH)\libarchive.lib - -$(DEST_PATH)\libarchive.lib :: $(OBJS) $(DEST_PATH) - -$(DEST_PATH)\libarchive.lib :: - $(NT_LIBRARIAN) $(NT_LIB_OPTS) /OUT:$(DEST_PATH)\libarchive.lib $(OBJS) - -$(DEST_PATH): - -md $(DEST_PATH) > nul 2>nul - -CLEAN: -!ifdef CLEAN - -del $(OBJ_DIR)\*.pd? > nul 2>nul - -ren $(OBJ_DIR)\*.pdb *.pd1 > nul 2>nul - -ren $(OBJ_DIR)\*.pdb *.pd2 > nul 2>nul -!endif diff --git a/Utilities/cmlibarchive/build/windows/vc71/libarchive.sln b/Utilities/cmlibarchive/build/windows/vc71/libarchive.sln deleted file mode 100644 index 962c497..0000000 --- a/Utilities/cmlibarchive/build/windows/vc71/libarchive.sln +++ /dev/null @@ -1,23 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive", "libarchive.vcproj", "{0C758FDB-BE1D-47E9-8E18-9168AB34A308}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug.ActiveCfg = Debug|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug.Build.0 = Debug|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release.ActiveCfg = Release|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/Utilities/cmlibarchive/build/windows/vc71/libarchive.vcproj b/Utilities/cmlibarchive/build/windows/vc71/libarchive.vcproj deleted file mode 100644 index e09b896..0000000 --- a/Utilities/cmlibarchive/build/windows/vc71/libarchive.vcproj +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Utilities/cmlibarchive/build/windows/vc80/libarchive.sln b/Utilities/cmlibarchive/build/windows/vc80/libarchive.sln deleted file mode 100644 index d6ee3c5..0000000 --- a/Utilities/cmlibarchive/build/windows/vc80/libarchive.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive", "libarchive.vcproj", "{0C758FDB-BE1D-47E9-8E18-9168AB34A308}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive_test", "libarchive_test\libarchive_test.vcproj", "{407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug|Win32.ActiveCfg = Debug|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug|Win32.Build.0 = Debug|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release|Win32.ActiveCfg = Release|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release|Win32.Build.0 = Release|Win32 - {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Debug|Win32.ActiveCfg = Debug|Win32 - {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Debug|Win32.Build.0 = Debug|Win32 - {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Release|Win32.ActiveCfg = Release|Win32 - {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Utilities/cmlibarchive/build/windows/vc80/libarchive.vcproj b/Utilities/cmlibarchive/build/windows/vc80/libarchive.vcproj deleted file mode 100644 index 444de6d..0000000 --- a/Utilities/cmlibarchive/build/windows/vc80/libarchive.vcproj +++ /dev/null @@ -1,455 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Utilities/cmlibarchive/build/windows/vc80/libarchive_test/libarchive_test.vcproj b/Utilities/cmlibarchive/build/windows/vc80/libarchive_test/libarchive_test.vcproj deleted file mode 100644 index e1058fd..0000000 --- a/Utilities/cmlibarchive/build/windows/vc80/libarchive_test/libarchive_test.vcproj +++ /dev/null @@ -1,495 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Utilities/cmlibarchive/build/windows/vc90/libarchive.sln b/Utilities/cmlibarchive/build/windows/vc90/libarchive.sln deleted file mode 100644 index 1ddfc98..0000000 --- a/Utilities/cmlibarchive/build/windows/vc90/libarchive.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive", "libarchive.vcproj", "{0C758FDB-BE1D-47E9-8E18-9168AB34A308}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libarchive_test", "libarchive_test\libarchive_test.vcproj", "{407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug|Win32.ActiveCfg = Debug|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Debug|Win32.Build.0 = Debug|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release|Win32.ActiveCfg = Release|Win32 - {0C758FDB-BE1D-47E9-8E18-9168AB34A308}.Release|Win32.Build.0 = Release|Win32 - {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Debug|Win32.ActiveCfg = Debug|Win32 - {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Debug|Win32.Build.0 = Debug|Win32 - {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Release|Win32.ActiveCfg = Release|Win32 - {407CA0B9-0CCB-4F02-A20B-CBBAEAAA2E4B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Utilities/cmlibarchive/build/windows/vc90/libarchive.vcproj b/Utilities/cmlibarchive/build/windows/vc90/libarchive.vcproj deleted file mode 100644 index 0946b71..0000000 --- a/Utilities/cmlibarchive/build/windows/vc90/libarchive.vcproj +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Utilities/cmlibarchive/build/windows/vc90/libarchive_test/libarchive_test.vcproj b/Utilities/cmlibarchive/build/windows/vc90/libarchive_test/libarchive_test.vcproj deleted file mode 100644 index 7fc3271..0000000 --- a/Utilities/cmlibarchive/build/windows/vc90/libarchive_test/libarchive_test.vcproj +++ /dev/null @@ -1,494 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Utilities/cmlibarchive/build/windows/wccpp.nt b/Utilities/cmlibarchive/build/windows/wccpp.nt deleted file mode 100644 index 2c6c730..0000000 --- a/Utilities/cmlibarchive/build/windows/wccpp.nt +++ /dev/null @@ -1,107 +0,0 @@ -#/* FILE: wccpp.nt -# * -# * Copyright (c) 2008 -# * TouchNet Information Systems, Inc. -# * All Rights Reserved -# * -# * This program is an unpublished copyright work of TouchNet Information -# * Systems, Inc. of Lenexa, KS. The program, all information disclosed -# * and the matter shown and described hereon or herewith are confidential -# * and proprietary to TouchNet Information Systems, Inc. -# * -# ****************************************************************************** -# * -# * $LastChangedBy: kientzle $ -# * $Locker: $ -# * $ProjectName: $ -# * $ProjectRevision: $ -# * $LastChangedRevision: 29 $ -# * $LastChangedDate: 2008-05-05 18:10:33 -0400 (Mon, 05 May 2008) $ -# * $State$ -# * $RCSfile$ -# * $Source$ -# * -# * Change Log: -# * $Log: $ -# * -# */ - -.EXTENSIONS: -.EXTENSIONS: .obn .cpp .c - -ZLIB_INCL=\3rdParty\ZLib\Current\Include - -!ifdef DEBUG -DEST_PATH=.\lib\wccpp\debug -OBJ_DIR=obj\debug -EXT_COMPILE_FLAG=-d2 -DLIBARCHIVE_STATIC=1 -!else -DEST_PATH=.\lib\wccpp -OBJ_DIR=obj -EXT_COMPILE_FLAG=-DLIBARCHIVE_STATIC=1 -!endif - -# ----- NT compiler options ----------------------------------------------- -NT_CPP=wpp386 -NT_C=wcc386 -NT_LIBRARIAN=wlib - - -### -INCLUDE_OPTS=/I.;$(%watcom)\h;$(%watcom)\h\nt;$(ZLIB_INCL); -NT_CPP_OPTS=-ei -wx -xs -xss -xst -od -of+ -zp1 -5 -bt=nt -bm $(EXT_COMPILE_FLAG) $(INCLUDE_OPTS) -DWIN32_LEAN_AND_MEAN -NT_C_OPTS=-ei -wx -od -of+ -zp1 -5 -bt=nt -bm $(EXT_COMPILE_FLAG) $(INCLUDE_OPTS) -DWIN32_LEAN_AND_MEAN -NT_LIB_OPTS= - -.cpp{$(OBJ_DIR)}.obn: - -md $(OBJ_DIR) > nul 2>nul - $(NT_CPP) $(NT_CPP_OPTS) -zp1 -fo=$*.obn $< - -.c{$(OBJ_DIR)}.obn: - -md $(OBJ_DIR) > nul 2>nul - $(NT_C) $(NT_C_OPTS) -zp1 -fo=$*.obn $< - -OBJS = & - $(OBJ_DIR)\archive_check_magic.obn $(OBJ_DIR)\archive_entry.obn & - $(OBJ_DIR)\archive_entry_copy_stat.obn $(OBJ_DIR)\archive_entry_link_resolver.obn & - $(OBJ_DIR)\archive_entry_stat.obn $(OBJ_DIR)\archive_entry_strmode.obn & - $(OBJ_DIR)\archive_read.obn $(OBJ_DIR)\archive_read_data_into_fd.obn & - $(OBJ_DIR)\archive_read_extract.obn $(OBJ_DIR)\archive_read_open_fd.obn & - $(OBJ_DIR)\archive_read_open_file.obn $(OBJ_DIR)\archive_read_open_filename.obn & - $(OBJ_DIR)\archive_read_open_memory.obn $(OBJ_DIR)\archive_read_support_compression_all.obn & - $(OBJ_DIR)\archive_read_support_compression_bzip2.obn & - $(OBJ_DIR)\archive_read_support_compression_compress.obn & - $(OBJ_DIR)\archive_read_support_compression_gzip.obn & - $(OBJ_DIR)\archive_read_support_compression_none.obn & - $(OBJ_DIR)\archive_read_support_compression_program.obn & - $(OBJ_DIR)\archive_read_support_format_all.obn & - $(OBJ_DIR)\archive_read_support_format_ar.obn & - $(OBJ_DIR)\archive_read_support_format_cpio.obn & - $(OBJ_DIR)\archive_read_support_format_empty.obn & - $(OBJ_DIR)\archive_read_support_format_iso9660.obn & - $(OBJ_DIR)\archive_read_support_format_mtree.obn & - $(OBJ_DIR)\archive_read_support_format_tar.obn & - $(OBJ_DIR)\archive_read_support_format_zip.obn & - $(OBJ_DIR)\archive_string.obn $(OBJ_DIR)\archive_string_sprintf.obn & - $(OBJ_DIR)\archive_util.obn $(OBJ_DIR)\archive_virtual.obn & - $(OBJ_DIR)\archive_write.obn $(OBJ_DIR)\archive_write_disk.obn & - $(OBJ_DIR)\archive_write_disk_set_standard_lookup.obn & - $(OBJ_DIR)\archive_write_open_fd.obn $(OBJ_DIR)\archive_write_open_file.obn & - $(OBJ_DIR)\archive_write_open_filename.obn $(OBJ_DIR)\archive_write_open_memory.obn & - $(OBJ_DIR)\archive_write_set_compression_bzip2.obn $(OBJ_DIR)\archive_write_set_compression_compress.obn & - $(OBJ_DIR)\archive_write_set_compression_gzip.obn $(OBJ_DIR)\archive_write_set_compression_none.obn & - $(OBJ_DIR)\archive_write_set_compression_program.obn $(OBJ_DIR)\archive_write_set_format.obn & - $(OBJ_DIR)\archive_write_set_format_ar.obn $(OBJ_DIR)\archive_write_set_format_by_name.obn & - $(OBJ_DIR)\archive_write_set_format_cpio.obn $(OBJ_DIR)\archive_write_set_format_cpio_newc.obn & - $(OBJ_DIR)\archive_write_set_format_pax.obn $(OBJ_DIR)\archive_write_set_format_shar.obn & - $(OBJ_DIR)\archive_write_set_format_ustar.obn $(OBJ_DIR)\filter_fork.obn & - $(OBJ_DIR)\libarchive-nonposix.obn - -$(DEST_PATH)\LibArchive.lib :: $(OBJS) $(DEST_PATH) - -$(DEST_PATH)\LibArchive.lib :: - -md $(DEST_PATH) > nul 2>nul - $(NT_LIBRARIAN) $@ -+ $(OBJS) - -$(DEST_PATH): - -md $(DEST_PATH) > nul 2>nul -- cgit v0.12 From 8c450f6287e45fa737de7d09a4f29ee7f4fdc9dd Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Tue, 22 Feb 2011 22:56:26 +0100 Subject: CPack remove "-ALL" suffix for ALL-IN-ONE packages First part fix of feature request 11814 --- Source/CPack/cmCPackArchiveGenerator.cxx | 2 +- Source/CPack/cmCPackRPMGenerator.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index febf205..ff88412 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -177,7 +177,7 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponent) packageFileNames.push_back(std::string(toplevel)); packageFileNames[0] += "/" +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) - +"-ALL" + this->GetOutputExtension(); + + this->GetOutputExtension(); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging all groups in one package..." "(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE is set)" diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 2d675c1..995adf6 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -158,7 +158,7 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(bool allComponent) ); std::string outputFileName( std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) - +"-ALL"+ this->GetOutputExtension() + + this->GetOutputExtension() ); // all GROUP in one vs all COMPONENT in one localToplevel += "/"+compInstDirName; -- cgit v0.12 From 7c5e412c4aa65557c1d59881447d368405801c40 Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Tue, 22 Feb 2011 17:24:22 -0500 Subject: Documentation: Fix a few typos (#11883) W: cmake: manpage-has-errors-from-man usr/share/man/man1/cmake.1.gz 10029: warning [p 158, 13.5i]: can't break line I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz informations information I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz dependant dependent I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz prefered preferred I: cmake: spelling-error-in-binary ./usr/bin/cmake prefered preferred I: cmake: spelling-error-in-binary ./usr/bin/cpack prefered preferred I: cmake: spelling-error-in-binary ./usr/bin/ctest prefered preferred I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakepolicies.1.gz prefered preferred I: cmake-curses-gui: spelling-error-in-binary ./usr/bin/ccmake prefered preferred I: cmake-qt-gui: spelling-error-in-binary ./usr/bin/cmake-gui prefered preferred --- Modules/CPackDeb.cmake | 2 +- Modules/FindPostgreSQL.cmake | 4 +--- Modules/UsewxWidgets.cmake | 2 +- Source/cmPolicies.cxx | 2 +- Source/cmTarget.h | 2 +- Utilities/cmcurl/easy.c | 2 +- Utilities/cmcurl/setup.h | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 98d40d6..6c3398e 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -60,7 +60,7 @@ # CPACK_DEBIAN_PACKAGE_DEBUG # Mandatory : NO # Default : - -# May be set when invoking cpack in order to trace debug informations +# May be set when invoking cpack in order to trace debug information # during CPackDeb run. # CPACK_DEBIAN_PACKAGE_PREDEPENDS # Mandatory : NO diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 6455c99..96b6741 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -1,6 +1,4 @@ -# Find the PostgreSQL installation. -# -# ---------------------------------------------------------------------------- +# - Find the PostgreSQL installation. # Usage: # In your CMakeLists.txt file do something like this: # ... diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index 9ecfff0..a0f2e86 100644 --- a/Modules/UsewxWidgets.cmake +++ b/Modules/UsewxWidgets.cmake @@ -6,7 +6,7 @@ # # Note that for MinGW users the order of libs is important! # FIND_PACKAGE(wxWidgets REQUIRED net gl core base) # INCLUDE(${wxWidgets_USE_FILE}) -# # and for each of your dependant executable/library targets: +# # and for each of your dependent executable/library targets: # TARGET_LINK_LIBRARIES( ${wxWidgets_LIBRARIES}) # # DEPRECATED diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 2d1f792..37070b6 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -453,7 +453,7 @@ cmPolicies::cmPolicies() "Starting with CMake 2.8.4, if a cmake-module shipped with CMake (i.e. " "located in the CMake module directory) calls include() or " "find_package(), the files located in the the CMake module directory are " - "prefered over the files in CMAKE_MODULE_PATH. " + "preferred over the files in CMAKE_MODULE_PATH. " "This makes sure that the modules belonging to " "CMake always get those files included which they expect, and against " "which they were developed and tested. " diff --git a/Source/cmTarget.h b/Source/cmTarget.h index b0e20ba..3b1f016 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -326,7 +326,7 @@ public: */ bool FindSourceFiles(); - ///! Return the prefered linker language for this target + ///! Return the preferred linker language for this target const char* GetLinkerLanguage(const char* config = 0); ///! Return the rule variable used to create this type of target, diff --git a/Utilities/cmcurl/easy.c b/Utilities/cmcurl/easy.c index f3c2273..209d1c3 100644 --- a/Utilities/cmcurl/easy.c +++ b/Utilities/cmcurl/easy.c @@ -708,7 +708,7 @@ void curl_easy_reset(CURL *curl) data->set.ssl.verifypeer = TRUE; data->set.ssl.verifyhost = 2; #ifdef CURL_CA_BUNDLE - /* This is our prefered CA cert bundle since install time */ + /* This is our preferred CA cert bundle since install time */ data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE; #endif diff --git a/Utilities/cmcurl/setup.h b/Utilities/cmcurl/setup.h index e302f35..5ae881f 100644 --- a/Utilities/cmcurl/setup.h +++ b/Utilities/cmcurl/setup.h @@ -155,7 +155,7 @@ typedef unsigned char bool; #define SIZEOF_CURL_OFF_T 4 #endif -/* We set up our internal prefered (CURL_)FORMAT_OFF_T here */ +/* We set up our internal preferred (CURL_)FORMAT_OFF_T here */ #if SIZEOF_CURL_OFF_T > 4 #define FORMAT_OFF_T "lld" #else -- cgit v0.12 From 4deb308e82b8f9e56ce41eba211f330ff66902a3 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Tue, 22 Feb 2011 23:49:49 +0100 Subject: CPack Authorize DISPLAY_NAME usage in component package Second (last) part fix of feature request #11814 --- Source/CPack/cmCPackArchiveGenerator.cxx | 16 ++++++++----- Source/CPack/cmCPackGenerator.cxx | 41 ++++++++++++++++++++++++++++++++ Source/CPack/cmCPackGenerator.h | 13 ++++++++++ Source/CPack/cmCPackRPMGenerator.cxx | 13 ++++++---- 4 files changed, 72 insertions(+), 11 deletions(-) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index ff88412..3c670a1 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -121,9 +121,11 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup) << std::endl); // Begin the archive for this group std::string packageFileName= std::string(toplevel); - packageFileName += "/" - +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) - +"-"+compGIt->first + this->GetOutputExtension(); + packageFileName += "/"+ + GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"), + compGIt->first, + true) + + this->GetOutputExtension(); // open a block in order to automatically close archive // at the end of the block { @@ -154,9 +156,11 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup) std::string packageFileName = std::string(toplevel); localToplevel += "/"+ compIt->first; - packageFileName += "/" - +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) - +"-"+compIt->first + this->GetOutputExtension(); + packageFileName += "/"+ + GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"), + compIt->first, + false) + + this->GetOutputExtension(); { DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive); // Add the files of this component to the archive diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 69d9b8c..4cb4f36 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1309,10 +1309,51 @@ int cmCPackGenerator::PrepareGroupingKind() return 1; } +//---------------------------------------------------------------------- std::string cmCPackGenerator::GetComponentInstallDirNameSuffix( const std::string& componentName) { return componentName; } +//---------------------------------------------------------------------- +std::string cmCPackGenerator::GetComponentPackageFileName( + const std::string& initialPackageFileName, + const std::string& groupOrComponentName, + bool isGroupName) { + + /* + * the default behavior is to use the + * component [group] name as a suffix + */ + std::string suffix="-"+groupOrComponentName; + /* check if we should use DISPLAY name */ + std::string dispNameVar = "CPACK_"+Name+"_USE_DISPLAY_NAME_IN_FILENAME"; + if (IsOn(dispNameVar.c_str())) + { + /* the component Group case */ + if (isGroupName) + { + std::string groupDispVar = "CPACK_COMPONENT_GROUP_" + + cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME"; + const char* groupDispName = GetOption(groupDispVar.c_str()); + if (groupDispName) + { + suffix = "-"+std::string(groupDispName); + } + } + /* the [single] component case */ + else + { + std::string dispVar = "CPACK_COMPONENT_" + + cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME"; + const char* dispName = GetOption(dispVar.c_str()); + if(dispName) + { + suffix = "-"+std::string(dispName); + } + } + } + return initialPackageFileName + suffix; +} //---------------------------------------------------------------------- bool cmCPackGenerator::SupportsComponentInstallation() const diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index d4b1b16..0497d1c 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -145,6 +145,19 @@ protected: const std::string& componentName); /** + * CPack specific generator may mangle CPACK_PACKAGE_FILE_NAME + * with CPACK_COMPONENT_xxxx__DISPLAY_NAME if + * CPACK__USE_DISPLAY_NAME_IN_FILENAME is ON. + * @param[in] initialPackageFileName + * @param[in] groupOrComponentName + * @param[in] isGroupName + */ + virtual std::string GetComponentPackageFileName( + const std::string& initialPackageFileName, + const std::string& groupOrComponentName, + bool isGroupName); + + /** * Package the list of files and/or components which * has been prepared by the beginning of DoPackage. * @pre @ref toplevel has been filled-in diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 995adf6..5803959 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -60,8 +60,10 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) cmSystemTools::GetParentDirectory(toplevel.c_str()) ); std::string outputFileName( - std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) - +"-"+compGIt->first + this->GetOutputExtension() + GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"), + compGIt->first, + true) + + this->GetOutputExtension() ); localToplevel += "/"+ compGIt->first; @@ -98,9 +100,10 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup) cmSystemTools::GetParentDirectory(toplevel.c_str()) ); std::string outputFileName( - std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME") - ) - +"-"+compIt->first + this->GetOutputExtension()); + GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"), + compIt->first, + false) + + this->GetOutputExtension()); localToplevel += "/"+ compIt->first; /* replace the TEMP DIRECTORY with the component one */ -- cgit v0.12 From fe449843b7648489fe9fca2ddde231e5e01050ec Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 23 Feb 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 8d4ad8b..22783ed 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 22) +SET(KWSYS_DATE_STAMP_DAY 23) -- cgit v0.12 From 761621645c8605252eea9d3a0d171edc46a529c5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Feb 2011 10:56:32 -0500 Subject: Pass .def files directly to MinGW tools (#9997) Commit 6a61a8a5 (Honor module .def files with MinGW tools, 2011-02-21) set CMAKE_LINK_DEF_FILE_FLAG to "-Wl," to enable passing .def files to the linker on MinGW. However, older GNU tools in the MSYS shell do not know how to translate "-Wl,/c/..." to "c:/..." and complain that the file does not exist. Instead set the flag to just "" which tells CMake it can pass the file through the front-end with no special flag. --- Modules/Platform/Windows-GNU.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 8df0bcb..72b5d62 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -43,7 +43,7 @@ endif() set(CMAKE_DL_LIBS "") set(CMAKE_LIBRARY_PATH_FLAG "-L") set(CMAKE_LINK_LIBRARY_FLAG "-l") -set(CMAKE_LINK_DEF_FILE_FLAG "-Wl,") +set(CMAKE_LINK_DEF_FILE_FLAG "") # Empty string: passing the file is enough set(CMAKE_LINK_LIBRARY_SUFFIX "") set(CMAKE_CREATE_WIN32_EXE "-mwindows") -- cgit v0.12 From 6c4b2492728cd3fab60bf11feafe3361f02c08c9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Feb 2011 10:34:28 -0500 Subject: Fix Fortran test .def file symbol mangling Commit 6a61a8a5 (Honor module .def files with MinGW tools, 2011-02-21) enabled use of .def files with GNU tools on Windows. Previously the Fortran tests's world.def file was used only for the Intel Fortran Compiler on Windows and contained the symbol name mangled for that compiler. Instead choose a .def file that names the symbol with proper mangling for the compiler in use. --- Tests/Fortran/CMakeLists.txt | 13 ++++++++++++- Tests/Fortran/world.def | 2 -- Tests/Fortran/world_gnu.def | 2 ++ Tests/Fortran/world_icl.def | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) delete mode 100644 Tests/Fortran/world.def create mode 100644 Tests/Fortran/world_gnu.def create mode 100644 Tests/Fortran/world_icl.def diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 04563ef..c68d543 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -22,8 +22,19 @@ elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU") endif() endif() +# Pick a module .def file with the properly mangled symbol name. +set(world_def "") +if(WIN32 AND NOT CYGWIN) + if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + set(world_def world_gnu.def) + elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel" OR + "${CMAKE_GENERATOR}" MATCHES "Visual Studio") # Intel plugin + set(world_def world_icl.def) + endif() +endif() + add_library(hello STATIC hello.f) -add_library(world ${_SHARED} world.f world.def) +add_library(world ${_SHARED} world.f ${world_def}) add_executable(testf testf.f) target_link_libraries(testf hello world) diff --git a/Tests/Fortran/world.def b/Tests/Fortran/world.def deleted file mode 100644 index ead7710..0000000 --- a/Tests/Fortran/world.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS - WORLD diff --git a/Tests/Fortran/world_gnu.def b/Tests/Fortran/world_gnu.def new file mode 100644 index 0000000..1617798 --- /dev/null +++ b/Tests/Fortran/world_gnu.def @@ -0,0 +1,2 @@ +EXPORTS + world_ diff --git a/Tests/Fortran/world_icl.def b/Tests/Fortran/world_icl.def new file mode 100644 index 0000000..ead7710 --- /dev/null +++ b/Tests/Fortran/world_icl.def @@ -0,0 +1,2 @@ +EXPORTS + WORLD -- cgit v0.12 From f2ab270e6f0f1c95fe134a7b9b1ad4037d0ef0fe Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Thu, 24 Feb 2011 00:29:25 +0100 Subject: CPack fix KWStyle warning --- Source/CPack/cmCPackGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 4cb4f36..86200c1 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1344,7 +1344,7 @@ std::string cmCPackGenerator::GetComponentPackageFileName( else { std::string dispVar = "CPACK_COMPONENT_" - + cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME"; + + cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME"; const char* dispName = GetOption(dispVar.c_str()); if(dispName) { -- cgit v0.12 From 3fb89cf8bdae9b534dddb45b786903de4c9ac7aa Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Thu, 24 Feb 2011 00:43:29 +0100 Subject: CPack remove previously CPack generated files (if any) before running CPack --- .../RunCPackVerifyResult.cmake | 31 ++++++++++++++-------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index d5137bd..45a3b17 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -32,17 +32,6 @@ if(config_type) set(config_args -C ${config_type}) endif() message(" ${config_args}") -execute_process(COMMAND ${CPackCommand} -G ${CPackGen} ${config_args} - RESULT_VARIABLE CPack_result - OUTPUT_VARIABLE CPack_output - ERROR_VARIABLE CPack_error - WORKING_DIRECTORY ${CPackComponentsForAll_BINARY_DIR}) - -if (CPack_result) - message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}") -else (CPack_result) - message(STATUS "CPack_output=${CPack_output}") -endif(CPack_result) if(CPackGen MATCHES "ZIP") set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.zip") @@ -63,6 +52,26 @@ if(CPackGen MATCHES "ZIP") endif (${CPackComponentWay} STREQUAL "AllGroupsInOne") endif(CPackGen MATCHES "ZIP") +# clean-up previously CPack generated files +if(expected_file_mask) + file(GLOB expected_file "${expected_file_mask}") + if (expected_file) + file(REMOVE ${expected_file}) + endif(expected_file) +endif(expected_file_mask) + +execute_process(COMMAND ${CPackCommand} -G ${CPackGen} ${config_args} + RESULT_VARIABLE CPack_result + OUTPUT_VARIABLE CPack_output + ERROR_VARIABLE CPack_error + WORKING_DIRECTORY ${CPackComponentsForAll_BINARY_DIR}) + +if (CPack_result) + message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}") +else (CPack_result) + message(STATUS "CPack_output=${CPack_output}") +endif(CPack_result) + # Now verify if the number of expected file is OK # - using expected_file_mask and # - expected_count -- cgit v0.12 From 6b9bc54566544e0b1e4687d88d51424cb335114b Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Wed, 23 Feb 2011 17:13:49 -0700 Subject: Fix regression in 43cb9b8. Put back some code for setting the QT_VERSION_* variables that wasn't supposed to be removed. --- Modules/FindQt4.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 2c3ba6e..b2a89f7 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1119,6 +1119,11 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake") + # set version variables + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}") + ENDIF(QT_QMAKE_EXECUTABLE AND QTVERSION) #support old QT_MIN_VERSION if set, but not if version is supplied by find_package() -- cgit v0.12 From a9841e6e9aae1f2df0e3d94031dc3816c269d4b5 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 24 Feb 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 22783ed..2d9315c 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 23) +SET(KWSYS_DATE_STAMP_DAY 24) -- cgit v0.12 From c3e452e944f915975d13d89023cd43ed3dba5221 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Feb 2011 15:14:08 -0500 Subject: Require at least CMake 2.6.3 to build current CMake Remove some cruft left for supporting builds with CMake 2.4. --- CMakeLists.txt | 17 ++--------------- Source/cmFileCommand.cxx | 30 +++++++----------------------- Utilities/cmcurl/CMakeLists.txt | 8 +------- Utilities/cmlibarchive/CMakeLists.txt | 2 +- 4 files changed, 11 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23525c4..7b0f6b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ #============================================================================= # CMake - Cross Platform Makefile Generator -# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -9,12 +9,9 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required PROJECT(CMake) -IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) IF(CMAKE_BOOTSTRAP) # Running from bootstrap script. Set local variable and remove from cache. @@ -24,18 +21,8 @@ ENDIF() MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY) -# Allow empty endif() and such with CMake 2.4. -SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1) - SET(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin) -IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) - # Since the built CMake will install itself instead of the - # generating CMake, tell it that the install rules were generated - # by CMake 2.4. - INSTALL(CODE "SET(CMAKE_INSTALL_SELF_2_4 1)") -ENDIF() - IF("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") # Disallow architecture-specific try_run. It may not run on the host. MACRO(TRY_RUN) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 37fced2..131661d 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1707,7 +1707,7 @@ protected: { DoingType = DoingLast1, DoingRename, - DoingSelf24 + DoingLast2 }; virtual bool CheckKeyword(std::string const& arg); virtual bool CheckValue(std::string const& arg); @@ -1846,22 +1846,12 @@ bool cmFileInstaller::CheckKeyword(std::string const& arg) else if(arg == "COMPONENTS" || arg == "CONFIGURATIONS" || arg == "PROPERTIES") { - if(this->Makefile->IsOn("CMAKE_INSTALL_SELF_2_4")) - { - // When CMake 2.4 builds this CMake version we need to support - // the install scripts it generates since it asks this CMake - // to install itself using the rules it generated. - this->Doing = DoingSelf24; - } - else - { - cmOStringStream e; - e << "INSTALL called with old-style " << arg << " argument. " - << "This script was generated with an older version of CMake. " - << "Re-run this cmake version on your build tree."; - this->FileCommand->SetError(e.str().c_str()); - this->Doing = DoingError; - } + cmOStringStream e; + e << "INSTALL called with old-style " << arg << " argument. " + << "This script was generated with an older version of CMake. " + << "Re-run this cmake version on your build tree."; + this->FileCommand->SetError(e.str().c_str()); + this->Doing = DoingError; } else { @@ -1884,12 +1874,6 @@ bool cmFileInstaller::CheckValue(std::string const& arg) case DoingRename: this->Rename = arg; break; - case DoingSelf24: - // Ignore these arguments for compatibility. This should be - // reached only when CMake 2.4 is installing the current - // CMake. It can be removed when CMake 2.6 or higher is - // required to build CMake. - break; default: return this->cmFileCopier::CheckValue(arg); } diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 454d2d1..7030b2e 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -1,10 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.4) -IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) -IF(CMAKE_OSX_ARCHITECTURES) - CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) -ENDIF(CMAKE_OSX_ARCHITECTURES) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) PROJECT(LIBCURL C) # Setup package meta-data diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index 08cda1e..0b9380f 100644 --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt @@ -1,8 +1,8 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) # # PROJECT(libarchive C) # -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.1) SET(CMAKE_MODULE_PATH "${libarchive_SOURCE_DIR}/build/cmake") # We use CHECK_TYPE_SIZE for existence tests, so use only one arch. -- cgit v0.12 From aa1ab6441b7f7d6bcf60e865bb66f292e033c0aa Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 25 Feb 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 2d9315c..43cd001 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 24) +SET(KWSYS_DATE_STAMP_DAY 25) -- cgit v0.12 From 5b4cbdb45e1f0efb2c55b29a4ca2521f38e88f96 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Fri, 25 Feb 2011 16:47:11 +0100 Subject: CPackRPM Replace space in some CPACK_ vars (Fix bug 9932) --- Source/CPack/cmCPackRPMGenerator.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 2d675c1..cc50580 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -31,6 +31,21 @@ int cmCPackRPMGenerator::InitializeInternal() { this->SetOption("CPACK_SET_DESTDIR", "I_ON"); } + /* Replace space in CPACK_PACKAGE_NAME in order to avoid + * rpmbuild scream on unwanted space in filename issue + * Moreover RPM file do not usually embed space in filename + */ + if (this->GetOption("CPACK_PACKAGE_NAME")) { + std::string packageName=this->GetOption("CPACK_PACKAGE_NAME"); + cmSystemTools::ReplaceString(packageName," ","-"); + this->SetOption("CPACK_PACKAGE_NAME",packageName.c_str()); + } + /* same for CPACK_PACKAGE_FILE_NAME */ + if (this->GetOption("CPACK_PACKAGE_FILE_NAME")) { + std::string packageName=this->GetOption("CPACK_PACKAGE_FILE_NAME"); + cmSystemTools::ReplaceString(packageName," ","-"); + this->SetOption("CPACK_PACKAGE_FILE_NAME",packageName.c_str()); + } return this->Superclass::InitializeInternal(); } -- cgit v0.12 From 963bebcc174411e1087af31cc5054422b0080e76 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 23 Feb 2011 13:53:53 -0500 Subject: Implement file(UPLOAD (#11286) Including documentation and testing, of course. --- Source/cmFileCommand.cxx | 417 +++++++++++++++++++++++-------- Source/cmFileCommand.h | 15 ++ Tests/CMakeTests/CMakeLists.txt | 2 + Tests/CMakeTests/FileTest.cmake.in | 2 +- Tests/CMakeTests/FileTestScript.cmake | 20 ++ Tests/CMakeTests/FileUploadTest.cmake.in | 49 ++++ 6 files changed, 393 insertions(+), 112 deletions(-) create mode 100644 Tests/CMakeTests/FileUploadTest.cmake.in diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 37fced2..8849a47 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -75,6 +75,10 @@ bool cmFileCommand { return this->HandleDownloadCommand(args); } + else if ( subCommand == "UPLOAD" ) + { + return this->HandleUploadCommand(args); + } else if ( subCommand == "READ" ) { return this->HandleReadCommand(args); @@ -2432,53 +2436,66 @@ bool cmFileCommand::HandleCMakePathCommand(std::vector this->Makefile->AddDefinition(var, value.c_str()); return true; } + + #if defined(CMAKE_BUILD_WITH_CMAKE) -// Stuff for curl download +// Stuff for curl download/upload typedef std::vector cmFileCommandVectorOfChar; -namespace{ + +namespace { + size_t - cmFileCommandWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, - void *data) - { + cmWriteToFileCallback(void *ptr, size_t size, size_t nmemb, + void *data) + { register int realsize = (int)(size * nmemb); std::ofstream* fout = static_cast(data); const char* chPtr = static_cast(ptr); fout->write(chPtr, realsize); return realsize; - } + } + + + size_t + cmWriteToMemoryCallback(void *ptr, size_t size, size_t nmemb, + void *data) + { + register int realsize = (int)(size * nmemb); + cmFileCommandVectorOfChar *vec + = static_cast(data); + const char* chPtr = static_cast(ptr); + vec->insert(vec->end(), chPtr, chPtr + realsize); + return realsize; + } static size_t cmFileCommandCurlDebugCallback(CURL *, curl_infotype, char *chPtr, - size_t size, void *data) - { + size_t size, void *data) + { cmFileCommandVectorOfChar *vec = static_cast(data); vec->insert(vec->end(), chPtr, chPtr + size); - return size; - } + } class cURLProgressHelper { public: - cURLProgressHelper(cmFileCommand *fc) + cURLProgressHelper(cmFileCommand *fc, const char *text) { this->CurrentPercentage = -1; this->FileCommand = fc; + this->Text = text; } bool UpdatePercentage(double value, double total, std::string &status) { int OldPercentage = this->CurrentPercentage; - if (0.0 == total) - { - this->CurrentPercentage = 100; - } - else + if (total > 0.0) { this->CurrentPercentage = static_cast(value/total*100.0 + 0.5); } @@ -2488,7 +2505,8 @@ namespace{ if (updated) { cmOStringStream oss; - oss << "[download " << this->CurrentPercentage << "% complete]"; + oss << "[" << this->Text << " " << this->CurrentPercentage + << "% complete]"; status = oss.str(); } @@ -2503,14 +2521,15 @@ namespace{ private: int CurrentPercentage; cmFileCommand *FileCommand; + std::string Text; }; static int - cmFileCommandCurlProgressCallback(void *clientp, - double dltotal, double dlnow, - double ultotal, double ulnow) - { + cmFileDownloadProgressCallback(void *clientp, + double dltotal, double dlnow, + double ultotal, double ulnow) + { cURLProgressHelper *helper = reinterpret_cast(clientp); @@ -2526,12 +2545,33 @@ namespace{ } return 0; - } + } + + + static int + cmFileUploadProgressCallback(void *clientp, + double dltotal, double dlnow, + double ultotal, double ulnow) + { + cURLProgressHelper *helper = + reinterpret_cast(clientp); + + static_cast(dltotal); + static_cast(dlnow); + + std::string status; + if (helper->UpdatePercentage(ulnow, ultotal, status)) + { + cmFileCommand *fc = helper->GetFileCommand(); + cmMakefile *mf = fc->GetMakefile(); + mf->DisplayStatus(status.c_str(), -1); + } + + return 0; + } } -#endif -#if defined(CMAKE_BUILD_WITH_CMAKE) namespace { class cURLEasyGuard @@ -2563,9 +2603,18 @@ namespace { #endif +#define check_curl_result(result, errstr) \ + if (result != CURLE_OK) \ + { \ + std::string e(errstr); \ + e += ::curl_easy_strerror(result); \ + this->SetError(e.c_str()); \ + return false; \ + } + + bool -cmFileCommand::HandleDownloadCommand(std::vector - const& args) +cmFileCommand::HandleDownloadCommand(std::vector const& args) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::vector::const_iterator i = args.begin(); @@ -2704,88 +2753,37 @@ cmFileCommand::HandleDownloadCommand(std::vector cURLEasyGuard g_curl(curl); ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set url: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + check_curl_result(res, "DOWNLOAD cannot set url: "); res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, - cmFileCommandWriteMemoryCallback); - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set write function: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + cmWriteToFileCallback); + check_curl_result(res, "DOWNLOAD cannot set write function: "); res = ::curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, cmFileCommandCurlDebugCallback); - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set debug function: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + check_curl_result(res, "DOWNLOAD cannot set debug function: "); cmFileCommandVectorOfChar chunkDebug; res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&fout); - - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set write data: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + check_curl_result(res, "DOWNLOAD cannot set write data: "); res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug); - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set debug data: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + check_curl_result(res, "DOWNLOAD cannot set debug data: "); res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set follow-redirect option: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + check_curl_result(res, "DOWNLOAD cannot set follow-redirect option: "); if(verboseLog.size()) { res = ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); - - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set verbose: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + check_curl_result(res, "DOWNLOAD cannot set verbose: "); } if(timeout > 0) { res = ::curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout ); - - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set timeout: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + check_curl_result(res, "DOWNLOAD cannot set timeout: "); } // Need the progress helper's scope to last through the duration of @@ -2793,39 +2791,20 @@ cmFileCommand::HandleDownloadCommand(std::vector // scope intentionally, rather than inside the "if(showProgress)" // block... // - cURLProgressHelper helper(this); + cURLProgressHelper helper(this, "download"); if(showProgress) { - res = ::curl_easy_setopt(curl, - CURLOPT_NOPROGRESS, 0); - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set noprogress value: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + res = ::curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); + check_curl_result(res, "DOWNLOAD cannot set noprogress value: "); res = ::curl_easy_setopt(curl, - CURLOPT_PROGRESSFUNCTION, cmFileCommandCurlProgressCallback); - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set progress function: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + CURLOPT_PROGRESSFUNCTION, cmFileDownloadProgressCallback); + check_curl_result(res, "DOWNLOAD cannot set progress function: "); res = ::curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, reinterpret_cast(&helper)); - if (res != CURLE_OK) - { - std::string e = "DOWNLOAD cannot set progress data: "; - e += ::curl_easy_strerror(res); - this->SetError(e.c_str()); - return false; - } + check_curl_result(res, "DOWNLOAD cannot set progress data: "); } res = ::curl_easy_perform(curl); @@ -2901,3 +2880,219 @@ cmFileCommand::HandleDownloadCommand(std::vector return false; #endif } + + +bool +cmFileCommand::HandleUploadCommand(std::vector const& args) +{ +#if defined(CMAKE_BUILD_WITH_CMAKE) + if(args.size() < 3) + { + this->SetError("UPLOAD must be called with at least three arguments."); + return false; + } + std::vector::const_iterator i = args.begin(); + ++i; + std::string filename = *i; + ++i; + std::string url = *i; + ++i; + + long timeout = 0; + std::string logVar; + std::string statusVar; + bool showProgress = false; + + while(i != args.end()) + { + if(*i == "TIMEOUT") + { + ++i; + if(i != args.end()) + { + timeout = atol(i->c_str()); + } + else + { + this->SetError("UPLOAD missing time for TIMEOUT."); + return false; + } + } + else if(*i == "LOG") + { + ++i; + if( i == args.end()) + { + this->SetError("UPLOAD missing VAR for LOG."); + return false; + } + logVar = *i; + } + else if(*i == "STATUS") + { + ++i; + if( i == args.end()) + { + this->SetError("UPLOAD missing VAR for STATUS."); + return false; + } + statusVar = *i; + } + else if(*i == "SHOW_PROGRESS") + { + showProgress = true; + } + + ++i; + } + + // Open file for reading: + // + FILE *fin = fopen(filename.c_str(), "rb"); + if(!fin) + { + std::string errStr = "UPLOAD cannot open file '"; + errStr += filename + "' for reading."; + this->SetError(errStr.c_str()); + return false; + } + + struct stat st; + if(::stat(filename.c_str(), &st)) + { + std::string errStr = "UPLOAD cannot stat file '"; + errStr += filename + "'."; + this->SetError(errStr.c_str()); + return false; + } + + ::CURL *curl; + ::curl_global_init(CURL_GLOBAL_DEFAULT); + curl = ::curl_easy_init(); + if(!curl) + { + this->SetError("UPLOAD error initializing curl."); + return false; + } + + cURLEasyGuard g_curl(curl); + + // enable HTTP ERROR parsing + ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); + + // enable uploading + res = ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1); + check_curl_result(res, "UPLOAD cannot set upload flag: "); + + res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + check_curl_result(res, "UPLOAD cannot set url: "); + + res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, + cmWriteToMemoryCallback); + check_curl_result(res, "UPLOAD cannot set write function: "); + + res = ::curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, + cmFileCommandCurlDebugCallback); + check_curl_result(res, "UPLOAD cannot set debug function: "); + + cmFileCommandVectorOfChar chunkResponse; + cmFileCommandVectorOfChar chunkDebug; + + res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunkResponse); + check_curl_result(res, "UPLOAD cannot set write data: "); + + res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug); + check_curl_result(res, "UPLOAD cannot set debug data: "); + + res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + check_curl_result(res, "UPLOAD cannot set follow-redirect option: "); + + if(logVar.size()) + { + res = ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); + check_curl_result(res, "UPLOAD cannot set verbose: "); + } + + if(timeout > 0) + { + res = ::curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout ); + check_curl_result(res, "UPLOAD cannot set timeout: "); + } + + // Need the progress helper's scope to last through the duration of + // the curl_easy_perform call... so this object is declared at function + // scope intentionally, rather than inside the "if(showProgress)" + // block... + // + cURLProgressHelper helper(this, "upload"); + + if(showProgress) + { + res = ::curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); + check_curl_result(res, "UPLOAD cannot set noprogress value: "); + + res = ::curl_easy_setopt(curl, + CURLOPT_PROGRESSFUNCTION, cmFileUploadProgressCallback); + check_curl_result(res, "UPLOAD cannot set progress function: "); + + res = ::curl_easy_setopt(curl, + CURLOPT_PROGRESSDATA, reinterpret_cast(&helper)); + check_curl_result(res, "UPLOAD cannot set progress data: "); + } + + // now specify which file to upload + res = ::curl_easy_setopt(curl, CURLOPT_INFILE, fin); + check_curl_result(res, "UPLOAD cannot set input file: "); + + // and give the size of the upload (optional) + res = ::curl_easy_setopt(curl, CURLOPT_INFILESIZE, static_cast(st.st_size)); + check_curl_result(res, "UPLOAD cannot set input file size: "); + + res = ::curl_easy_perform(curl); + + /* always cleanup */ + g_curl.release(); + ::curl_easy_cleanup(curl); + + if(statusVar.size()) + { + cmOStringStream result; + result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; + this->Makefile->AddDefinition(statusVar.c_str(), + result.str().c_str()); + } + + ::curl_global_cleanup(); + + fclose(fin); + fin = NULL; + + if(logVar.size()) + { + std::string log; + + if(chunkResponse.size()) + { + chunkResponse.push_back(0); + log += "Response:\n"; + log += &*chunkResponse.begin(); + log += "\n"; + } + + if(chunkDebug.size()) + { + chunkDebug.push_back(0); + log += "Debug:\n"; + log += &*chunkDebug.begin(); + log += "\n"; + } + + this->Makefile->AddDefinition(logVar.c_str(), log.c_str()); + } + + return true; +#else + this->SetError("UPLOAD not supported by bootstrap cmake."); + return false; +#endif +} diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index b11dcde..1b6dbbf 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -82,6 +82,8 @@ public: " file(TO_NATIVE_PATH path result)\n" " file(DOWNLOAD url file [TIMEOUT timeout] [STATUS status] [LOG log]\n" " [EXPECTED_MD5 sum] [SHOW_PROGRESS])\n" + " file(UPLOAD filename url [TIMEOUT timeout] [STATUS status]\n" + " [LOG log] [SHOW_PROGRESS])\n" "WRITE will write a message into a file called 'filename'. It " "overwrites the file if it already exists, and creates the file " "if it does not exist.\n" @@ -165,6 +167,18 @@ public: "If SHOW_PROGRESS is specified, progress information will be printed " "as status messages until the operation is complete." "\n" + "UPLOAD will upload the given file to the given URL. " + "If LOG var is specified a log of the upload will be put in var. " + "If STATUS var is specified the status of the operation will" + " be put in var. The status is returned in a list of length 2. " + "The first element is the numeric return value for the operation, " + "and the second element is a string value for the error. A 0 " + "numeric error means no error in the operation. " + "If TIMEOUT time is specified, the operation will " + "timeout after time seconds, time should be specified as an integer. " + "If SHOW_PROGRESS is specified, progress information will be printed " + "as status messages until the operation is complete." + "\n" "The file() command also provides COPY and INSTALL signatures:\n" " file( files... DESTINATION \n" " [FILE_PERMISSIONS permissions...]\n" @@ -223,6 +237,7 @@ protected: bool HandleCopyCommand(std::vector const& args); bool HandleInstallCommand(std::vector const& args); bool HandleDownloadCommand(std::vector const& args); + bool HandleUploadCommand(std::vector const& args); }; diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index 8fd52df..cceef3b 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -33,6 +33,8 @@ set_property(TEST CMake.FileDownload PROPERTY PASS_REGULAR_EXPRESSION "file already exists with expected MD5 sum" ) +AddCMakeTest(FileUpload "") + if(HAVE_ELF_H) AddCMakeTest(ELF "") endif() diff --git a/Tests/CMakeTests/FileTest.cmake.in b/Tests/CMakeTests/FileTest.cmake.in index 721f311..b6dcaa6 100644 --- a/Tests/CMakeTests/FileTest.cmake.in +++ b/Tests/CMakeTests/FileTest.cmake.in @@ -27,7 +27,7 @@ check_cmake_test(File # Also execute each test listed in FileTestScript.cmake: # set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/FileTestScript.cmake") -set(number_of_tests_expected 56) +set(number_of_tests_expected 62) include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake") execute_all_script_tests(${scriptname} number_of_tests_executed) diff --git a/Tests/CMakeTests/FileTestScript.cmake b/Tests/CMakeTests/FileTestScript.cmake index c4e27bd..9a43569 100644 --- a/Tests/CMakeTests/FileTestScript.cmake +++ b/Tests/CMakeTests/FileTestScript.cmake @@ -201,6 +201,26 @@ elseif(testname STREQUAL download_with_bogus_protocol) # pass message("l='${l}'") message("s='${s}'") +elseif(testname STREQUAL upload_wrong_number_of_args) # fail + file(UPLOAD ./ffff) + +elseif(testname STREQUAL upload_missing_time) # fail + file(UPLOAD ./ffff zzzz://bogus/ffff TIMEOUT) + +elseif(testname STREQUAL upload_missing_log_var) # fail + file(UPLOAD ./ffff zzzz://bogus/ffff TIMEOUT 2 LOG) + +elseif(testname STREQUAL upload_missing_status_var) # fail + file(UPLOAD ./ffff zzzz://bogus/ffff TIMEOUT 2 LOG l STATUS) + +elseif(testname STREQUAL upload_file_that_doesnt_exist) # fail + file(UPLOAD ./ffff zzzz://bogus/ffff) + +elseif(testname STREQUAL upload_with_bogus_protocol) # pass + file(UPLOAD ${CMAKE_CURRENT_LIST_FILE} zzzz://bogus/ffff TIMEOUT 2 LOG l STATUS s) + message("l='${l}'") + message("s='${s}'") + else() # fail message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'") diff --git a/Tests/CMakeTests/FileUploadTest.cmake.in b/Tests/CMakeTests/FileUploadTest.cmake.in new file mode 100644 index 0000000..8577aef --- /dev/null +++ b/Tests/CMakeTests/FileUploadTest.cmake.in @@ -0,0 +1,49 @@ +file(REMOVE_RECURSE "@CMAKE_CURRENT_BINARY_DIR@/uploads") + +if(EXISTS "@CMAKE_CURRENT_BINARY_DIR@/uploads/file1.png") + message(FATAL_ERROR "error: file1.png exists - should have been deleted") +endif() +if(EXISTS "@CMAKE_CURRENT_BINARY_DIR@/uploads/file2.png") + message(FATAL_ERROR "error: file2.png exists - should have been deleted") +endif() + +file(MAKE_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/uploads") + +set(filename "@CMAKE_CURRENT_SOURCE_DIR@/FileDownloadInput.png") +set(urlbase "file://@CMAKE_CURRENT_BINARY_DIR@/uploads") + +message(STATUS "FileUpload:1") +file(UPLOAD + ${filename} + ${urlbase}/file1.png + TIMEOUT 2 + ) + +message(STATUS "FileUpload:2") +file(UPLOAD + ${filename} + ${urlbase}/file2.png + STATUS status + LOG log + SHOW_PROGRESS + ) + +execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum + "@CMAKE_CURRENT_BINARY_DIR@/uploads/file1.png" + OUTPUT_VARIABLE sum1 + OUTPUT_STRIP_TRAILING_WHITESPACE) +if(NOT sum1 MATCHES "^d16778650db435bda3a8c3435c3ff5d1 .*/uploads/file1.png$") + message(FATAL_ERROR "file1.png did not upload correctly (sum1='${sum1}')") +endif() + +execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum + "@CMAKE_CURRENT_BINARY_DIR@/uploads/file2.png" + OUTPUT_VARIABLE sum2 + OUTPUT_STRIP_TRAILING_WHITESPACE) +if(NOT sum2 MATCHES "^d16778650db435bda3a8c3435c3ff5d1 .*/uploads/file2.png$") + message(FATAL_ERROR "file2.png did not upload correctly (sum2='${sum2}')") +endif() + +message(STATUS "log='${log}'") +message(STATUS "status='${status}'") +message(STATUS "DONE") -- cgit v0.12 From 2f690ab8cb1f5d8e47fa10da52733405147d74be Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 26 Feb 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 43cd001..1709601 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 25) +SET(KWSYS_DATE_STAMP_DAY 26) -- cgit v0.12 From ab02be50b4729e634c1710cfb871b2ffb0ec881b Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 27 Feb 2011 00:01:05 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 1709601..d65b35b 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 26) +SET(KWSYS_DATE_STAMP_DAY 27) -- cgit v0.12 From 2465b5e4f5829b4991de6af9bbcbc8f8f1f8c2ab Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 28 Feb 2011 00:01:03 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index d65b35b..05e2d07 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 02) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 27) +SET(KWSYS_DATE_STAMP_DAY 28) -- cgit v0.12 From 61a83f955a613383b78cb2759d867d3133741a49 Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 28 Feb 2011 10:47:23 -0500 Subject: Fix KWStyle line too long error (#11286) --- Source/cmFileCommand.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 8849a47..a72feb1 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -3045,7 +3045,8 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) check_curl_result(res, "UPLOAD cannot set input file: "); // and give the size of the upload (optional) - res = ::curl_easy_setopt(curl, CURLOPT_INFILESIZE, static_cast(st.st_size)); + res = ::curl_easy_setopt(curl, + CURLOPT_INFILESIZE, static_cast(st.st_size)); check_curl_result(res, "UPLOAD cannot set input file size: "); res = ::curl_easy_perform(curl); -- cgit v0.12 From 26b9dfb722c9e945f6f846e400c3a98513911842 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 1 Mar 2011 00:01:04 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 05e2d07..990a201 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 02) +SET(KWSYS_DATE_STAMP_MONTH 03) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 28) +SET(KWSYS_DATE_STAMP_DAY 01) -- cgit v0.12 From 32f18c94e1205a0d06ac978d28de2d40b739f05c Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 1 Mar 2011 15:34:10 -0500 Subject: KWSys: Require at least CMake 2.6.3 Remove code left for supporting earlier CMake versions. --- Source/kwsys/CMakeLists.txt | 286 ++++++++++++++------------------------------ 1 file changed, 90 insertions(+), 196 deletions(-) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index a35a01f..f5f317c 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -1,6 +1,6 @@ #============================================================================= # KWSys - Kitware System Library -# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -44,9 +44,7 @@ # SET(KWSYS_IOS_FORCE_OLD 1) # # -# Optional settings to setup install rules work in one of two ways. -# The modern way utilizes the CMake 2.4 INSTALL command. Settings -# for this mode are as follows: +# Optional settings to setup install rules are as follows: # # KWSYS_INSTALL_BIN_DIR = The installation target directories into # KWSYS_INSTALL_LIB_DIR which the libraries and headers from @@ -70,25 +68,6 @@ # SET(KWSYS_INSTALL_INCLUDE_DIR include) # SET(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME Runtime) # SET(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT Development) -# -# The old way uses the original CMake INSTALL_* commands. Settings -# for this mode are as follows: -# -# KWSYS_LIBRARY_INSTALL_DIR = The installation target directories into -# KWSYS_HEADER_INSTALL_DIR which the libraries and headers from -# kwsys should be installed by a "make install". -# The values should be specified relative to -# the installation prefix and start with a '/'. -# Example: -# -# SET(KWSYS_LIBRARY_INSTALL_DIR /lib) -# SET(KWSYS_HEADER_INSTALL_DIR /include) -# -# The modern way will be used whenever the INSTALL command is -# available. If the settings are not available the old names will be -# used to construct them. The old way will be used whenever the -# INSTALL command is not available. If the settings are not available -# the new names will be used to construct them. # Once configured, kwsys should be used as follows from C or C++ code: # @@ -105,13 +84,7 @@ # any outside mailing list and no documentation of the change will be # written. -CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR) -IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) - -# Allow empty endif() and such with CMake 2.4. -SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) #----------------------------------------------------------------------------- # If a namespace is not specified, use "kwsys" and enable testing. @@ -126,23 +99,11 @@ ENDIF(NOT KWSYS_NAMESPACE) # The project name is that of the specified namespace. PROJECT(${KWSYS_NAMESPACE}) -# Some properties we set only with CMake 2.6 and above. -IF(COMMAND SET_PROPERTY) - MACRO(KWSYS_SET_PROPERTY) - SET_PROPERTY(${ARGV}) - ENDMACRO(KWSYS_SET_PROPERTY) -ELSE(COMMAND SET_PROPERTY) - MACRO(KWSYS_SET_PROPERTY) - ENDMACRO(KWSYS_SET_PROPERTY) -ENDIF(COMMAND SET_PROPERTY) - # Tell CMake how to follow dependencies of sources in this directory. -IF(COMMAND SET_PROPERTY) - SET_PROPERTY(DIRECTORY - PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM - "KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>" - ) -ENDIF(COMMAND SET_PROPERTY) +SET_PROPERTY(DIRECTORY + PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM + "KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>" + ) # Select library components. IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) @@ -208,97 +169,75 @@ INCLUDE(CheckTypeSize) # Do full dependency headers. INCLUDE_REGULAR_EXPRESSION("^.*$") -# Choose which kind of install commands to use. -IF(COMMAND INSTALL) - # Use new KWSYS_INSTALL_*_DIR variable names to control installation. - # Take defaults from the old names. Note that there was no old name - # for the bin dir, so we take the old lib dir name so DLLs will be - # installed in a compatible way for old code. - IF(NOT KWSYS_INSTALL_INCLUDE_DIR) - STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_INCLUDE_DIR - "${KWSYS_HEADER_INSTALL_DIR}") - ENDIF(NOT KWSYS_INSTALL_INCLUDE_DIR) - IF(NOT KWSYS_INSTALL_LIB_DIR) - STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_LIB_DIR - "${KWSYS_LIBRARY_INSTALL_DIR}") - ENDIF(NOT KWSYS_INSTALL_LIB_DIR) - IF(NOT KWSYS_INSTALL_BIN_DIR) - STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_BIN_DIR - "${KWSYS_LIBRARY_INSTALL_DIR}") - ENDIF(NOT KWSYS_INSTALL_BIN_DIR) - - # Setup header install rules. - SET(KWSYS_INSTALL_INCLUDE_OPTIONS) - IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) - SET(KWSYS_INSTALL_INCLUDE_OPTIONS ${KWSYS_INSTALL_INCLUDE_OPTIONS} - COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} - ) - ENDIF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) +# Use new KWSYS_INSTALL_*_DIR variable names to control installation. +# Take defaults from the old names. Note that there was no old name +# for the bin dir, so we take the old lib dir name so DLLs will be +# installed in a compatible way for old code. +IF(NOT KWSYS_INSTALL_INCLUDE_DIR) + STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_INCLUDE_DIR + "${KWSYS_HEADER_INSTALL_DIR}") +ENDIF(NOT KWSYS_INSTALL_INCLUDE_DIR) +IF(NOT KWSYS_INSTALL_LIB_DIR) + STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_LIB_DIR + "${KWSYS_LIBRARY_INSTALL_DIR}") +ENDIF(NOT KWSYS_INSTALL_LIB_DIR) +IF(NOT KWSYS_INSTALL_BIN_DIR) + STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_BIN_DIR + "${KWSYS_LIBRARY_INSTALL_DIR}") +ENDIF(NOT KWSYS_INSTALL_BIN_DIR) + +# Setup header install rules. +SET(KWSYS_INSTALL_INCLUDE_OPTIONS) +IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) + SET(KWSYS_INSTALL_INCLUDE_OPTIONS ${KWSYS_INSTALL_INCLUDE_OPTIONS} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} + ) +ENDIF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) - # Setup library install rules. - SET(KWSYS_INSTALL_LIBRARY_RULE) - IF(KWSYS_INSTALL_LIB_DIR) - IF(KWSYS_INSTALL_EXPORT_NAME) - LIST(APPEND KWSYS_INSTALL_LIBRARY_RULE EXPORT ${KWSYS_INSTALL_EXPORT_NAME}) - ENDIF() - # Install the shared library to the lib directory. +# Setup library install rules. +SET(KWSYS_INSTALL_LIBRARY_RULE) +IF(KWSYS_INSTALL_LIB_DIR) + IF(KWSYS_INSTALL_EXPORT_NAME) + LIST(APPEND KWSYS_INSTALL_LIBRARY_RULE EXPORT ${KWSYS_INSTALL_EXPORT_NAME}) + ENDIF() + # Install the shared library to the lib directory. + SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} + LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR} + ) + # Assign the shared library to the runtime component. + IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} ) - # Assign the shared library to the runtime component. - IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) - SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} - ) - ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) + ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) - # Install the archive to the lib directory. + # Install the archive to the lib directory. + SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} + ARCHIVE DESTINATION ${KWSYS_INSTALL_LIB_DIR} + ) + # Assign the archive to the development component. + IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - ARCHIVE DESTINATION ${KWSYS_INSTALL_LIB_DIR} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} ) - # Assign the archive to the development component. - IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) - SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} - ) - ENDIF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) - ENDIF(KWSYS_INSTALL_LIB_DIR) - IF(KWSYS_INSTALL_BIN_DIR) - # Install the runtime library to the bin directory. + ENDIF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) +ENDIF(KWSYS_INSTALL_LIB_DIR) +IF(KWSYS_INSTALL_BIN_DIR) + # Install the runtime library to the bin directory. + SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} + RUNTIME DESTINATION ${KWSYS_INSTALL_BIN_DIR} + ) + # Assign the runtime library to the runtime component. + IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - RUNTIME DESTINATION ${KWSYS_INSTALL_BIN_DIR} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} ) - # Assign the runtime library to the runtime component. - IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) - SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} - ) - ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) - ENDIF(KWSYS_INSTALL_BIN_DIR) - - # Do not support old KWSYS_*_INSTALL_DIR variable names. - SET(KWSYS_HEADER_INSTALL_DIR) - SET(KWSYS_LIBRARY_INSTALL_DIR) - -ELSE(COMMAND INSTALL) - # Use old KWSYS_*_INSTALL_DIR variable names. - # Take defaults from the new names. - IF(KWSYS_INSTALL_LIB_DIR) - IF(NOT KWSYS_LIBRARY_INSTALL_DIR) - SET(KWSYS_LIBRARY_INSTALL_DIR "/${KWSYS_INSTALL_LIB_DIR}") - ENDIF(NOT KWSYS_LIBRARY_INSTALL_DIR) - ENDIF(KWSYS_INSTALL_LIB_DIR) - IF(KWSYS_INSTALL_INCLUDE_DIR) - IF(NOT KWSYS_HEADER_INSTALL_DIR) - SET(KWSYS_HEADER_INSTALL_DIR "/${KWSYS_INSTALL_INCLUDE_DIR}") - ENDIF(NOT KWSYS_HEADER_INSTALL_DIR) - ENDIF(KWSYS_INSTALL_INCLUDE_DIR) + ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) +ENDIF(KWSYS_INSTALL_BIN_DIR) - # Do not support new KWSYS_INSTALL_*_DIR variable names. - SET(KWSYS_INSTALL_BIN_DIR) - SET(KWSYS_INSTALL_INCLUDE_DIR) - SET(KWSYS_INSTALL_LIB_DIR) -ENDIF(COMMAND INSTALL) +# Do not support old KWSYS_*a_INSTALL_DIR variable names. +SET(KWSYS_HEADER_INSTALL_DIR) +SET(KWSYS_LIBRARY_INSTALL_DIR) # Generated source files will need this header. STRING(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" @@ -680,10 +619,6 @@ FOREACH(header DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE}/stl - FILES ${KWSYS_HEADER_DIR}/stl/${header}.hxx) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ELSE(KWSYS_STL_HEADER_EXTRA_${header}) SET(KWSYS_STL_HEADER_EXTRA "") ENDIF(KWSYS_STL_HEADER_EXTRA_${header}) @@ -697,10 +632,6 @@ FOREACH(header DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE}/stl - FILES ${KWSYS_HEADER_DIR}/stl/${header}) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(header) # Provide cstddef header. @@ -711,10 +642,6 @@ IF(KWSYS_INSTALL_INCLUDE_DIR) INSTALL(FILES ${KWSYS_HEADER_DIR}/cstddef DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE} ${KWSYS_INSTALL_INCLUDE_OPTIONS}) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE} - FILES ${KWSYS_HEADER_DIR}/cstddef) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) #----------------------------------------------------------------------------- @@ -732,10 +659,6 @@ FOREACH(header iostream fstream sstream iosfwd) DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/ios ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE}/ios - FILES ${KWSYS_HEADER_DIR}/ios/${header}) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(header) #----------------------------------------------------------------------------- @@ -824,10 +747,6 @@ FOREACH(c ${KWSYS_CLASSES}) DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE} ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE} - FILES ${KWSYS_HEADER_DIR}/${c}.hxx) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(c) # Configure C headers. @@ -843,10 +762,6 @@ FOREACH(h ${KWSYS_H_FILES}) DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE} ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE} - FILES ${KWSYS_HEADER_DIR}/${h}.h) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(h) # Configure other C++ headers. @@ -862,10 +777,6 @@ FOREACH(h ${KWSYS_HXX_FILES}) DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE} ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE} - FILES ${KWSYS_HEADER_DIR}/${h}.hxx) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(h) #----------------------------------------------------------------------------- @@ -873,7 +784,7 @@ ENDFOREACH(h) IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) ADD_LIBRARY(${KWSYS_NAMESPACE} ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY LABELS ${KWSYS_LABELS_LIB}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY LABELS ${KWSYS_LABELS_LIB}) IF(KWSYS_USE_DynamicLoader) IF(UNIX) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS}) @@ -895,15 +806,12 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) IF(KWSYS_INSTALL_LIBRARY_RULE) INSTALL(TARGETS ${KWSYS_NAMESPACE} ${KWSYS_INSTALL_LIBRARY_RULE}) ENDIF(KWSYS_INSTALL_LIBRARY_RULE) - IF(KWSYS_LIBRARY_INSTALL_DIR) - INSTALL_TARGETS(${KWSYS_LIBRARY_INSTALL_DIR} ${KWSYS_NAMESPACE}) - ENDIF(KWSYS_LIBRARY_INSTALL_DIR) ENDIF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) # Add a C-only library if requested. IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) ADD_LIBRARY(${KWSYS_NAMESPACE}_c ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}_c PROPERTY LABELS ${KWSYS_LABELS_LIB}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}_c PROPERTY LABELS ${KWSYS_LABELS_LIB}) # Apply user-defined target properties to the library. IF(KWSYS_PROPERTIES_C) @@ -916,9 +824,6 @@ IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) IF(KWSYS_INSTALL_LIBRARY_RULE) INSTALL(TARGETS ${KWSYS_NAMESPACE}_c ${KWSYS_INSTALL_LIBRARY_RULE}) ENDIF(KWSYS_INSTALL_LIBRARY_RULE) - IF(KWSYS_LIBRARY_INSTALL_DIR) - INSTALL_TARGETS(${KWSYS_LIBRARY_INSTALL_DIR} ${KWSYS_NAMESPACE}_c) - ENDIF(KWSYS_LIBRARY_INSTALL_DIR) ENDIF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) # For building kwsys itself, we use a macro defined on the command @@ -942,8 +847,8 @@ IF(KWSYS_USE_Process) # encode it into a C file. ADD_EXECUTABLE(${KWSYS_NAMESPACE}ProcessFwd9x ProcessFwd9x.c) ADD_EXECUTABLE(${KWSYS_NAMESPACE}EncodeExecutable EncodeExecutable.c) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}ProcessFwd9x PROPERTY LABELS ${KWSYS_LABELS_EXE}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}EncodeExecutable PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}ProcessFwd9x PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}EncodeExecutable PROPERTY LABELS ${KWSYS_LABELS_EXE}) # Construct the location of the executable to be encoded. SET(BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) @@ -959,23 +864,12 @@ IF(KWSYS_USE_Process) # Take advantage of a better custom command syntax if possible. SET(CMD ${BIN_DIR}${CFG_INTDIR}/${KWSYS_NAMESPACE}EncodeExecutable.exe) SET(FWD ${BIN_DIR}${CFG_INTDIR}/${KWSYS_NAMESPACE}ProcessFwd9x.exe) - IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.6) - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c - COMMAND ${CMD} - ARGS ${FWD} ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c - ${KWSYS_NAMESPACE} ProcessFwd9x - DEPENDS ${CMD} ${FWD}) - ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.6) - ADD_CUSTOM_COMMAND( - TARGET ${KWSYS_NAMESPACE} - SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/ProcessFwd9x.c - COMMAND ${CMD} - ARGS ${FWD} ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c - ${KWSYS_NAMESPACE} ProcessFwd9x - OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c - DEPENDS ${CMD} ${FWD}) - ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.6) + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c + COMMAND ${CMD} + ARGS ${FWD} ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c + ${KWSYS_NAMESPACE} ProcessFwd9x + DEPENDS ${CMD} ${FWD}) # Make sure build occurs in proper order. ADD_DEPENDENCIES(${KWSYS_NAMESPACE} ${KWSYS_NAMESPACE}ProcessFwd9x @@ -998,19 +892,19 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) testEncode testTerminal ) - IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + IF(KWSYS_STANDALONE) SET(KWSYS_C_TESTS ${KWSYS_C_TESTS} testFail) - ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + ENDIF() CREATE_TEST_SOURCELIST( KWSYS_C_TEST_SRCS ${KWSYS_NAMESPACE}TestsC.c ${KWSYS_C_TESTS} ) ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestsC ${KWSYS_C_TEST_SRCS}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsC PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsC PROPERTY LABELS ${KWSYS_LABELS_EXE}) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsC ${KWSYS_NAMESPACE}_c) FOREACH(test ${KWSYS_C_TESTS}) ADD_TEST(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsC ${test} ${KWSYS_TEST_ARGS_${test}}) - KWSYS_SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) ENDFOREACH(test) # C++ tests @@ -1034,7 +928,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS} testDynamicLoader) # If kwsys contains the DynamicLoader, need extra library ADD_LIBRARY(${KWSYS_NAMESPACE}TestDynload MODULE testDynload.c) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestDynload PROPERTY LABELS ${KWSYS_LABELS_LIB}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestDynload PROPERTY LABELS ${KWSYS_LABELS_LIB}) ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestDynload ${KWSYS_NAMESPACE}) ENDIF(KWSYS_USE_DynamicLoader) CREATE_TEST_SOURCELIST( @@ -1042,7 +936,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ${KWSYS_CXX_TESTS} ) ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_CXX_TEST_SRCS}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY LABELS ${KWSYS_LABELS_EXE}) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_NAMESPACE}) SET(TEST_SYSTEMTOOLS_BIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/testSystemTools.bin") @@ -1089,19 +983,19 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ) FOREACH(test ${KWSYS_CXX_TESTS}) ADD_TEST(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsCxx ${test} ${KWSYS_TEST_ARGS_${test}}) - KWSYS_SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) ENDFOREACH(test) # Process tests. ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestProcess testProcess.c) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestProcess PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestProcess PROPERTY LABELS ${KWSYS_LABELS_EXE}) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestProcess ${KWSYS_NAMESPACE}_c) IF(NOT CYGWIN) SET(KWSYS_TEST_PROCESS_7 7) ENDIF(NOT CYGWIN) FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7}) ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n}) - KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120) ENDFOREACH(n) @@ -1115,13 +1009,13 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ${PROJECT_BINARY_DIR}/testSharedForward.c @ONLY IMMEDIATE) ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestSharedForward ${PROJECT_BINARY_DIR}/testSharedForward.c) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestSharedForward PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestSharedForward PROPERTY LABELS ${KWSYS_LABELS_EXE}) ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestSharedForward ${KWSYS_NAMESPACE}_c) ADD_TEST(kwsys.testSharedForward ${EXEC_DIR}/${KWSYS_NAMESPACE}TestSharedForward 1) - KWSYS_SET_PROPERTY(TEST kwsys.testSharedForward PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_PROPERTY(TEST kwsys.testSharedForward PROPERTY LABELS ${KWSYS_LABELS_TEST}) # Configure some test properties. - IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + IF(KWSYS_STANDALONE) # We expect test to fail SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES WILL_FAIL ON) GET_TEST_PROPERTY(kwsys.testFail WILL_FAIL wfv) @@ -1129,7 +1023,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES PASS_REGULAR_EXPRESSION "Test passed") SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value") MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}") - ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + ENDIF() # Suppress known consistent failures on buggy systems. IF(KWSYS_TEST_BOGUS_FAILURES) -- cgit v0.12 From f72cc88c659d586cc65ac47e7807054345ccad89 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 2 Mar 2011 00:01:03 -0500 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 990a201..ec4b811 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 03) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 01) +SET(KWSYS_DATE_STAMP_DAY 02) -- cgit v0.12 From 89ea7a3d3c9487eb33caaedf1b636e0af092dcc2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Mar 2011 11:17:29 -0500 Subject: Factor AIX and XL compiler flags into common module Factor duplicate flag information from Platform/AIX-XL-*.cmake into Platform/AIX-XL.cmake and load it from the original files. --- Modules/Platform/AIX-XL-C.cmake | 6 ++---- Modules/Platform/AIX-XL-CXX.cmake | 6 ++---- Modules/Platform/AIX-XL-Fortran.cmake | 6 ++---- Modules/Platform/AIX-XL.cmake | 26 ++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 Modules/Platform/AIX-XL.cmake diff --git a/Modules/Platform/AIX-XL-C.cmake b/Modules/Platform/AIX-XL-C.cmake index 2de30d5..5e437fa 100644 --- a/Modules/Platform/AIX-XL-C.cmake +++ b/Modules/Platform/AIX-XL-C.cmake @@ -1,4 +1,2 @@ -SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared -SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib -SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ") -SET(CMAKE_SHARED_MODULE_C_FLAGS " ") +include(Platform/AIX-XL) +__aix_compiler_xl(C) diff --git a/Modules/Platform/AIX-XL-CXX.cmake b/Modules/Platform/AIX-XL-CXX.cmake index 648cb31..ef38a5f 100644 --- a/Modules/Platform/AIX-XL-CXX.cmake +++ b/Modules/Platform/AIX-XL-CXX.cmake @@ -1,4 +1,2 @@ -SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared -SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib -SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ") -SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ") +include(Platform/AIX-XL) +__aix_compiler_xl(CXX) diff --git a/Modules/Platform/AIX-XL-Fortran.cmake b/Modules/Platform/AIX-XL-Fortran.cmake index 8292e78..6d4f655 100644 --- a/Modules/Platform/AIX-XL-Fortran.cmake +++ b/Modules/Platform/AIX-XL-Fortran.cmake @@ -1,4 +1,2 @@ -SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared -SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib -SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS " ") -SET(CMAKE_SHARED_MODULE_Fortran_FLAGS " ") +include(Platform/AIX-XL) +__aix_compiler_xl(Fortran) diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake new file mode 100644 index 0000000..c07f28d --- /dev/null +++ b/Modules/Platform/AIX-XL.cmake @@ -0,0 +1,26 @@ + +#============================================================================= +# Copyright 2002-2011 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__AIX_COMPILER_XL) + return() +endif() +set(__AIX_COMPILER_XL 1) + +macro(__aix_compiler_xl lang) + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ") + set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ") +endmacro() -- cgit v0.12 From d30dcf18b9dedcf6744a87793653bc0d94d8a8bb Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Mar 2011 11:17:29 -0500 Subject: Move RPATH flags to AIX per-compiler information files Move RPATH flags out of Platform/AIX.cmake into platform-specific compiler information files Platform/AIX-XL and Platform/AIX-GNU. The flags need to be set for each compiler of each language. --- Modules/Platform/AIX-GNU.cmake | 2 ++ Modules/Platform/AIX-XL.cmake | 2 ++ Modules/Platform/AIX.cmake | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index 79c06ba..543f3e8 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -19,5 +19,7 @@ endif() set(__AIX_COMPILER_GNU 1) macro(__aix_compiler_gnu lang) + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G") endmacro() diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index c07f28d..1f94152 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -19,6 +19,8 @@ endif() set(__AIX_COMPILER_XL 1) macro(__aix_compiler_xl lang) + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ") diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index 0ab0cce..a9f773e 100644 --- a/Modules/Platform/AIX.cmake +++ b/Modules/Platform/AIX.cmake @@ -9,8 +9,6 @@ SET(CMAKE_DL_LIBS "-lld") # When our own RPATH is to be added it may be inserted before the # "always" paths. SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib) -SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-blibpath:") -SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # Files named "libfoo.a" may actually be shared libraries. SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1) -- cgit v0.12