The next lines allows to compile with the support of some external libraries (sight-deps), in this example this is Qt.
The first thing to do is to discover where Qt is installed. This is done with the regular CMake command ``find_package(The_lib COMPONENTS The_component)``.
The first thing to do is to discover where Qt is installed. This is done with the regular CMake command
This will create a folder in the parent directory named sight-vcpkg-<sha1>, where <sha1> is the commit used to create the export from the sight-vcpkg repository.
...
...
@@ -181,10 +183,7 @@ Setting up your environment
Building your sources
----------------------
* `Clone <http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository#Cloning-an-Existing-Repository>`_ the following repository in the (Dev/Src) source folder:
* `sight <https://git.ircad.fr/Sight/sight.git>`_
* `Clone <http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository#Cloning-an-Existing-Repository>`_ sight `repository <https://git.ircad.fr/Sight/sight.git>`_ in the (Dev/Src) source folder:
.. code:: bash
...
...
@@ -213,43 +212,41 @@ Configuration
.. group-tab:: Linux
* Set the desired Build directory (e.g. Dev/Build/Debug or Release)
* Set the desired Source directory (e.g. Dev/Src/sight)
* Click on "configure".
* Set the desired Build directory (e.g. Dev/Build/Debug or Release)
* During configure step, choose the generator 'Ninja' to compile Sight sources.
* Set the desired Source directory (e.g. Dev/Src/sight)
.. tip:: An error will be raised, which is perfectly normal if you don't have set ``CMAKE_BUILD_TYPE``
to either ``Debug``, ``Release`` or ``RelWithDebInfo``. You can set it now and click again on "configure".
* Click on "configure".
.. tip:: If you compile an other project than sight, you will need to set the ``sight_DIR``
to the following path <SIGHT_INSTALL_PATH>/lib/cmake/sight.
* During configure step, choose the generator 'Ninja' to compile Sight sources.
.. tip:: An error will be raised, which is perfectly normal if you don't have set ``CMAKE_BUILD_TYPE``
to either ``Debug``, ``Release`` or ``RelWithDebInfo``. You can set it now and click again on "configure".
.. tip:: If you compile an other project than sight, you will need to set the ``sight_DIR``
to the following path ``<SIGHT_INSTALL_PATH>/lib/cmake/sight``.
.. group-tab:: Windows
* Set the desired Build directory (e.g. Dev/Build/Debug or Release)
* Set the desired Build directory (e.g. Dev/Build/Debug or Release)
* Set the desired Source directory (e.g. Dev/Src/sight)
* Set the desired Source directory (e.g. Dev/Src/sight)
* Click on 'Add Entry' and add the entry ``CMAKE_TOOLCHAIN_FILE`` with the value ..\sight-vcpkg-<sha1>\scripts\buildsystems\vcpkg.cmake
* Click on 'Add Entry' and add the entry ``CMAKE_TOOLCHAIN_FILE`` with the value ``..\sight-vcpkg-<sha1>\scripts\buildsystems\vcpkg.cmake``
.. warning::
This must be done on the very first configuration, otherwise, CMake will fail to find the Vcpkg binary packages.
If you miss this step, please erase your build and start again.
.. warning::
This must be done on the very first configuration, otherwise, CMake will fail to find the Vcpkg binary packages.
If you miss this step, please erase your build and start again.
* Click on "configure".
* Click on "configure".
* During the configure step, choose the generator 'Ninja' to compile Sight sources.
* During the configure step, choose the generator 'Ninja' to compile Sight sources.
.. tip:: An error will be raised, which is perfectly normal if you don't have set ``CMAKE_BUILD_TYPE``
to either ``Debug``, ``Release`` or ``RelWithDebInfo``. You can set it now and click again on "configure".
.. tip:: An error will be raised, which is perfectly normal if you don't have set ``CMAKE_BUILD_TYPE``
to either ``Debug``, ``Release`` or ``RelWithDebInfo``. You can set it now and click again on "configure".
.. tip:: If you compile an other project than sight, you will need to set the ``sight_DIR``
to the following path [path to sight install dir]/lib/cmake/sight.
.. tip:: If you compile an other project than sight, you will need to set the ``sight_DIR``
to the following path [path to sight install dir]/lib/cmake/sight.
Generation
...
...
@@ -259,35 +256,35 @@ Generation
.. group-tab:: Linux
* Set the following arguments:
Set the following arguments:
``CMAKE_BUILD_TYPE``:
Set to Debug or Release or RelWithDebInfo.
``CMAKE_INSTALL_PREFIX``:
Set the install location (e.g. Dev/Install/Debug).
Set the install location (e.g. ``Dev/Install/Debug``).
.. tip:: If you are generating an a sight-dependant project that you expect to integrate as a dependance in a third project,
it is recommended to set the same ``CMAKE_INSTALL_PREFIX`` as for sight.
``sight_DIR``:
If you generate a _Sight_ dependent project, set to [path to sight install dir]/lib/cmake/sight.
If you generate a _Sight_ dependent project, set to ``[path to sight install dir]/lib/cmake/sight``.
.. group-tab:: Windows
* Set the following arguments:
Set the following arguments:
``CMAKE_BUILD_TYPE``:
Set to Debug or Release or RelWithDebInfo.
``CMAKE_TOOLCHAIN_FILE``:
Set to ..\sight-vcpkg-<sha1>\scripts\buildsystems\vcpkg.cmake
Set to ``..\sight-vcpkg-<sha1>\scripts\buildsystems\vcpkg.cmake``
``CMAKE_INSTALL_PREFIX``:
Set the install location (e.g. Dev\Install\Debug).
Set the install location (e.g. ``Dev\Install\Debug``).
.. tip:: If you are generating an a sight-dependant project that you expect to integrate as a dependance in a third project,
it is recommanded to set the same ``CMAKE_INSTALL_PREFIX`` as for sight.
``sight_DIR``:
If you generate a sight dependent project, set to [path to sight install dir]\lib\cmake\sight.
``sight_DIR``:
If you generate a sight dependent project, set to ``[path to sight install dir]\lib\cmake\sight``.
* Click on "generate".
...
...
@@ -299,24 +296,24 @@ If you want to launch the ``cmake`` through the command line with the appropriat
* Compile the Sight source using ninja in the console:
Compile Sight source code using ninja in the console:
* Go to the build directory (e.g. Dev/Build/Debug or Release)
* Use "ninja" if you want to compile everything.
* Use "ninja name_of_application" to compile only one of the applications set in CMake.
- Go to the build directory (e.g. ``Dev/Build/Debug`` or ``Dev/Build/Release``)
- Use ``ninja`` if you want to compile everything.
- Use ``ninja name_of_application`` to compile only one application.
.. code:: bash
...
...
@@ -337,7 +334,7 @@ After a successful compilation any previously built application can be launched
.. tip:: If you are running a _Sight_ application which depends on a secondary project which depends on sight, you should add ``-B [secondary project install dir]/share/[secondary project]/``
.. tip:: If you have issues with some path sellection windows which don't open properly, you should add XDG_CURRENT_DESKTOP=qt before your application run.
.. tip:: If you have issues with some file dialogs which don't open properly, you should add XDG_CURRENT_DESKTOP=qt before your application run.
.. code:: bash
...
...
@@ -369,8 +366,8 @@ Generate an installer
Follow these two steps:
* Run *ninja install application_to_install* in the Build directory
* Run *ninja package* in the Build directory
* Run *ninja install application_to_install* in the Build directory
* Run *ninja package* in the Build directory
The installer will be generated in the Build directory.