MantisBT - CMake
View Issue Details
0010611CMakeCMakepublic2010-04-25 22:082010-11-09 22:57
Jarl Lindrud 
David Cole 
normalmajoralways
closedfixed 
CMake-2-8 
CMake 2.8.3CMake 2.8.3 
0010611: VS2010 generator doesn't handle executable names with periods.
The following CMakeLists.txt file:

PROJECT(AAA)
ADD_LIBRARY(AAA.BBB.CCC SHARED File1.cpp)

, when built with VS2010, will produce the executable AAA.dll, rather than AAA.BBB.CCC.dll.

I'm using cmake 2.8.1. I've tried the VS2008 generator and it does not have this problem.
No tags attached.
has duplicate 0011207closed David Cole CMake 2.8 does not generate output target name properly for VS 2010 generator. 
has duplicate 0010639closed David Cole Generating Visual Studio 2010 targets with a dot in its name fails 
has duplicate 0010040closed David Cole VS2010 generator does not handle project names containing periods ('.') 
Issue History
2010-04-25 22:08Jarl LindrudNew Issue
2010-04-26 06:38Daniel EmminizerNote Added: 0020397
2010-08-31 17:12David ColeStatusnew => assigned
2010-08-31 17:12David ColeAssigned To => David Cole
2010-08-31 17:58David ColeTarget Version => CMake 2.8.3
2010-09-06 11:16David ColeRelationship addedhas duplicate 0011207
2010-09-07 07:20d3x0rNote Added: 0022102
2010-09-08 14:21Bill HoffmanNote Added: 0022139
2010-09-09 16:56David ColeNote Added: 0022166
2010-09-09 16:56David ColeStatusassigned => resolved
2010-09-09 16:56David ColeResolutionopen => fixed
2010-09-09 17:07David ColeNote Added: 0022167
2010-10-06 14:14David ColeFixed in Version => CMake 2.8.3
2010-11-09 22:57Philip LowmanStatusresolved => closed
2010-12-14 18:55David ColeRelationship addedhas duplicate 0010639
2010-12-14 18:56David ColeRelationship addedrelated to 0010040
2010-12-17 12:52David ColeRelationship replacedhas duplicate 0010040

Notes
(0020397)
Daniel Emminizer   
2010-04-26 06:38   
I have experienced similar problems. The problem appears to be in cmVisualStudio10TargetGenerator.cxx. In cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(), the </TargetName> line should be changed to something like:

    *this->BuildFileStream << cmSystemTools::GetFilenameWithoutLastExtension(
      targetNameFull.c_str())
                           << "</TargetName>\n";


Additionally, the VS2010 generator is not saving the Project Name property either. This can be fixed by updating cmVisualStudio10TargetGenerator::Generate():

  (*this->BuildFileStream) << this->Platform << "</Platform>\n";
  // Begin Changes: Save <ProjectName>
  this->WriteString("<ProjectName>", 2);
  const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");
  if(!projLabel)
    (*this->BuildFileStream) << this->Name << "</ProjectName>\n";
  else
    (*this->BuildFileStream) << projLabel << "</ProjectName>\n";
  // End Changes
  this->WriteString("</PropertyGroup>\n", 1);


Hope this helps.
(0022102)
d3x0r   
2010-09-07 07:20   
Fixes in 'next' branch do not fix

   add_library( basename-sub-something-group SHARED whatever.c )
   SET_TARGET_PROPERTIES( bag-msg-core-server PROPERTIES
                  SUFFIX ""
                  PREFIX ""
   )

extension remains '.dll' instead of being blank.

(maybe instead of overriding all the internal parts 'targetname' 'targetfilename' etc, could just override the output path.
(0022139)
Bill Hoffman   
2010-09-08 14:21   
So, we are generating the files correctly:
    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">basename-sub-something-group</TargetName>
      <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></TargetExt>
      <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>


However, it seems that VS 2010 is not handling this correctly. Can you via the IDE GUI create a basename-sub-something-group.vcxproj file that does what you want?
(0022166)
David Cole   
2010-09-09 16:56   
This is fixed in CMake 'next' as of this commit:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e79e412e70cb439354df589d83d3878c4dbe62fc [^]

Thanks, Daniel, for noticing the absence of the PROJECT_LABEL property.
(0022167)
David Cole   
2010-09-09 17:07   
Bill and d3x0r,

As a work-around for the VS2010 problem with an *empty* suffix property, it appears you can say:
  SUFFIX "."

to force creation of an extensionless dll in VS 2010...

I have not verified whether or not this works with previous visual studio versions... but at least you can workaround it for now. (And if you must, you could conditionalize using "." for VS 2010 only...)