0

I am using boost::property_tree to read and write json files from a CMake C++ project. On machines I can install libjsoncpp and boost to the system, everything compiles, links, and works properly/as expected. However, I am now working on a machine I do not have root access to. Therefore I am compiling boost from source, and linking against it via CMake.

I am running into a problem where, it would seem, FindBoost.cmake is putting in a hard dependancy upon libjsoncpp.so

make[2]: *** No rule to make target /usr/lib64/libjsoncpp.so', needed bybin/myApp'. Stop.

I've tried building jsoncpp from source, and have tried adding the .a and .so to my cmake target_link_libraries command, but to no avail.

I'm not sure if this is related (or causing the issue somehow), but I am using ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK) as boost::log requires it for linking from module modules.

I absolutely cannot have lipjsoncpp.so installed in /usr/lib64. What should I do?

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
Chris
  • 1,532
  • 10
  • 19
  • 1
    I cannot find any library with hardcoded path in `FindBoost.cmake`. If you install jsoncpp on target machine and configure your application on that machine, then `find_package(Boost)` should either found all Boost libraries correctly, or failed to found them. Try to create [mcve](http://stackoverflow.com/help/mcve) and configure it(`cmake`) with `Boost_DEBUG` cmake variable set. – Tsyvarev Dec 01 '15 at 22:08
  • I'm starting to wonder if there is something screwy with my environment/cmake files. What you describe was what I would expect -- an atomic success/failure. I will try to make a mcve. Thanks for the sanity check. – Chris Dec 02 '15 at 15:39
  • 1
    Usually boost libraries don't depend on anything besides other things from boost. The [property tree docs](http://www.boost.org/doc/libs/1_59_0/doc/html/property_tree.html) imply that it has it's own JSON parser and not a dependency on jsoncpp. – legalize Dec 03 '15 at 18:44
  • you know, I think you're right. Their XML is a copy-paste of rapidXML, and I swear I read somewhere that the json implementation was jsoncpp. But I cannot find it the code. I must be loosing it... – Chris Dec 04 '15 at 19:48

0 Answers0