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

cmake _CORRADE_INCLUDE_DIR and _CORRADE_CONFIGURE_FILE missing #68

Closed
jonasreitemeyer opened this issue Jun 18, 2019 · 6 comments
Closed

Comments

@jonasreitemeyer
Copy link

Hi mosra,

I followed the manual build and install instructions for magnum and corrade. Afterwards i tried building the object picking example also following the instructions.

I get the following cmake error message:

CMake Error at /usr/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Corrade (missing: CORRADE_INCLUDE_DIR
  _CORRADE_CONFIGURE_FILE)
Call Stack (most recent call first):
  /usr/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake/Corrade/FindCorrade.cmake:278 (find_package_handle_standard_args)
  /usr/local/share/cmake/Corrade/CorradeConfig.cmake:26 (include)
  /usr/local/share/cmake/Magnum/FindMagnum.cmake:218 (find_package)
  /usr/local/share/cmake/Magnum/MagnumConfig.cmake:26 (include)
  CMakeLists.txt:32 (find_package)


-- Configuring incomplete, errors occurred!

Im working on a Void Linux machine. Probably i forgot sth but i dont know what.

Greetings
jonas

PS: Thanks for the great introduction you gave at the LMU a few weeks ago.

@mosra
Copy link
Owner

mosra commented Jun 20, 2019

Hi and thanks!

sorry for the slightly late reply -- this notification fell through the cracks. Looks like you're installing to the default location on Linux, which is /usr/local, but for some weird reason CMake is not consistent and doesn't look there when searching for packages -- this is a long-standing annoyance of CMake and you kinda have to live with that. You have two options:

  • either point CMAKE_INSTALL_PREFIX to /usr when building both Corrade and Magnum (cmake . -DCMAKE_INSTALL_PREFIX=/usr), but that'll pollute your system directories (in this case I'm usually going the extra step and building an installable package, however I have no Void Linux packaging experience myself so can't help there)
  • or pass -DCMAKE_PREFIX_PATH=/usr/local to CMake when building the examples. That'll make it look in the correct place and avoid this error.

Hmm, actually -- it's interesting that you managed to build & install Magnum without hitting the same error 🤔 In some cases it worked for me to just re-run cmake second time with the same parameters, somehow the second time it was able to convince itself to find the stuff correctly. But try the two options above first, if you aren't doing those already.

Hope this helps! :)

@mosra mosra added this to the 2019.0b milestone Jun 20, 2019
@jonasreitemeyer
Copy link
Author

Ok, i'll do that, thanks. :)
In the meanwhile i tried building it on windows and it seems that the current Microsoft compiler doesn't like some of your code. Should i create a new issue for that or are you already aware?

Tried building with Microsoft (R)-Build-Engine, Version 16.1.76+g14b0a930a7 for .NET Framework

Example errors:

corrade\src\Corrade\Utility\TweakableParser.cpp(40,30): error C2666:  '+': 2 overloads have sim
ilar conversions


Corrade\Utility\TweakableParser.cpp(40,35): error C2440:  'return': cannot convert
from 'initializer list' to 'std::pair<const char *,int>'

@mosra
Copy link
Owner

mosra commented Jun 22, 2019

Is that with VS 2019? Sorry about that, it's on my list of things to fix -- right now you'd need to enable MSVC2017_COMPATIBILITY to make it working. See e.g. mosra/magnum#343 for details.

@jonasreitemeyer
Copy link
Author

That worked, thanks.
Now I got a very similar issue as on void linux.
I set the install prefix of Corrade and Magnum to /Sys/Bin/. Building Magnum worked so far by setting the DCMAKE_PREFIX_PATH to C:/Sys/bin. Trying to build the picking example now, the following error occurs:

-- Building for: Visual Studio 16 2019
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Corrade (missing: CORRADE_INCLUDE_DIR
  _CORRADE_CONFIGURE_FILE)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Sys/bin/share/cmake/Corrade/FindCorrade.cmake:278 (find_package_handle_standard_args)
  C:/Sys/bin/share/cmake/Corrade/CorradeConfig.cmake:26 (include)
  C:/Sys/bin/share/cmake/Magnum/FindMagnum.cmake:220 (find_package)
  C:/Sys/bin/share/cmake/Magnum/MagnumConfig.cmake:26 (include)
  CMakeLists.txt:38 (find_package)


-- Configuring incomplete, errors occurred!

I tried setting the DCMAKE_PREFIX_PATH:

set(DCMAKE_PREFIX_PATH C:/Sys/bin)

I don't understand why building Magnum worked and building the examples not.

@mosra
Copy link
Owner

mosra commented Jun 22, 2019

It's CMAKE_PREFIX_PATH, not DCMAKE_PREFIX_PATH -- the command-line syntax is -D<var>=<value> ;)

Besides that, doing set(CMAKE_PREFIX_PATH C:/Sys/bin) in your CMakeLists makes it tied to your particular installation, so it's better to set that either on the command line, using CMake GUI, or creating a batch file to run the cmake command with all desired parameters.

@jonasreitemeyer
Copy link
Author

I finally got it working, thank you very much for the private support :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants