[CMake] Problem with shared libraries

Brad King brad.king at kitware.com
Thu Sep 15 08:45:30 EDT 2005


Marco Spatz wrote:
> Hi,
> 
> I found the reason for this behavior, and want to make sure, that what I 
> am doing is legal before submitting this to the bug tracker:
> 
> The reason is that we are changing the LIBRARY_OUTPUT_PATH several times 
> in the project, because we want to put each plugin lib in its own 
> directory.
> 
> For example:
> 
> set LIBRARY_OUTPUT_PATH to project/foo
> 
> build shared lib foo (now located in project/foo)
> 
> change LIBRARY_OUTPUT_PATH to project/bar
> 
> build shared lib bar
> 
> 
> CMake 2.2 seems to store foo like ($LIBRARY_OUTPUT_PATH/libfoo.so)
> 
> If bar needs to be linked to libfoo.so, the LIBRARY_OUTPUT_PATH has 
> changed, and the linker thinks libfoo.so must be in /project/bar/libfoo.so
> 
> Now again, is it ok to change the LIBRARY_OUTPUT_PATH during the project?

No.  It is meant to be one variable set at the top of the project and 
changeable by the user in the cache.  It is kind of like a "developer 
install".

There are still two bugs to report though:

1.) CMake should diagnose when the project changes LIBRARY_OUTPUT_PATH 
and warn.

2.) A feature request to be able to put targets in a specific output 
path with a target property.

-Brad


More information about the CMake mailing list