diff options
29 files changed, 154 insertions, 87 deletions
diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in index 29dab97..13f2161 100644 --- a/Modules/AutomocInfo.cmake.in +++ b/Modules/AutomocInfo.cmake.in @@ -1,9 +1,9 @@ -set(AM_SOURCES "@_moc_files@" ) -set(AM_HEADERS "@_moc_headers@" ) -set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@") -set(AM_MOC_DEFINITIONS "@_moc_defs@") -set(AM_MOC_INCLUDES "@_moc_incs@") -set(AM_MOC_OPTIONS "@_moc_options@") +set(AM_SOURCES @_moc_files@ ) +set(AM_HEADERS @_moc_headers@ ) +set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@) +set(AM_MOC_DEFINITIONS @_moc_defs@) +set(AM_MOC_INCLUDES @_moc_incs@) +set(AM_MOC_OPTIONS @_moc_options@) set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/") set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/") @@ -12,5 +12,5 @@ set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/") set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/") set(AM_QT_VERSION_MAJOR "@QT_VERSION_MAJOR@" ) set(AM_Qt5Core_VERSION_MAJOR "@Qt5Core_VERSION_MAJOR@" ) -set(AM_TARGET_NAME "@_moc_target_name@") +set(AM_TARGET_NAME @_moc_target_name@) set(AM_RELAXED_MODE "@_moc_relaxed_mode@") diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 442d7c4..cba746f 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -899,6 +899,7 @@ IF(RPMBUILD_EXECUTABLE) # Now call rpmbuild using the SPECFILE EXECUTE_PROCESS( COMMAND "${RPMBUILD_EXECUTABLE}" -bb + --define "_topdir ${CPACK_RPM_DIRECTORY}" --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" "${CPACK_RPM_BINARY_SPECFILE}" WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake index d66874d..bc4d964 100644 --- a/Modules/CTestTargets.cmake +++ b/Modules/CTestTargets.cmake @@ -69,7 +69,7 @@ IF(NOT _CTEST_TARGETS_ADDED) ENDFOREACH(mode) # For Makefile generators add more granular targets. - IF("${CMAKE_GENERATOR}" MATCHES Make) + IF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") # Make targets for Experimental builds FOREACH(mode Nightly Experimental Continuous) FOREACH(testtype @@ -83,7 +83,7 @@ IF(NOT _CTEST_TARGETS_ADDED) SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets") ENDFOREACH(testtype) ENDFOREACH(mode) - ENDIF("${CMAKE_GENERATOR}" MATCHES Make) + ENDIF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") # If requested, add an alias that is the equivalent of the built-in "test" # or "RUN_TESTS" target: diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index bdcaf9d..c74c179 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -30,7 +30,10 @@ macro(__compiler_gnu lang) # in try_compile mode. GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE) if(NOT _IN_TC OR CMAKE_FORCE_DEPFILES) - set(CMAKE_DEPFILE_FLAGS_${lang} "-MMD -MF <DEPFILE>") + # distcc does not transform -o to -MT when invoking the preprocessor + # internally, as it ought to. Work around this bug by setting -MT here + # even though it isn't strictly necessary. + set(CMAKE_DEPFILE_FLAGS_${lang} "-MMD -MT <OBJECT> -MF <DEPFILE>") endif() # Initial configuration flags. diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index ebd7c7f..65077b3 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -501,6 +501,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets( case cmTarget::STATIC_LIBRARY: case cmTarget::SHARED_LIBRARY: case cmTarget::MODULE_LIBRARY: + case cmTarget::OBJECT_LIBRARY: { const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ? "[exe] " : "[lib] "); @@ -1017,6 +1018,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const case cmTarget::STATIC_LIBRARY: case cmTarget::SHARED_LIBRARY: case cmTarget::MODULE_LIBRARY: + case cmTarget::OBJECT_LIBRARY: { const char* prefix = (ti->second.GetType()==cmTarget::EXECUTABLE ? "[exe] " : "[lib] "); diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 3b368fa..ced26c4 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -152,7 +152,8 @@ public: "TO_CMAKE_PATH will convert path into a cmake style path with unix /. " " The input can be a single path or a system path like \"$ENV{PATH}\". " " Note the double quotes around the ENV call TO_CMAKE_PATH only takes " - " one argument.\n" + " one argument. This command will also convert the native list" + " delimiters for a list of paths like the PATH environment variable.\n" "TO_NATIVE_PATH works just like TO_CMAKE_PATH, but will convert from " " a cmake style path into the native path style \\ for windows and / " "for UNIX.\n" diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index a726849..6cdbbf2 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -57,7 +57,13 @@ void cmFindLibraryCommand::GenerateDocumentation() "the full path to the framework <fullPath>/A.framework. " "When a full path to a framework is used as a library, " "CMake will use a -framework A, and a -F<fullPath> to " - "link the framework to the target. "; + "link the framework to the target." + "\n" + "If the global property FIND_LIBRARY_USE_LIB64_PATHS is set all search " + "paths will be tested as normal, with \"64/\" appended, and with all " + "matches of \"lib/\" replaced with \"lib64/\". This property is " + "automatically set for the platforms that are known to need it if at " + "least one of the languages supported by the PROJECT command is enabled."; } // cmFindLibraryCommand diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 7979928..42dd428 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -30,6 +30,7 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t) //---------------------------------------------------------------------------- void cmGeneratorTarget::ClassifySources() { + cmsys::RegularExpression header(CM_HEADER_REGEX); bool isObjLib = this->Target->GetType() == cmTarget::OBJECT_LIBRARY; std::vector<cmSourceFile*> badObjLib; std::vector<cmSourceFile*> const& sources = this->Target->GetSourceFiles(); @@ -58,6 +59,10 @@ void cmGeneratorTarget::ClassifySources() this->ExternalObjects.push_back(sf); if(isObjLib) { badObjLib.push_back(sf); } } + else if(sf->GetLanguage()) + { + this->ObjectSources.push_back(sf); + } else if(ext == "def") { this->ModuleDefinitionFile = sf->GetFullPath(); @@ -68,6 +73,10 @@ void cmGeneratorTarget::ClassifySources() this->IDLSources.push_back(sf); if(isObjLib) { badObjLib.push_back(sf); } } + else if(header.find(sf->GetFullPath().c_str())) + { + this->HeaderSources.push_back(sf); + } else if(this->GlobalGenerator->IgnoreFile(sf->GetExtension().c_str())) { // We only get here if a source file is not an external object @@ -75,10 +84,6 @@ void cmGeneratorTarget::ClassifySources() // No message or diagnosis should be given. this->ExtraSources.push_back(sf); } - else if(sf->GetLanguage()) - { - this->ObjectSources.push_back(sf); - } else { this->ExtraSources.push_back(sf); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 7da4f86..2a918c9 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -95,6 +95,16 @@ void cmGlobalVisualStudioGenerator::Generate() // of Visual Studio. this->ConfigureCMakeVisualStudioMacros(); + // Add CMakeLists.txt with custom command to rerun CMake. + for(std::vector<cmLocalGenerator*>::const_iterator + lgi = this->LocalGenerators.begin(); + lgi != this->LocalGenerators.end(); ++lgi) + { + cmLocalVisualStudioGenerator* lg = + static_cast<cmLocalVisualStudioGenerator*>(*lgi); + lg->AddCMakeListsRules(); + } + // Run all the local generators. this->cmGlobalGenerator::Generate(); } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 56228f5..998843f 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3023,6 +3023,7 @@ void cmGlobalXCodeGenerator cmXCodeObject* buildConfigurations = this->CreateObject(cmXCodeObject::OBJECT_LIST); std::vector<cmXCodeObject*> configs; + const char *defaultConfigName = "Debug"; if(this->XcodeVersion == 15) { cmXCodeObject* configDebug = @@ -3039,6 +3040,10 @@ void cmGlobalXCodeGenerator for(unsigned int i = 0; i < this->CurrentConfigurationTypes.size(); ++i) { const char* name = this->CurrentConfigurationTypes[i].c_str(); + if (0 == i) + { + defaultConfigName = name; + } cmXCodeObject* config = this->CreateObject(cmXCodeObject::XCBuildConfiguration); config->AddAttribute("name", this->CreateString(name)); @@ -3060,7 +3065,7 @@ void cmGlobalXCodeGenerator configlist->AddAttribute("defaultConfigurationIsVisible", this->CreateString("0")); configlist->AddAttribute("defaultConfigurationName", - this->CreateString("Debug")); + this->CreateString(defaultConfigName)); cmXCodeObject* buildSettings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); const char* osxArch = diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 124747b..3e93819 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -251,7 +251,7 @@ public: std::string EscapeForShellOldStyle(const char* str); /** Escape the given string as an argument in a CMake script. */ - std::string EscapeForCMake(const char* str); + static std::string EscapeForCMake(const char* str); enum FortranFormat { diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 8b22705..bf0e997 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -74,24 +74,6 @@ void cmLocalVisualStudio10Generator::Generate() { cmTargets &tgts = this->Makefile->GetTargets(); - // Create the regeneration custom rule. - if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION")) - { - // Create a rule to regenerate the build system when the target - // specification source changes. - if(cmSourceFile* sf = this->CreateVCProjBuildRule()) - { - // Add the rule to targets that need it. - for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) - { - if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) - { - l->second.AddSourceFile(sf); - } - } - } - } - for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) { if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 5b99dfd..99a4c95 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -85,6 +85,23 @@ void cmLocalVisualStudio6Generator::AddHelperCommands() this->CreateCustomTargetsAndCommands(lang); } +void cmLocalVisualStudio6Generator::AddCMakeListsRules() +{ + cmTargets &tgts = this->Makefile->GetTargets(); + for(cmTargets::iterator l = tgts.begin(); + l != tgts.end(); l++) + { + // Add a rule to regenerate the build system when the target + // specification source changes. + const char* suppRegenRule = + this->Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION"); + if (!cmSystemTools::IsOn(suppRegenRule)) + { + this->AddDSPBuildRule(l->second); + } + } +} + void cmLocalVisualStudio6Generator::Generate() { this->OutputDSPFile(); @@ -107,18 +124,6 @@ void cmLocalVisualStudio6Generator::OutputDSPFile() // Create the DSP or set of DSP's for libraries and executables cmTargets &tgts = this->Makefile->GetTargets(); - for(cmTargets::iterator l = tgts.begin(); - l != tgts.end(); l++) - { - // Add a rule to regenerate the build system when the target - // specification source changes. - const char* suppRegenRule = - this->Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION"); - if (!cmSystemTools::IsOn(suppRegenRule)) - { - this->AddDSPBuildRule(l->second); - } - } // build any targets for(cmTargets::iterator l = tgts.begin(); diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h index a680633..1decc35 100644 --- a/Source/cmLocalVisualStudio6Generator.h +++ b/Source/cmLocalVisualStudio6Generator.h @@ -34,6 +34,7 @@ public: virtual ~cmLocalVisualStudio6Generator(); virtual void AddHelperCommands(); + virtual void AddCMakeListsRules(); /** * Generate the makefile for this directory. diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 363d370..9faf46d 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -100,6 +100,28 @@ void cmLocalVisualStudio7Generator::Generate() this->WriteStampFiles(); } +void cmLocalVisualStudio7Generator::AddCMakeListsRules() +{ + cmTargets &tgts = this->Makefile->GetTargets(); + // Create the regeneration custom rule. + if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION")) + { + // Create a rule to regenerate the build system when the target + // specification source changes. + if(cmSourceFile* sf = this->CreateVCProjBuildRule()) + { + // Add the rule to targets that need it. + for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + { + if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + l->second.AddSourceFile(sf); + } + } + } + } +} + void cmLocalVisualStudio7Generator::FixGlobalTargets() { // Visual Studio .NET 2003 Service Pack 1 will not run post-build @@ -156,24 +178,6 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles() // Get the set of targets in this directory. cmTargets &tgts = this->Makefile->GetTargets(); - // Create the regeneration custom rule. - if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION")) - { - // Create a rule to regenerate the build system when the target - // specification source changes. - if(cmSourceFile* sf = this->CreateVCProjBuildRule()) - { - // Add the rule to targets that need it. - for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) - { - if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) - { - l->second.AddSourceFile(sf); - } - } - } - } - // Create the project file for each target. for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++) diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 9d3a9f2..9aa408e 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -64,6 +64,7 @@ public: virtual void ReadAndStoreExternalGUID(const char* name, const char* path); + virtual void AddCMakeListsRules(); protected: void CreateSingleVCProj(const char *lname, cmTarget &tgt); private: diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index 410cc9a..9968592 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -58,6 +58,8 @@ public: virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0; + virtual void AddCMakeListsRules() = 0; + protected: virtual const char* ReportErrorLabel() const; virtual bool CustomCommandUseLocal() const { return false; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 56e3305..e7e5eda 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -778,8 +778,7 @@ void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg) ("Source Files", "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp" "|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$"); - this->AddSourceGroup("Header Files", - "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$"); + this->AddSourceGroup("Header Files", CM_HEADER_REGEX); this->AddSourceGroup("CMake Rules", "\\.rule$"); this->AddSourceGroup("Resources", "\\.plist$"); this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$"); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 4c4a53f..c6469f2 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -236,9 +236,9 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath()); // Add a dependency on the link definitions file, if any. - if(!this->GeneratorTarget->ModuleDefinitionFile.empty()) + if(!this->ModuleDefinitionFile.empty()) { - result.push_back(this->GeneratorTarget->ModuleDefinitionFile); + result.push_back(this->ModuleDefinitionFile); } return result; @@ -339,6 +339,10 @@ cmNinjaTargetGenerator depfile = "$out.d"; cmSystemTools::ReplaceString(depfileFlagsStr, "<DEPFILE>", depfile.c_str()); + cmSystemTools::ReplaceString(depfileFlagsStr, "<OBJECT>", + "$out"); + cmSystemTools::ReplaceString(depfileFlagsStr, "<CMAKE_C_COMPILER>", + this->GetMakefile()->GetDefinition("CMAKE_C_COMPILER")); flags += " " + depfileFlagsStr; } vars.Flags = flags.c_str(); @@ -405,6 +409,11 @@ cmNinjaTargetGenerator { this->WriteObjectBuildStatement(*si); } + if(!this->GeneratorTarget->ModuleDefinitionFile.empty()) + { + this->ModuleDefinitionFile = this->ConvertToNinjaPath( + this->GeneratorTarget->ModuleDefinitionFile.c_str()); + } { // Add object library contents as external objects. @@ -505,7 +514,7 @@ void cmNinjaTargetGenerator ::AddModuleDefinitionFlag(std::string& flags) { - if(this->GeneratorTarget->ModuleDefinitionFile.empty()) + if(this->ModuleDefinitionFile.empty()) { return; } @@ -522,6 +531,6 @@ cmNinjaTargetGenerator // vs6's "cl -link" pass it to the linker. std::string flag = defFileFlag; flag += (this->LocalGenerator->ConvertToLinkReference( - this->GeneratorTarget->ModuleDefinitionFile.c_str())); + this->ModuleDefinitionFile.c_str())); this->LocalGenerator->AppendFlags(flags, flag.c_str()); } diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index f639116..b64ce1e 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -118,6 +118,9 @@ private: cmLocalNinjaGenerator* LocalGenerator; /// List of object files for this target. cmNinjaDeps Objects; + + // The windows module definition source file (.def), if any. + std::string ModuleDefinitionFile; }; #endif // ! cmNinjaTargetGenerator_h diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 0d0d80c..ca27530 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -20,6 +20,9 @@ #include <cmsys/Terminal.h> #include <string.h> +#if defined(__APPLE__) +#include <unistd.h> +#endif #include "cmQtAutomoc.h" @@ -202,13 +205,20 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) cmMakefile::ScopePushPop varScope(makefile); static_cast<void>(varScope); - makefile->AddDefinition("_moc_target_name", automocTargetName.c_str()); - makefile->AddDefinition("_moc_incs", _moc_incs.c_str()); - makefile->AddDefinition("_moc_defs", _moc_defs.c_str()); - makefile->AddDefinition("_moc_compile_defs", _moc_compile_defs.c_str()); - makefile->AddDefinition("_moc_options", _moc_options.c_str()); - makefile->AddDefinition("_moc_files", _moc_files.c_str()); - makefile->AddDefinition("_moc_headers", _moc_headers.c_str()); + makefile->AddDefinition("_moc_target_name", + cmLocalGenerator::EscapeForCMake(automocTargetName.c_str()).c_str()); + makefile->AddDefinition("_moc_incs", + cmLocalGenerator::EscapeForCMake(_moc_incs.c_str()).c_str()); + makefile->AddDefinition("_moc_defs", + cmLocalGenerator::EscapeForCMake(_moc_defs.c_str()).c_str()); + makefile->AddDefinition("_moc_compile_defs", + cmLocalGenerator::EscapeForCMake(_moc_compile_defs.c_str()).c_str()); + makefile->AddDefinition("_moc_options", + cmLocalGenerator::EscapeForCMake(_moc_options.c_str()).c_str()); + makefile->AddDefinition("_moc_files", + cmLocalGenerator::EscapeForCMake(_moc_files.c_str()).c_str()); + makefile->AddDefinition("_moc_headers", + cmLocalGenerator::EscapeForCMake(_moc_headers.c_str()).c_str()); makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); @@ -340,8 +350,9 @@ void cmQtAutomoc::WriteOldMocDefinitionsFile(const char* targetDirectory) std::fstream outfile; outfile.open(filename.c_str(), std::ios::out | std::ios::trunc); - outfile << "set(AM_OLD_MOC_DEFINITIONS \"" - << this->Join(this->MocDefinitions, ' ') << "\")\n"; + outfile << "set(AM_OLD_MOC_DEFINITIONS " + << cmLocalGenerator::EscapeForCMake( + this->Join(this->MocDefinitions, ' ').c_str()) << ")\n"; outfile.close(); } diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 55147e1..ae01274 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -116,4 +116,7 @@ private: std::vector<std::string> Depends; }; +// TODO: Factor out into platform information modules. +#define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$" + #endif diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index a516cbc..cfa9976 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -847,9 +847,10 @@ void cmTarget::DefineProperties(cmake *cm) cm->DefineProperty ("SUFFIX", cmProperty::TARGET, - "What comes after the library name.", + "What comes after the target name.", "A target property that can be set to override the suffix " - "(such as \".so\") on a library name."); + "(such as \".so\" or \".exe\") on the name of a library, module or " + "executable."); cm->DefineProperty ("TYPE", cmProperty::TARGET, diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 107c2e7..423a46a 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2012) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 03) +SET(KWSYS_DATE_STAMP_MONTH 04) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 26) +SET(KWSYS_DATE_STAMP_DAY 10) diff --git a/Tests/ModuleDefinition/CMakeLists.txt b/Tests/ModuleDefinition/CMakeLists.txt index b463a3c..a30f643 100644 --- a/Tests/ModuleDefinition/CMakeLists.txt +++ b/Tests/ModuleDefinition/CMakeLists.txt @@ -4,6 +4,14 @@ project(ModuleDefinition C) # Test .def file source recognition for DLLs. add_library(example_dll SHARED example_dll.c example_dll.def) +# Test generated .def file. +add_custom_command(OUTPUT example_dll_gen.def + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/example_dll_gen.def.in + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/example_dll_gen.def.in + ${CMAKE_CURRENT_BINARY_DIR}/example_dll_gen.def + ) +add_library(example_dll_gen SHARED example_dll_gen.c example_dll_gen.def) + # Test /DEF:<file> flag recognition for VS. if(MSVC OR "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") add_library(example_dll_2 SHARED example_dll_2.c) @@ -16,7 +24,7 @@ endif() # Test .def file source recognition for EXEs. add_executable(example_exe example_exe.c example_exe.def) set_property(TARGET example_exe PROPERTY ENABLE_EXPORTS 1) -target_link_libraries(example_exe example_dll ${example_dll_2}) +target_link_libraries(example_exe example_dll example_dll_gen ${example_dll_2}) # Test linking to the executable. add_library(example_mod_1 MODULE example_mod_1.c) diff --git a/Tests/ModuleDefinition/example_dll_gen.c b/Tests/ModuleDefinition/example_dll_gen.c new file mode 100644 index 0000000..be5d1ee --- /dev/null +++ b/Tests/ModuleDefinition/example_dll_gen.c @@ -0,0 +1 @@ +int example_dll_gen_function(void) { return 0; } diff --git a/Tests/ModuleDefinition/example_dll_gen.def.in b/Tests/ModuleDefinition/example_dll_gen.def.in new file mode 100644 index 0000000..c489dbc --- /dev/null +++ b/Tests/ModuleDefinition/example_dll_gen.def.in @@ -0,0 +1,2 @@ +EXPORTS +example_dll_gen_function diff --git a/Tests/ModuleDefinition/example_exe.c b/Tests/ModuleDefinition/example_exe.c index c521b3a..253ae8b 100644 --- a/Tests/ModuleDefinition/example_exe.c +++ b/Tests/ModuleDefinition/example_exe.c @@ -1,4 +1,5 @@ extern int __declspec(dllimport) example_dll_function(void); +extern int __declspec(dllimport) example_dll_gen_function(void); #ifdef EXAMPLE_DLL_2 extern int __declspec(dllimport) example_dll_2_function(void); #endif @@ -7,6 +8,7 @@ int main(void) { return example_dll_function() + + example_dll_gen_function() + #ifdef EXAMPLE_DLL_2 example_dll_2_function() + #endif diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt index d255a5a..5e3686d 100644 --- a/Tests/QtAutomoc/CMakeLists.txt +++ b/Tests/QtAutomoc/CMakeLists.txt @@ -8,7 +8,7 @@ include(UseQt4) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -add_definitions(-DFOO) +add_definitions(-DFOO -DSomeDefine="Barx") # enable relaxed mode so automoc can handle all the special cases: set(CMAKE_AUTOMOC_RELAXED_MODE TRUE) |