[CMake] Visual Studio 2010 generator broke?

J Decker d3ck0r at gmail.com
Sat Sep 25 15:13:03 EDT 2010


s/CMAKE_CURRENT_SOURCE_DIR/CMAKE_PROJECT_DIR/g  (my bad)

>
> Using the Visual Studio 2010 generator .obj files of sources which are
> not in the current directory are put into
> (build root)/${CMAKE_CURRENT_SOURCE_DIR}/Debug/<file.obj>

This is actually just 'Debug/<file>.obj' in the project file, but
since the project is in (build root)/${CMAKE_CURRENT_SOURCE_DIR}, it
inherits that part.   These really should target the same
${PROJECT_NAME}.dir/Debug/ that all other object files get built into.

(and yes, Debug is probably like ${CMAKE_BUILD_TYPE} )

> and files that are from sources outside of this are put into
> ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.dir/Debug/<file>.obj
>
> This would be fine, but since all Project()s use the same path
> '${CMAKE_CURRENT_SOURCE_DIR}/Debug/<file.obj>' depending on the build order
> it will build or not, and a clean build of any said project will get
> it to build.
>
>
> I can make some subdirectories which will ensure that the same common
> source is in a different subdirectory of the build output.
>


More information about the CMake mailing list