Re: [CMake] How to place .dll and .lib in different places?

2007-08-27 Thread Luigi Calori

Alexander Neundorf wrote:


On Monday 27 August 2007 09:00, Luigi Calori wrote:
 


Alexander Neundorf wrote:
   


On Monday 27 August 2007 06:08, Luigi Calori wrote:
 


I have the problem of placing, at build time .lib in one folder (lib)
and .dll in another (bin)
One solution is to add POST_BUILD copy commands, but i would prefer not.
I have also been suggested to use
SET_TARGET_PROPERTIES ...  PROPERTIES PREFIX
being lib and bin sibling, this hack seem to work:

SET(LIBRARY_OUTPUT_PATH )
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/")


Is it "supported" or works by chances?

I ask, because, I have also tried
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/lib")

to being able to have
.lib in lib/Release
d.lib in lib/Debug

and

lib.dll and libd.dll both in bin

Unfortunately this is working in debug but not in release mode.
   


Do you really need this in the build tree or only in the install tree ?
Then you should use something like this:
 


We already have it in the install tree, and is working properly.
I was trying to have the same structure on the build tree without
installing, and possibly without adding POST_BUILD custom commands
   



This is not supported.
Do you really need this ?
 

I' ve been asked by the main developer to assemble a build layout that 
was resembling the install layout, so to being able to let users to test 
and play without installing.
I found on the docs that there is a TARGET property called IMPORT_PREFIX 
that can direct the placement of .lib files.
I have found that is possible to use the ../ to specify placement 
outside Debug and Release
The problem comes when I want  to use the library created with something 
like
   TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug 
"${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
It seems that in debug mode, the names are expanded based on the target 
name while in release they are taken fron the .dll stuff (PREFIX)


Is it possible that this is related to me using .. in PREFIX?

Thanks
  Luigi


Alex


 



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to place .dll and .lib in different places?

2007-08-27 Thread Alexander Neundorf
On Monday 27 August 2007 06:08, Luigi Calori wrote:
> I have the problem of placing, at build time .lib in one folder (lib)
> and .dll in another (bin)
> One solution is to add POST_BUILD copy commands, but i would prefer not.
> I have also been suggested to use
> SET_TARGET_PROPERTIES ...  PROPERTIES PREFIX
> being lib and bin sibling, this hack seem to work:
>
> SET(LIBRARY_OUTPUT_PATH )
> SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/")
>
>
> Is it "supported" or works by chances?
>
> I ask, because, I have also tried
> SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/lib")
>
> to being able to have
> .lib in lib/Release
> d.lib in lib/Debug
>
> and
>
> lib.dll and libd.dll both in bin
>
> Unfortunately this is working in debug but not in release mode.

Do you really need this in the build tree or only in the install tree ?
Then you should use something like this:

install(TARGETS ${LIB_NAME} RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] How to place .dll and .lib in different places?

2007-08-27 Thread Luigi Calori
I have the problem of placing, at build time .lib in one folder (lib) 
and .dll in another (bin)

One solution is to add POST_BUILD copy commands, but i would prefer not.
I have also been suggested to use
SET_TARGET_PROPERTIES ...  PROPERTIES PREFIX
being lib and bin sibling, this hack seem to work:

SET(LIBRARY_OUTPUT_PATH )
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/")


Is it "supported" or works by chances?

I ask, because, I have also tried
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/lib")

to being able to have
.lib in lib/Release
d.lib in lib/Debug

and

lib.dll and libd.dll both in bin

Unfortunately this is working in debug but not in release mode.

Thanks in advance

Luigi



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake