Skycoder42 / QHotkey

A global shortcut/hotkey for Desktop Qt-Applications
BSD 3-Clause "New" or "Revised" License
552 stars 162 forks source link

fix include path in CMakeLists.txt #34

Closed mostvexingparse closed 4 years ago

mostvexingparse commented 4 years ago

The include path is not set correctly when QHotkey is build as a subdirectory. Consider the following project structure:

my_project
├── 3rdparty
│   ├──  QHotkey
│   └──  ... other deps
├── CMakeLists.txt # Main build targets, includes 3rdparty/QHotkey with 'add_subdirectory'
└──  ...

When this is built, CMAKE_SOURCE_DIR refers to my_project, so the QHotkey header is not found by the targets defined in my_project/CMakeLists.txt. Using CMAKE_CURRENT_SOURCE_DIR in target_include_directories should fix this.