MantisBT - CMake
View Issue Details
0013576CMakeCMakepublic2012-10-05 17:142013-03-04 08:38
Anders Elfgren 
 
normalminoralways
closedno change required 
Visual Studio 2012 ProfessionalWindows7
CMake 2.8.9 
 
0013576: Empty CMAKE_BUILD_TYPE in VS2012
As part of my build step I'm copying a dll into a project's build folder like this:

ADD_CUSTOM_COMMAND(
    TARGET MyProject
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy ${DataLibrary_BINARY_DIR}/Release/DataLibrary.dll ${MyProject_BINARY_DIR}/${CMAKE_BUILD_TYPE}/datalibrary.dll
)

But the commands ends up looking like:

C:/work/pd_engine/local/cmake/vs2012/external/datalibrary/Release/DataLibrary.dll C:/work/pd_engine/local/cmake/vs2012/units/myproject//datalibrary.dll

Notice the //.
I assume this should happen at all times and as such should be easy to reproduce by simply trying to use CMAKE_BUILD_TYPE together with VS11.
No tags attached.
Issue History
2012-10-05 17:14Anders ElfgrenNew Issue
2012-10-05 17:45Rolf Eike BeerNote Added: 0031184
2012-10-05 18:44Anders ElfgrenNote Added: 0031187
2012-10-06 10:00Brad KingNote Added: 0031190
2012-10-06 10:00Brad KingStatusnew => resolved
2012-10-06 10:00Brad KingResolutionopen => no change required
2013-03-04 08:38Robert MaynardNote Added: 0032469
2013-03-04 08:38Robert MaynardStatusresolved => closed

Notes
(0031184)
Rolf Eike Beer   
2012-10-05 17:45   
Multi-configuration generators like MSVC do not have CMAKE_BUILD_TYPE available in this way. Maybe just set OUTPUT_DIRECTORY properties?
(0031187)
Anders Elfgren   
2012-10-05 18:44   
Oh, really? I could have sworn that it worked with VS2010, but I could be wrong. If this is the case, I can look into other means of doing the same thing.
(0031190)
Brad King   
2012-10-06 10:00   
From the documentation of CMAKE_BUILD_TYPE:

 http://www.cmake.org/cmake/help/v2.8.9/cmake.html#variable:CMAKE_BUILD_TYPE [^]
 "This variable is only supported for make based generators."

See comment 0009974:0029033 for an example of copying DLLs.
(0032469)
Robert Maynard   
2013-03-04 08:38   
Closing resolved issues that have not been updated in more than 4 months.