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.
The include path is not set correctly when QHotkey is build as a subdirectory. Consider the following project structure:
When this is built,
CMAKE_SOURCE_DIR
refers tomy_project
, so the QHotkey header is not found by the targets defined inmy_project/CMakeLists.txt
. UsingCMAKE_CURRENT_SOURCE_DIR
intarget_include_directories
should fix this.