[Bug] Fix file path issues in multiple CMake files#71
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes compile errors related to missing header files when integrating the framework as a subdirectory into another CMake project. The issue occurred because the framework was using CMAKE_SOURCE_DIR, which points to the top-level project's source directory rather than the framework's own root when used as a subdirectory. The fix replaces CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR combined with relative paths to correctly locate the framework's root directory regardless of how it's integrated.
Changes:
- Updated FRAMEWORK_ROOT_DIR definitions to use CMAKE_CURRENT_SOURCE_DIR with relative paths (../.., ../../.., etc.)
- Replaced CMAKE_SOURCE_DIR references with FRAMEWORK_ROOT_DIR in include directory specifications
- Updated root CMakeLists.txt configure_file() to use relative paths for better portability
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utilities/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition and replaced CMAKE_SOURCE_DIR with FRAMEWORK_ROOT_DIR in all include directories |
| src/service/task_worker/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition and include directory path |
| src/service/state_machine/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition and include directory path |
| src/service/rpc/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition and include directory path |
| src/service/ipc/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition and include directory path |
| src/service/event_bus/CMakeLists.txt | Added FRAMEWORK_ROOT_DIR definition and updated include directory path |
| src/service/data_model/CMakeLists.txt | Fixed incorrect "ezmsdk" path reference and updated to use FRAMEWORK_ROOT_DIR |
| src/service/cli/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition and include directory path |
| src/service/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition to use relative paths |
| src/middlewares/osal/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition and include directory path |
| src/middlewares/CMakeLists.txt | Removed unused FRAMEWORK_ROOT_DIR definition |
| src/hal/CMakeLists.txt | Updated FRAMEWORK_ROOT_DIR definition, include directory paths, and simplified target_link_libraries |
| CMakeLists.txt | Updated configure_file to use relative paths instead of CMAKE_SOURCE_DIR |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| message(STATUS "Hereeeeeeeeeeeeeee") | ||
| message(STATUS ${FRAMEWORK_ROOT_DIR}) | ||
|
|
There was a problem hiding this comment.
Debug messages should be removed before merging. These appear to be temporary debugging statements that were accidentally left in the code.
| message(STATUS "Hereeeeeeeeeeeeeee") | |
| message(STATUS ${FRAMEWORK_ROOT_DIR}) |
205c8c6 to
7ecd75b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This pull request fixes the compile error "missing header files" when integrating the ramework to a project.
Related Issues
Changes
Screenshots / Demo (if applicable)
Checklist
[ ] Tests added/updated and passing