[CMake] Failure to generate correct output name in visual studio

J Decker d3ck0r at gmail.com
Wed Nov 16 12:16:16 EST 2011


On Wed, Nov 16, 2011 at 3:46 AM, David Cole <david.cole at kitware.com> wrote:
> If you end the name in a ".", or set the suffix to ".", does it
> produce a file like you want? Or does it still append "dll"?
>
That's a good idea - if I set the project name to 'something.' I do
get the right output (the static export library is something..lib

If I set the suffix to '.' It generates 'something.' and the library
'somthing.lib' but also throws the warning(actually both ways throw
this warning) :

C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5):
warning MSB8012: TargetExt(.) does not match the Linker's OutputFile
property value (). This may cause your project to build incorrectly.
To correct this, please make sure that $(OutDir), $(TargetName) and
$(TargetExt) property values match the value specified in
%(Link.OutputFile).

This solves it for windows, but then under linux the file will have a
'.' in the name....

>
> On Wed, Nov 16, 2011 at 2:06 AM, J Decker <d3ck0r at gmail.com> wrote:
>> (Visual studio bug actually - as I was trying to find the actual
>> difference in the output, and finding none, I have to assume that
>> somehow visual studio is causing the addtion of .dll on a project
>> without a '.' in it )
>>
>> Using visual studio 2010 as a generator...
>>
>> The following fails to find the library output, which should be
>> 'something'  but gets generated as 'something.dll' and 'something.lib'
>> in the project properties it shows linker output as
>> $(OutDir)$(TargetName)$(TargetExt)
>>
>>
>> ADD_LIBRARY( something SHARED sourcs.c )
>>
>> SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
>>                  SUFFIX ""
>>                  PREFIX ""
>> )
>>
>> install( TARGETS something
>>        RUNTIME DESTINATION bin/\${CMAKE_INSTALL_CONFIG_NAME}
>>        LIBRARY DESTINATION bin/\${CMAKE_INSTALL_CONFIG_NAME}
>>        ARCHIVE DESTINATION lib/\${CMAKE_INSTALL_CONFIG_NAME} )
>>
>>
>>
>> This is fixed if there is a dot in the name.
>>
>> ADD_LIBRARY( something.module SHARED sourcs.c )
>> .....
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>


More information about the CMake mailing list