diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-01-10 16:22:46 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 16:22:46 +0900 |
commit | a5e804c88d8c1940e920f91eea7a8be466eef53e (patch) | |
tree | b2247c33df52d6663c410b3608283dcb0c16dc82 | |
parent | de292f1537863846c9bb43de65a3c1ef4f37d18d (diff) | |
parent | 5d570825262a0ac0f78deedbd393c5d258493dc2 (diff) | |
download | libquotient-a5e804c88d8c1940e920f91eea7a8be466eef53e.tar.gz libquotient-a5e804c88d8c1940e920f91eea7a8be466eef53e.zip |
Merge pull request #271 from qsodev/example_install
added option for installation of qmc-example application
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | README.md | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c48a7ba9..f0f8ac5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.1) project(qmatrixclient CXX) +option(QMATRIXCLIENT_INSTALL_EXAMPLE "install qmc-example application" ON) + include(CheckCXXCompilerFlag) if (NOT WIN32) include(GNUInstallDirs) @@ -200,7 +202,9 @@ if (WIN32) install(FILES mime/packages/freedesktop.org.xml DESTINATION mime/packages) endif (WIN32) -install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +if (QMATRIXCLIENT_INSTALL_EXAMPLE) + install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif (QMATRIXCLIENT_INSTALL_EXAMPLE) if (UNIX AND NOT APPLE) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) @@ -63,6 +63,7 @@ You can install the library with CMake: cmake --build . --target install ``` This will also install cmake package config files; once this is done, you can use `examples/CMakeLists.txt` to compile the example with the _installed_ library. This file is a good starting point for your own CMake-based project using libQMatrixClient. +Installation of `qmc-example` application can be skipped by setting `QMATRIXCLIENT_INSTALL_EXAMPLE` to `OFF`. #### qmake-based The library provides a .pri file with an intention to be included from a bigger project's .pro file. As a starting point you can use `qmc-example.pro` that will build a minimal example of library usage for you. In the root directory of the project sources: |