majintao0131 / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

No shared library is built #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The attached patch builds a shared library on Linux.

Original issue reported on code.google.com by ing...@exherbo.org on 30 Jun 2009 at 5:26

Attachments:

GoogleCodeExporter commented 9 years ago
And this patch adds pkg-config support, which makes nicer to depend on yaml-cpp 
in
other packages.

Original comment by ing...@exherbo.org on 30 Jun 2009 at 5:28

Attachments:

GoogleCodeExporter commented 9 years ago
If you run cmake with

cmake  -DBUILD_SHARED_LIBS=on /path/to/yaml-cpp

it should build a shared library. I'd rather not make it the default, because I 
like static libraries (but I'm ready to 
change my mind - why should we default to build a shared library?)

Original comment by jbe...@gmail.com on 3 Jul 2009 at 5:41

GoogleCodeExporter commented 9 years ago
I hadn't thought of that. But the resulting shared library has no versioning 
info.
This isn't an option for my Linux Packages. We may possibly use yaml-cpp in our
package manager, but evidently proper packaging of yaml-cpp is a first 
requirement
before that'll happen. :)

Shared libraries are the standard on Linux & by extension most UNIX platforms 
for
various reasons, do you really want me to list all of those? :)

Please hold off on the patch for now, I want to have a better look at how I 
handled
shared library versioning when I find the time...

Original comment by ing...@exherbo.org on 7 Jul 2009 at 9:17

GoogleCodeExporter commented 9 years ago
You've convinced me :)

I applied the shared library patch, but not the pkg-config one. First of all, 
${LIB_INSTALL_DIR} doesn't exist in 
the CMake file, so it just installs the .pc file to /pkgconfig. Since I don't 
use this system, I'm not sure what you 
want - is it supposed to install to, say, /usr/local/lib/pkgconfig?

Also, I'm not sure about installing extra stuff for users who might not want 
it. Is this common in other libraries?

Original comment by jbe...@gmail.com on 10 Jul 2009 at 4:10

GoogleCodeExporter commented 9 years ago
> I applied the shared library patch, but not the pkg-config one. First of all,
> ${LIB_INSTALL_DIR} doesn't exist in the CMake file, so it just installs the 
.pc
> file to /pkgconfig. Since I don't use this system, I'm not sure what you want 
- is
> it supposed to install to, say, /usr/local/lib/pkgconfig?

Thanks for catching! This must've been a relic from my initial libdir patch, 
which
used those variables, and I didn't update this patch when you committed a 
slightly
different patch. Sorry, fixed now!

> Also, I'm not sure about installing extra stuff for users who might not want 
it.
Is this common in other libraries?

Yes, this is the standard way to detect libraries on UNIX systems.
It's not supposed to be installed on non-UNIX. If I remember correctly you 
develop
on windows, attached patch shouldn't install anything extra for you, while it 
works
correctly for me.

Original comment by ing...@exherbo.org on 15 Jul 2009 at 8:22

Attachments:

GoogleCodeExporter commented 9 years ago
OK, I applied the patch. Also, the .pc.cmake file refers to @LIB_INSTALL_DIR@, 
which still doesn't exist :) So I 
defined that variable in the CMakeLists.txt file, which I assume is what you 
want.

I actually tri-develop - originally only in Windows, then in Linux for a while, 
and now primarily on a Mac. So in 
OS X it does install the .pc file, but it seems like it won't harm anything, 
being in its own little corner.

Original comment by jbe...@gmail.com on 15 Jul 2009 at 8:40

GoogleCodeExporter commented 9 years ago
Cool, thanks. And thanks for fixing my mistakes :/

Original comment by ing...@exherbo.org on 15 Jul 2009 at 10:18