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

David Cole david.cole at kitware.com
Wed Nov 16 06:46:17 EST 2011


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"?


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