msgpack / msgpack-c

MessagePack implementation for C and C++ / msgpack.org[C/C++]
Other
3.03k stars 883 forks source link

Add support for absolute CMAKE_INSTALL_*DIR #1118

Closed otegami closed 6 months ago

otegami commented 6 months ago

How to reproduce

% git switch -c c_master
% cmake -S . -B ../msgpack-c.build -DCMAKE_INSTALL_PREFIX=/tmp/local
% cmake --build ../msgpack-c.build
% cmake --install ../msgpack-c.build
% export PKG_CONFIG_PATH=/tmp/local/lib/pkgconfig:$PKG_CONFIG_PATH
% gcc -o simple_c example/simple_c.c $(pkg-config --cflags --libs msgpack-c)
In file included from include/msgpack/object.h:13,
                 from include/msgpack.h:17,
                 from example/simple_c.c:1:
include/msgpack/zone.h:13:10: fatal error: sysdep.h: No such file or directory
   13 | #include "sysdep.h"
      |          ^~~~~~~~~~
compilation terminated.`

Expected

% gcc -o simple_c example/simple_c.c $(pkg-config --cflags --libs msgpack-c)
% ./simple_c
93 01 c3 a7 65 78 61 6d 70 6c 65
[1, true, "example"]
otegami commented 6 months ago

I sincerely apologize. I mistakenly targeted the wrong destination when creating this pull request. I will close this Pull Request now because I'm still working on this. If I should do the additional things, could you tell me? 🙏