Mac install error in file generate_iso_language_codes.cmake

#20 · closed · 7 comments

View on GitHub ↗

buckmanhands

This may be a Mac only issue, but it is not something that a Mac user can add a symlink to fix because the location is SIP protected and cannot be changed even with the use of sudo. It may be that on a linux machine this location works, I would recommend adding a try/catch here and looking in both places if this file is not doing this in error. If this and the other error were fixed I would be able to complete the Brew Formulae that you link to on the cpp-utilities readme and make installing on a Mac really easy. This file: generate_iso_language_codes.cmake looks for a file to include during compiling at this location: `usr/share/iso-codes/json` on a Mac the actual location is in: ` usr/local/share/iso-codes/json`

Comments

Martchus

You can just specify the path by setting the CMake variable LANGUAGE_FILE_ISO_639_2. Nothing is hard coded here - the path under usr/share is just a default.

buckmanhands

Great, thanks!

Martchus

I updated the build instructions to make it more obvious how to specify this path.

buckmanhands

So I tried what you said and still got the same error. Here are the two cmake commands I tried: cmake ENABLE_THREAD_LOCAL=OFF \ USE_STANDARD_FILESYSTEM=OFF \ LANGUAGE_FILE_ISO_639_2="/usr/local/share/iso-codes/json/iso_639-2.json" \ -DCMAKE_CXX_FLAGS="-std=c++17" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="/usr/local" \ "/Users/oldfaithful/Local/tageditor/tagparser" cmake ENABLE_THREAD_LOCAL=OFF \ USE_STANDARD_FILESYSTEM=OFF \ LANGUAGE_FILE="/usr/local/share/iso-codes/json/iso_639-2.json" \ -DCMAKE_CXX_FLAGS="-std=c++17" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="/usr/local" \ "/Users/oldfaithful/Local/tageditor/tagparser"

buckmanhands

Finally figured it out. You have to add -D to your arguments. `-DLANGUAGE_FILE_ISO_639_2="/usr/local/share/iso-codes/json/iso_639-2.json"` Made a lot more sense once I understood this. Lots of places in the docs where you either leave -D off, or show it. I got confused. Now I pretty much see that -D is essential to cmake flags.

Martchus

When I say "add …" to the CMake flags I use `-D…` because that's the flag. When I say "set CMake variable …" than I omit it because the `-D` isn't actually part of the variable name. Maybe I should be more consistent and just use the first version.

buckmanhands

Consistency would help the noobs. Now that I know I just do it properly.