OSVR / OSVR-Core

The core libraries, applications, and plugins of the OSVR software platform.
Apache License 2.0
328 stars 124 forks source link

set_property could not find TARGET jsoncpp_lib. #504

Closed manuel-masiello closed 7 years ago

manuel-masiello commented 7 years ago

Hello,

I can't compile the core : ( I have this error:

16:28 $ cmake .. -- Git reports version 0.6-1363-g92d6d9d CMake Error at cmake/FindJsonCpp.cmake:85 (set_property): set_property could not find TARGET jsoncpp_lib. Perhaps it has not yet been created. Call Stack (most recent call first): cmake/FindJsonCpp.cmake:102 (_jsoncpp_apply_map_config) CMakeLists.txt:221 (find_package)

-- Boost version: 1.58.0 -- Found the following Boost libraries: -- thread -- system -- date_time -- chrono -- program_options -- filesystem -- atomic CMake Error at cmake/cmake-4.0.0-modules/RequireOutOfSourceBuild.cmake:41 (message): You must set a binary directory that is different from your source directory. You might consider /home/manuel/foobot/OSVR/OSVR-Core/build or /home/manuel/foobot/OSVR/build-osvrcore Call Stack (most recent call first): cmake/cmake-4.0.0-modules/autoinclude.cmake:13 (include) cmake/UseBackportedModules.cmake:92 (include) vendor/vrpn/CMakeLists.txt:15 (include)

But jsoncpp is installed:

16:22 $ sudo make install [ 44%] Built target jsoncpp_lib_static [ 66%] Built target jsontestrunner_exe [100%] Built target jsoncpp_test Install the project... -- Install configuration: "Release" -- Up-to-date: /usr/local/lib/pkgconfig/jsoncpp.pc -- Up-to-date: /usr/local/lib/cmake/jsoncpp/jsoncppConfig.cmake -- Up-to-date: /usr/local/lib/cmake/jsoncpp/jsoncppConfig-release.cmake -- Up-to-date: /usr/local/lib/x86_64-linux-gnu/libjsoncpp.a -- Up-to-date: /usr/local/include/jsoncpp/json/assertions.h -- Up-to-date: /usr/local/include/jsoncpp/json/autolink.h -- Up-to-date: /usr/local/include/jsoncpp/json/config.h -- Up-to-date: /usr/local/include/jsoncpp/json/features.h -- Up-to-date: /usr/local/include/jsoncpp/json/forwards.h -- Up-to-date: /usr/local/include/jsoncpp/json/json.h -- Up-to-date: /usr/local/include/jsoncpp/json/reader.h -- Up-to-date: /usr/local/include/jsoncpp/json/value.h -- Up-to-date: /usr/local/include/jsoncpp/json/version.h -- Up-to-date: /usr/local/include/jsoncpp/json/writer.h

Where I failed?

My configuration:

rpavlik commented 7 years ago

First of all, be sure that you're following the instructions here:

CMake Error at cmake/cmake-4.0.0-modules/RequireOutOfSourceBuild.cmake:41 (message): You must set a binary directory that is different from your source directory. You might consider /home/manuel/foobot/OSVR/OSVR-Core/build or /home/manuel/foobot/OSVR/build-osvrcore

Secondly, that is really rather strange. Can you attach or otherwise upload (to a gist, perhaps) the /usr/local/lib/cmake/jsoncpp/ files? Presumably in your custom build of jsoncpp, it's not generating the CMake config the way we expect. What source are you using for your jsoncpp? (git describe --tags in the source dir should help, along with what repo you cloned)

Thirdly, you shouldn't actually need to build jsoncpp from source unless you have a particular reason you want to - all known issues with using distribution-provided packages have been resolved. (but I do want to track down what's weird about your jsoncpp build that is confusing the cmake module)

On Fri, Dec 2, 2016 at 11:04 AM manuel-masiello notifications@github.com wrote:

Hello,

I can't compile the core : ( I have this error:

`16:28 $ cmake .. -- Git reports version 0.6-1363-g92d6d9d CMake Error at cmake/FindJsonCpp.cmake:85 (set_property): set_property could not find TARGET jsoncpp_lib. Perhaps it has not yet been created. Call Stack (most recent call first): cmake/FindJsonCpp.cmake:102 (_jsoncpp_apply_map_config) CMakeLists.txt:221 (find_package)

-- Boost version: 1.58.0 -- Found the following Boost libraries: -- thread -- system -- date_time -- chrono -- program_options -- filesystem -- atomic CMake Error at cmake/cmake-4.0.0-modules/RequireOutOfSourceBuild.cmake:41 (message): You must set a binary directory that is different from your source directory. You might consider /home/manuel/foobot/OSVR/OSVR-Core/build or /home/manuel/foobot/OSVR/build-osvrcore Call Stack (most recent call first): cmake/cmake-4.0.0-modules/autoinclude.cmake:13 (include) cmake/UseBackportedModules.cmake:92 (include) vendor/vrpn/CMakeLists.txt:15 (include)`

