Closed otegami closed 4 months ago
I haven't been able to check msgpack-c for a while due to a family bereavement.
Is this PR solve #1124 ? I mean if I merge this PR, both @saper and @otegami issue would be solved?
Thank you for addressing it every time. I tried to use this change in my project. It solves my issue although it's a little hard for you to check it. I'm so sorry. ref: https://github.com/otegami/groonga/pull/2
Let me confirm what you mean.
after #1125 is merged. (As far as you've checked)
Is that right?
It seems that github automatically edit the link on this comment.
Here is non linked the same text:
1. #1125 should be merged to cpp_master
2. #1125 solves #1124 (draft) too. So #1124 should be closed (without merge)
after #1125 is merged. (As far as you've checked)
I think that I misunderstand about #1124. https://github.com/msgpack/msgpack-c/issues/1128#issuecomment-2185686067 helps my understanding.
I will merge #1125 I keep #1124 as draft (not close)
Then, I will release the merged c_master as c-6.0.2.
If more fundamental solution is implemented (based on #1124), I will check it and merge it if it is better solution in the future. I would request help @otegami and @fumoboy007 at that time.
@redboltz Thank you for handling it. My understanding is the same as this comment https://github.com/msgpack/msgpack-c/issues/1128#issuecomment-2185686067 too. I'm so sorry my explanation wasn't clear enough mm
I would request help @otegami and @fumoboy007 at that time.
Sure. I think the current change in #1124 is a little bit. So I think we can handle it step by step to improve maintainability.
When
CMAKE_INSTALL_INCLUDEDIR
are set to absolute path or relative path, the header files is installed in unspecifed places. This leads to incorrect paths that prevent the compiler from locating necessary header files.How to reproduce
Configure msgpack-c with
-DCMAKE_INSTALL_PREFIX=/tmp/local
and-DCMAKE_INSTALL_INCLUDEDIR=specified-include
And then build and install msgpack-c.Compile
example/simple_c.c
using installed msgpack-c. The following error happens because the linker cannot find header files.Expected
Successfully compile
example/simple_c.c
using installed msgpack-c. We can execute simple_c like the following.Explain the problem in detail
The issue was caused by header files being installed under a uniform include directory, ignoring the specified
CMAKE_INSTALL_INCLUDEDIR
path. This resulted in incorrect paths during the installation process, causing the compiler to be unable to locate the necessary header files.For example, in the
How to reproduce
case, we expected that header files would be installed at/tmp/local/specified-include
because we passed-DCMAKE_INSTALL_PREFIX=/tmp/local
and-DCMAKE_INSTALL_INCLUDEDIR=specified-include
. And also, pkg-config expected this path too.However, these header files are installed under
/tmp/local/include/
, which is why the compiler cannot find the header files.Solution
The solution involves modifying the
CMakeLists.txt
to ensure that the header files are installed in the directories specified byCMAKE_INSTALL_INCLUDEDIR
.