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

set_property could not find TARGET jsoncpp_lib. #504

Closed
manuel-masiello opened this issue Dec 2, 2016 · 6 comments
Closed

set_property could not find TARGET jsoncpp_lib. #504

manuel-masiello opened this issue Dec 2, 2016 · 6 comments

Comments

@manuel-masiello
Copy link

manuel-masiello commented Dec 2, 2016

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) ) Mac OS X port #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016
  • cmake version 3.5.2
@rpavlik
Copy link
Member

rpavlik commented Dec 2, 2016 via email

@manuel-masiello
Copy link
Author

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
Copy link
Contributor

gfrolov commented Dec 5, 2016

@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
Copy link

0x1100 commented Dec 9, 2016

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
Copy link

Hidarii commented Dec 16, 2016

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

@manuel-masiello
Copy link
Author

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

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

No branches or pull requests

5 participants