But jsoncpp is installed:

16:22 $ sudo make install [ 44%] Built target jsoncpp_lib_static [ 66%] Built target jsontestrunner_exe [100%] Built target jsoncpp_test Install the project... -- Install configuration: "Release" -- Up-to-date: /usr/local/lib/pkgconfig/jsoncpp.pc -- Up-to-date: /usr/local/lib/cmake/jsoncpp/jsoncppConfig.cmake -- Up-to-date: /usr/local/lib/cmake/jsoncpp/jsoncppConfig-release.cmake -- Up-to-date: /usr/local/lib/x86_64-linux-gnu/libjsoncpp.a -- Up-to-date: /usr/local/include/jsoncpp/json/assertions.h -- Up-to-date: /usr/local/include/jsoncpp/json/autolink.h -- Up-to-date: /usr/local/include/jsoncpp/json/config.h -- Up-to-date: /usr/local/include/jsoncpp/json/features.h -- Up-to-date: /usr/local/include/jsoncpp/json/forwards.h -- Up-to-date: /usr/local/include/jsoncpp/json/json.h -- Up-to-date: /usr/local/include/jsoncpp/json/reader.h -- Up-to-date: /usr/local/include/jsoncpp/json/value.h -- Up-to-date: /usr/local/include/jsoncpp/json/version.h -- Up-to-date: /usr/local/include/jsoncpp/json/writer.h

Where I failed?

My configuration:

  • Linux version 4.4.0-51-generic (buildd@lcy01-08) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #72 https://github.com/OSVR/OSVR-Core/issues/72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016
  • cmake version 3.5.2

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OSVR/OSVR-Core/issues/504, or mute the thread https://github.com/notifications/unsubscribe-auth/AADuyYkHT3v12DN0I6GgxY-QuScqepT9ks5rEE-AgaJpZM4LCxXU .

-- Ryan A. Pavlik, Ph.D. CTO - OSVR Platform Sensics, Inc. www.sensics.com

--

Latest news and blog posts (subscribe here http://sensics.com/subscribe-to-our-mailing-list/ to get weekly updates):

Nov 28: VRguy podcast: Tero Sarkkinen, CEO of Basemark on VR performance measurements http://sensics.com/vrguy-podcast-episode-21-taro-sarkkinen-ceo-basmark/

Nov 23: OSVR now available on Steam http://sensics.com/osvr-now-available-steam/

Nov 1: Sensics Partners with InvenSense to Bring Precise and Advanced Motion Tracking to OSVR http://sensics.com/sensics-partners-invensense-bring-precise-advanced-motion-tracking-osvr/

manuel-masiello commented 7 years ago

Hello Ryan,

Thx for your help :-)

  1. Please find a copy/past of my command:

    ✔ ~/foobot/OSVR/OSVR-Core/build [master|✔] 18:29 $ cmake ..

I get the OSVR-Core/ from: git clone --recursive https://github.com/OSVR/OSVR-Core.git

  1. I'm using this source for jsoncpp: git clone --recursive https://github.com/VRPN/jsoncpp

I make:

cmake .. -DJSONCPP_WITH_CMAKE_PACKAGE=ON -DJSONCPP_LIB_BUILD_SHARED=OFF -DCMAKE_CXX_FLAGS=-fPIC and sudo make install

✔ ~/foobot/OSVR/jsoncpp [0.y.z-updated|✔] 18:42 $ git describe svn-import-582-g5938467

Please find files here: https://gist.github.com/manuel-masiello/0d6eb99e371a341e55916d9e4d462a73

  1. Ok. This did not work with the package so I tried to compile...

Best regards, Manuel

gfrolov commented 7 years ago

@manuel-masiello ,

Since you're using sudo make install you might have permission issues later on where regular user won't be able to use it. I've ran into an issues like this before myself where I was building some things as superuser and others as regular. You can either try using sudo for everything, or re-compile jsoncpp without sudo (I think that's a better option, removing previously installed files), and then try to make OSVR-Core again.

0x1100 commented 7 years ago

You didn't fail, @manuel-masiello, the OSVR-Core build breaks if you compile JsonCPP as a static library because of a careless mistake in the custom FindJsonCpp.cmake. It has been broken for 2 months now. See #501 for the fix.

It's right here in the outputs:

16:22 $ sudo make install
[ 44%] Built target jsoncpp_lib_static
CMake Error at cmake/FindJsonCpp.cmake:85 (set_property):
set_property could not find TARGET jsoncpp_lib. Perhaps it has not yet
been created.
Call Stack (most recent call first):
cmake/FindJsonCpp.cmake:102 (_jsoncpp_apply_map_config)

The _jsoncpp_apply_map_config macro can't find TARGET jsoncpp_lib because it's supposed to be called with jsoncpp_lib_static.

Hidarii commented 7 years ago

Thanks a lot @0x1100, this solves the issue with cmake I had.

manuel-masiello commented 7 years ago

It's work with #501 !!! Thx you :-)