Skip to content

Commit

Permalink
update cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian8j2 committed Dec 30, 2021
1 parent 9e5b67c commit 2447b55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2447b55

Please sign in to comment.