majintao0131 / yaml-cpp

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

Wrong includedir in yaml-cpp.pc.cmake #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Build and install yaml-cpp 0.2.6 (I have installed into 
/home/dukexar/src/work/lib).
2. Try to build an application which uses it.

What is the expected output? What do you see instead?

The Cflags are set to "-I${includedir}" in yaml-cpp.pc.cmake, which is 
"includedir=${prefix}/include/yaml-cpp" and translates into 
"-I/home/dukexar/src/work/lib/include/yaml-cpp".
/usr/bin/c++    -ggdb3 -Os -fno-omit-frame-pointer -minline-all-stringops -Wall 
-Wno-long-long -Wno-strict-aliasing -msse2 -mfpmath=sse -pedantic -pipe -fPIC 
-I/home/dukexar/src/work/ffs-example/parser/build 
-I/home/dukexar/src/work/ffs-example/parser 
-I/home/dukexar/src/work/ffs-example/parser/libs 
-I/home/dukexar/src/work/ffs-example/parser/build/libs -I/usr/local/include 
-I/home/dukexar/src/work/lib/include/yaml-cpp    -o 
CMakeFiles/parser.dir/process.cc.o -c 
/home/dukexar/src/work/ffs-example/parser/process.cc
In file included from 
/home/dukexar/src/work/ffs-example/parser/configuration.h:26,
                 from /home/dukexar/src/work/ffs-example/parser/process.h:24,
                 from /home/dukexar/src/work/ffs-example/parser/process.cc:18:
/home/dukexar/src/work/lib/include/yaml-cpp/yaml.h:9:29: error: 
yaml-cpp/parser.h: No such file or directory
/home/dukexar/src/work/lib/include/yaml-cpp/yaml.h:10:27: error: 
yaml-cpp/node.h: No such file or directory
/home/dukexar/src/work/lib/include/yaml-cpp/yaml.h:11:30: error: 
yaml-cpp/stlnode.h: No such file or directory
/home/dukexar/src/work/lib/include/yaml-cpp/yaml.h:12:31: error: 
yaml-cpp/iterator.h: No such file or directory
/home/dukexar/src/work/lib/include/yaml-cpp/yaml.h:13:30: error: 
yaml-cpp/emitter.h: No such file or directory
/home/dukexar/src/work/lib/include/yaml-cpp/yaml.h:14:33: error: 
yaml-cpp/stlemitter.h: No such file or directory
/home/dukexar/src/work/lib/include/yaml-cpp/yaml.h:15:33: error: 
yaml-cpp/exceptions.h: No such file or directory

I think that includedir should be "${prefix}/include" and users will have to 
#include <yaml-cpp/yaml.h> instead of simple #include <yaml.h>. The latter also 
clashes with C-bindings to YAML located somewhere in /usr/include/yaml.h

What version of the product are you using? On what operating system?

yaml-cpp 0.2.6.

$ uname -a
Linux ubuntu 2.6.32-30-generic #59-Ubuntu SMP Tue Mar 1 21:30:46 UTC 2011 
x86_64 GNU/Linux

$ c++ -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' 
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared 
--enable-multiarch --enable-linker-build-id --with-system-zlib 
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls 
--enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc 
--disable-werror --with-arch-32=i486 --with-tune=generic 
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu 
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)

$ find ~/src/work/lib/
/home/dukexar/src/work/lib/
/home/dukexar/src/work/lib/include
/home/dukexar/src/work/lib/include/yaml-cpp
/home/dukexar/src/work/lib/include/yaml-cpp/aliasmanager.h
/home/dukexar/src/work/lib/include/yaml-cpp/emitfromevents.h
/home/dukexar/src/work/lib/include/yaml-cpp/nodeimpl.h
/home/dukexar/src/work/lib/include/yaml-cpp/node.h
/home/dukexar/src/work/lib/include/yaml-cpp/mark.h
/home/dukexar/src/work/lib/include/yaml-cpp/traits.h
/home/dukexar/src/work/lib/include/yaml-cpp/exceptions.h
/home/dukexar/src/work/lib/include/yaml-cpp/dll.h
/home/dukexar/src/work/lib/include/yaml-cpp/graphbuilder.h
/home/dukexar/src/work/lib/include/yaml-cpp/eventhandler.h
/home/dukexar/src/work/lib/include/yaml-cpp/iterator.h
/home/dukexar/src/work/lib/include/yaml-cpp/noncopyable.h
/home/dukexar/src/work/lib/include/yaml-cpp/yaml.h
/home/dukexar/src/work/lib/include/yaml-cpp/emitter.h
/home/dukexar/src/work/lib/include/yaml-cpp/stlemitter.h
/home/dukexar/src/work/lib/include/yaml-cpp/null.h
/home/dukexar/src/work/lib/include/yaml-cpp/nodereadimpl.h
/home/dukexar/src/work/lib/include/yaml-cpp/stlnode.h
/home/dukexar/src/work/lib/include/yaml-cpp/anchor.h
/home/dukexar/src/work/lib/include/yaml-cpp/emittermanip.h
/home/dukexar/src/work/lib/include/yaml-cpp/nodeutil.h
/home/dukexar/src/work/lib/include/yaml-cpp/ostream.h
/home/dukexar/src/work/lib/include/yaml-cpp/parser.h
/home/dukexar/src/work/lib/include/yaml-cpp/ltnode.h
/home/dukexar/src/work/lib/include/yaml-cpp/anchordict.h
/home/dukexar/src/work/lib/include/yaml-cpp/conversion.h
/home/dukexar/src/work/lib/lib
/home/dukexar/src/work/lib/lib/libyaml-cpp.a
/home/dukexar/src/work/lib/lib/pkgconfig
/home/dukexar/src/work/lib/lib/pkgconfig/yaml-cpp.pc

Original issue reported on code.google.com by Duke...@gmail.com on 4 May 2011 at 11:40

GoogleCodeExporter commented 9 years ago
Thanks for the report! I don't use the .pc file, so I've never had a chance to 
test it.

Fixed, r484. Can you confirm that it works properly?

Original comment by jbe...@gmail.com on 29 May 2011 at 2:18