[Cmake] Re: windows .lib .dll output dirs

William A. Hoffman billlist at nycap.rr.com
Fri Sep 3 13:35:07 EDT 2004


You may want to use this cmake variable:

CMAKE_CFG_INTDIR

It expands out to $(IntDir) for visual studio 6 and 7, and
"." for unix and nmake.   


At 12:55 PM 9/3/2004, Clinton Stimpson wrote:
>I found a solution to my problem.  CMake has no support for this, but I was able to add post build commands that had the same effect.  If anyone is interested.  It uses visual studio macros so it automatically takes care of by debug vs. release libs and also that my debug libs and "_d" postfixes.
>
>
>MACRO(SET_LIBRARY_OUTPUTS target outputdir)
>IF(UNIX)
>SET(LIBRARY_OUTPUT_PATH "${outputdir}"/bin)
>ELSE(UNIX)
>ADD_CUSTOM_COMMAND(TARGET "${target}"
>                  POST_BUILD
>                  COMMAND ${CMAKE_COMMAND}
>                  ARGS -E copy $\(TargetPath\) "${outputdir}"/bin)
>
>ADD_CUSTOM_COMMAND(TARGET "${target}"
>                  POST_BUILD
>                  COMMAND ${CMAKE_COMMAND}
>                  ARGS -E copy $\(TargetDir\)/$\(TargetName\).lib "${outputdir}"/lib)
>ENDIF(UNIX)
>ENDMACRO(SET_LIBRARY_OUTPUTS)
>
>
>Clint
>
>
>Clinton Stimpson wrote:
>
>>I have a tree like this...
>>
>>topdir/
>>   lib/
>>   bin/
>>
>>and I want all .lib files to be put in the lib directory and all .dll files in the bin directory (both release and debug).
>>SET(CMAKE_DEBUG_POSTFIX "_d")  so all my debug libs are postfixed with _d.
>>
>>If I use
>>SET(LIBRARY_OUTPUT_PATH ${MYPROJ_BINARY_DIR}/bin)
>>then it works fine on Unix.
>>
>>But on Windows with project files, I get  topdir/bin/Debug and topdir/bin/Release and the libraries go in there.
>>I don't want Debug and Release subdirectories.
>>
>>Any ideas?
>>
>>Thanks,
>>Clint
>>
>
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake



More information about the Cmake mailing list