From fec3bdadd7cdba31912b553ab70386aa2b57dc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Aug 2014 11:21:09 +0200 Subject: [PATCH] doc: mention usage of CMAKE_INSTALL_RPATH and CMAKE_PREFIX_PATH. --- doc/building.dox | 20 ++++++++++++++------ doc/cmake.dox | 5 +++++ doc/getting-started.dox | 4 ++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index 423d52eb9..22471272f 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -78,6 +78,15 @@ can be built and installed using these four commands: See @ref building-features "below" for additional configuration options. +If you have the dependencies installed in non-standard location (other than +`/usr`, e.g. `/home/xyz/projects`), set `CMAKE_PREFIX_PATH` to that directory +to help CMake find them. You can enter more different dirs if you separate them +with semicolons. + +Also, if you plan to install the library to non-standard location, you might +want to set `CMAKE_INSTALL_RPATH` to `lib/` subdir of given prefix (e.g. +`/home/xyz/projects/lib`), so the dynamic libraries can be found at runtime. + @subsection building-windows Building on Windows On Windows you can use either MinGW or MSVC 2013 compiler. It's then up to you @@ -86,12 +95,11 @@ line. Note that for most convenient usage it's best use some dedicated directory (e.g. `C:/Sys`) for installing dependencies instead of putting each dependency to its own directory in `C:/Program Files`. Then add its `bin/` subdir (e.g. `C:/Sys/bin`) to PATH so all the DLLs are found when running the -executables. If you are using MinGW, the `C:/MinGW` directory is in most cases +executables. If you are using MinGW, the `C:/MinGW` directory is in most cases already prepared for exactly this. -When running CMake, set `CMAKE_INSTALL_PREFIX` parameter to that directory so -CMake knows where to look for installed libraries and where to install new -ones. +Then, when running CMake, set `CMAKE_PREFIX_PATH` and `CMAKE_INSTALL_PREFIX` +value to that directory (e.g. `-DCMAKE_INSTALL_PREFIX=C:/Sys`). @subsubsection building-windows-msvc Using Visual Studio @@ -116,8 +124,8 @@ On Windows you can also use QtCreator (just QtCreator, you don't need the full Qt SDK). Configure it to use CMake and either MSVC compiler or MinGW and and then just open project's root `CMakeLists.txt` file within it. QtCreator then asks you where to create build directory, allows you to specify initial CMake -parameters (e.g. `CMAKE_FIND_ROOT_PATH` and `CMAKE_INSTALL_PREFIX`) and then -you can just press *Configure* and everything is ready to be built. +parameters (e.g. `CMAKE_PREFIX_PATH` and `CMAKE_INSTALL_PREFIX`) and then you +can just press *Configure* and everything is ready to be built. After the initial import you might want to reconfigure some CMake variables, see @ref building-features "below" for more information. diff --git a/doc/cmake.dox b/doc/cmake.dox index 46ba9862a..9a7199bc4 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -41,6 +41,11 @@ Note that the module files are updated as the library evolves, you are encouraged to update your copies from time to time to avoid strange building issues. +If you installed the library or its dependencies to non-standard location +(other than `/usr`, e.g. `/home/xyz/projects`), set `CMAKE_PREFIX_PATH` to that +directory to help CMake find it. You can enter more different dirs if you +separate them with semicolons. + Basic usage is: find_package(Magnum REQUIRED) diff --git a/doc/getting-started.dox b/doc/getting-started.dox index e8d0ff721..21421ec26 100644 --- a/doc/getting-started.dox +++ b/doc/getting-started.dox @@ -164,14 +164,14 @@ straightforward way to create the project file is via the command-line: mkdir build cd build - cmake -DCMAKE_FIND_ROOT_PATH="C:/Sys" .. + cmake -DCMAKE_PREFIX_PATH="C:/Sys" .. You can also use CMake GUI. Then open the `MyApplication.sln` project file generated by CMake in the build directory. With QtCreator just open project's root `CMakeLists.txt` file. It then asks you where to create build directory, allows you to specify initial CMake parameters -(e.g. `CMAKE_FIND_ROOT_PATH`) and then you can just press *Configure* and +(e.g. `CMAKE_PREFIX_PATH`) and then you can just press *Configure* and everything is ready to be built. If CMake isn't able to find the dependencies on Windows, you might want to look