hjson/hjson-cpp

on linux libhjson.a should go in /usr/local/lib/ by default

bstarynk opened this issue · 2 comments

I am not a cmake expert (because I prefer omake to  cmake)

But on Linux, it is traditional to put libraries in /usr/local/lib per its filesystem hierarchy standard.

I don't understand why libjson.a is in /usr/local/lib/hjson; this is not a usual practice

The ugly workaround is to add a symlink:
ln -vs /usr/local/lib/hjson/libhjson.a /usr/local/lib/

Thanks

--
Basile Starynkevitch, Bourg La Reine, France
http://starynkevitch.net/Basile/index_en.html
basile@starynkevitch.net

Thanks for pointing that out, I work more in Windows than Linux, that's probably the biggest reason... But also because I was mostly thinking of using Hjson i CMake projects. There are a bunch of CMake files copied to the folder too, helping out with version selection. And if you set HJSON_VERSIONED_INSTALL to ON when installing with CMake, the version is included in the folder name, so that several versions can exist in parallel.

Perhaps I should make the CMake install always add a symlink, like in your example. So that it always points to the latest installed version, for projects that don't care about the version. I believe that is a common solution in Linux, at least my /usr/lib is full of symlinks. And I should change the default of HJSON_VERSIONED_INSTALL to ON.

I will keep OFF as default value for HJSON_VERSIONED_INSTALL. Versioned libs will still be placed in versioned folders, but when HJSON_VERSIONED_INSTALL is OFF the lib will now be placed in /usr/local/lib.