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

J Decker d3ck0r at gmail.com
Wed Nov 16 02:06:43 EST 2011


(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 )
.....


More information about the CMake mailing list