diff options
-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: |