Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit for Mac: runtime/cpp_stl/CMakeLists.txt #27

Merged
merged 1 commit into from
Jun 18, 2019

Conversation

idoimaging
Copy link

Hi,

On the Mac I was not able to link the symbols iconv, iconv_open and iconv_close called in runtime/cpp_stl/kaitaistream.cpp. This was due to the find_library ICONV_LIBRARIES line in CMakeLists.txt looking for libiconv, when on the Mac it needs to look for iconv. The same line looks for c so it was finding /usr/lib/libc and not /usr/lib/libiconv, which is installed. libc of course can not resolve the iconv symbols. I took out c and added iconv.
I also added two lines to install the headers in a kaitai subdirectory (as the generated C++ files look for kaitai/kaitaistruct.h). One line to add PUBLIC_HEADER to set_target_properties, and one line in the install target to install the two .h files.
Tested on Mac and Linux but not Windows.

@GreyCat GreyCat merged commit e0f15f9 into kaitai-io:master Jun 18, 2019
@GreyCat
Copy link
Member

GreyCat commented Jun 18, 2019

I'm merging this in, but please note that this CMakeLists.txt is effectively unmaintained and not really supported. See also #22 for gory details.

@idoimaging
Copy link
Author

Got it, thanks. I should have read PR 22 earlier. I made only a few changes and I hope it will help someone else with C++/libiconv issues especially on the Mac.

@idoimaging idoimaging deleted the cmakelists branch June 18, 2019 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants