-
Notifications
You must be signed in to change notification settings - Fork 108
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
CMakeLists does not honor INSTALL_PREFIX for CMake modules #2
Comments
Thanks for the info. I tried installing all the modules into Have you any solution how to make them available even if not installed in root module path? Explicitly adding |
Hum... Indeed, it must be rename In which cases does it makes sense to use |
Just to make the issue in my initial report more clear: by relying on |
The admin rights is a problem I have frequently when installing on Windows and I circumvent that by making CMake module dir writable for given user. But I admit that it is not a solution at all :-) I'm advising users to copy and distribute
I searched around and indeed CMake packaging tutorial advises to install the TL;DR: After some thinking around I'm proposing this solution:
By the way, for installations without root privileges (i.e. to non-standard location) I found something called Package Registry. Didn't try it yet, but it might solve some issues. |
I'm probably missing something, but why would users bundle |
If Corrade isn't installed, bundled
When there is no bundled
My understanding of it is that serious projects needs to bundle all |
So, conclusion: CMake does not provide good support for distributing projects' configuration... :-) Sorry for bothering you with that :-/ To be frank, I've always avoided the issue by generating and installing Btw, SDL2 provides a |
No, sadly Anyway, thanks for the discussion. I will implement the "optional" solution described above to avoid the issue with root privileges. |
Should be done in 664e859. |
…abled. Until I made a fix for #2, KDevelop (and I hope also the other cool IDEs) was able to parse the macros in `UseCorrade.cmake` and extract targets and unit tests from calls to `corrade_add_test()`, among other things. When I moved these macros from CMake's root module dir and put them somewhere else, KDevelop wasn't able to find them anymore and thus the targets didn't get detected, severely reducing the IDE experience (i.e. no "one click" way to add new unit test target and run it through debugger, no rebuild is triggered before running the executable etc.). I can't expect KDevelop to reimplement `find_path()` command or interpret all the CMake scripts to guess `CMAKE_MODULE_DIR` value from which `UseCorrade.cmake` is included. Thus for now, until a better solution is found, when `WITH_FIND_MODULE` is enabled, all the CMake modules are installed into CMake's root module dir. This is completely transparent to the user, no modiication in depending projects is needed except for updating FindCorrade.cmake. But because this option is disabled by default, the majority of existing code shouldn't be affected.
CMake modules (
FindCorrade.cmake
) are installed inCMAKE_ROOT
:Installing in
CMAKE_ROOT
is not a good practise (only Kitware-reviewedFind
script are expected there).http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:find_package lists the paths search by
find_package
.I think a better option is
${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}/
The text was updated successfully, but these errors were encountered: