diff options
-rw-r--r-- | Modules/Platform/Windows-GNU.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackRPMGenerator.cxx | 15 | ||||
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 71 | ||||
-rw-r--r-- | Source/kwsys/kwsysDateStamp.cmake | 4 | ||||
-rw-r--r-- | Tests/Fortran/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/Fortran/world_gnu.def | 2 | ||||
-rw-r--r-- | Tests/Fortran/world_icl.def (renamed from Tests/Fortran/world.def) | 0 |
7 files changed, 84 insertions, 23 deletions
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") diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 5803959..0b0c6b1 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(); } 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 << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<projectDescription>\n" - "\t<name>" << name << "</name>\n" + "\t<name>" << this->EscapeForXML(name) << "</name>\n" "\t<comment></comment>\n" "\t<projects>\n" "\t</projects>\n" @@ -376,11 +376,10 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() "\t</natures>\n" ; - // TODO: refactor this + fout << "\t<linkedResources>\n"; // create linked resources if (this->IsOutOfSourceBuild) { - fout << "\t<linkedResources>\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</linkedResources>\n"; + for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::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</linkedResources>\n"; + fout << "</projectDescription>\n"; } @@ -551,14 +580,15 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const it != this->SrcLinkedResources.end(); ++it) { - fout << "<pathentry kind=\"src\" path=\"" << *it << "\"/>\n"; + fout << "<pathentry kind=\"src\" path=\"" << this->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 << "<pathentry kind=\"out\" path=\"" << *it << "\"/>\n"; + fout << "<pathentry kind=\"out\" path=\"" << this->EscapeForXML(*it) + << "\"/>\n"; } // add pre-processor definitions to allow eclipse to gray out sections @@ -1055,11 +1086,13 @@ void cmExtraEclipseCDT4Generator { fout << "\t\t<link>\n" - "\t\t\t<name>" << name << "</name>\n" + "\t\t\t<name>" + << cmExtraEclipseCDT4Generator::EscapeForXML(name) + << "</name>\n" "\t\t\t<type>2</type>\n" - "\t\t\t<location>" - << path - << "</location>\n" + "\t\t\t<locationURI>" + << cmExtraEclipseCDT4Generator::EscapeForXML(path) + << "</locationURI>\n" "\t\t</link>\n" ; } diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 8d4ad8b..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 22) +SET(KWSYS_DATE_STAMP_DAY 01) 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_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.def b/Tests/Fortran/world_icl.def index ead7710..ead7710 100644 --- a/Tests/Fortran/world.def +++ b/Tests/Fortran/world_icl.def |