From 2447b55ec0c29e459b6e682df9186af81be8fc3c Mon Sep 17 00:00:00 2001 From: Arian Rezazadeh Date: Thu, 30 Dec 2021 21:12:49 +0000 Subject: [PATCH] update cmake --- CMakeLists.txt | 12 ++++++------ README.md | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88a867e..df7b100 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.16) project(ClipboardXX) add_library(${PROJECT_NAME} INTERFACE) -target_include_directories(${PROJECT_NAME} INTERFACE include/) +target_include_directories(${PROJECT_NAME} INTERFACE include) -if(NOT WIN32) - find_package(Qt5 COMPONENTS Gui REQUIRED) - target_link_libraries(${PROJECT_NAME} INTERFACE Qt5::Gui) - target_include_directories(${PROJECT_NAME} INTERFACE ${Qt5Gui_INCLUDE_DIRS}) -endif() +install(FILES include/clipboardxx.hpp DESTINATION include) + +if(UNIX AND NOT APPLE) + target_link_libraries(${PROJECT_NAME} INTERFACE X11 pthread) +endif() \ No newline at end of file diff --git a/README.md b/README.md index 8ee0007..71b1a80 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,10 @@ in linux based operating systems, clipboardxx requires **X11** and **pthread** t There is currently **no support for MacOS**, Any contribute would be much appreciated. #### CMake -By using CMake, there is no need to manually change include path or link dependencies, Just put clipboardxx folder in your project subdirectoy and use `add_subdirectory` function to execute clipboardxx cmake configurations. +By using CMake, there is no need to manually change include path or link dependencies, Just put clipboardxx folder in your project subdirectoy and use `add_subdirectory` function to create `ClipboardXX` library and then link library to your target. ```cmake add_subdirectory(ClipboardXX) +target_link_libraries(your_target ClipboardXX) ``` ## Error handling In certain situations such as: